Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make lambda timeout a variable #38

Merged
merged 1 commit into from
Apr 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion terraform/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Please Use [Terraform Registry](https://registry.terraform.io/modules/giuliocalz
| delete_after | `7` | Numbers of days to preserve | `15` | False |
| python_version | `3.6` | Python version to be used | `3.6` | False |
| schedule | `cron(0 3 * * ? *)` | Cron Schedule expression for running the cleanup function | `cron(0 3 * * ? *)` | False |
| timeout | `300` | Maximum lambda execution time | `300` | False |
| prefix | `public-` | A prefix for the resource names, this helps create multiple instances of this stack for different environments | | False |
| suffix | `-public` | A prefix for the resource names, this helps create multiple instances of this stack for different environments | | False |
| subnet_ids | `["subnet-1111111", "subnet-222222"]` | Subnet IDs you want to deploy the lambda in. Only fill this in if you want to deploy your Lambda function inside a VPC. | | False |
Expand Down Expand Up @@ -58,4 +59,4 @@ module "vpc_es_cleanup" {


### Issue
In order order to use new module version you must have `terraform-provider-aws` greated than `~> 2.7` and use Terraform `~> 0.12`
In order order to use new module version you must have `terraform-provider-aws` greated than `~> 2.7` and use Terraform `~> 0.12`
2 changes: 1 addition & 1 deletion terraform/lambda.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ resource "aws_lambda_function" "es_cleanup" {
filename = data.null_data_source.lambda_file.outputs.filename
function_name = "${var.prefix}es-cleanup${var.suffix}"
description = "${var.prefix}es-cleanup${var.suffix}"
timeout = 300
timeout = var.timeout
runtime = "python${var.python_version}"
role = aws_iam_role.role.arn
handler = "es-cleanup.lambda_handler"
Expand Down
4 changes: 4 additions & 0 deletions terraform/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ variable "schedule" {
default = "cron(0 3 * * ? *)"
}

variable "timeout" {
default = 300
}

variable "es_endpoint" {
}

Expand Down