Skip to content

Commit 6c72f7a

Browse files
authored
Merge pull request #9 from byu-oit/feature/timeoutOption
feature/timeoutOption -> master
2 parents e66a62a + a5129d9 commit 6c72f7a

File tree

5 files changed

+21
-3
lines changed

5 files changed

+21
-3
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Also Note: CodePipeline and CodeDeploy cannot be used together to deploy a Lambd
2626
## Usage
2727
```hcl
2828
module "lambda_api" {
29-
source = "github.com/byu-oit/terraform-aws-lambda-api?ref=v1.0.0"
29+
source = "github.com/byu-oit/terraform-aws-lambda-api?ref=v1.0.1"
3030
app_name = "my-lambda"
3131
env = "dev"
3232
codedeploy_service_role_arn = module.acs.power_builder_role.arn
@@ -41,6 +41,8 @@ module "lambda_api" {
4141
role_permissions_boundary_arn = module.acs.role_permissions_boundary.arn
4242
codedeploy_test_listener_port = 4443
4343
use_codedeploy = true
44+
timeout = 3
45+
memory_size = 128
4446
4547
codedeploy_lifecycle_hooks = {
4648
BeforeAllowTraffic = aws_lambda_function.test_lambda.function_name
@@ -93,6 +95,8 @@ module "lambda_api" {
9395
| lambda_policies | list(string) | List of IAM Policy ARNs to attach to the lambda role. | []
9496
| security_groups | list(string) | List of extra security group IDs to attach to the lambda. | []
9597
| use_codedeploy | bool | If true, CodeDeploy App and Deployment Group will be created and TF will not update alias to point to new versions of the Lambda (becuase CodeDeploy will do that). | false
98+
| timeout | number | How long the lambda will run (in seconds) before timing out | 3 (same as terraform default)
99+
| memory_size | number | Size of the memory of the lambda. CPU will scale along with it | 128 (same as terraform default)
96100

97101
#### codedeploy_lifecycle_hooks
98102

examples/no-codedeploy/example.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module "acs" {
99

1010
module "lambda_api" {
1111
# source = "../../"
12-
source = "github.com/byu-oit/terraform-aws-lambda-api?ref=v1.0.0"
12+
source = "github.com/byu-oit/terraform-aws-lambda-api?ref=v1.0.1"
1313
app_name = "my-lambda"
1414
env = "dev"
1515
lambda_zip_file = "./src/lambda.zip"

examples/simple-lambda-with-deploy-test/example.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module "acs" {
99

1010
module "lambda_api" {
1111
# source = "../../"
12-
source = "github.com/byu-oit/terraform-aws-lambda-api?ref=v1.0.0"
12+
source = "github.com/byu-oit/terraform-aws-lambda-api?ref=v1.0.1"
1313
app_name = "my-lambda-codedeploy"
1414
env = "dev"
1515
codedeploy_service_role_arn = module.acs.power_builder_role.arn

main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,8 @@ resource "aws_lambda_function" "api_lambda" {
247247
handler = var.handler
248248
runtime = var.runtime
249249
publish = true
250+
timeout = var.timeout
251+
memory_size = var.memory_size
250252

251253
dynamic "environment" {
252254
for_each = var.environment_variables != null ? [1] : []

variables.tf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,4 +109,16 @@ variable "use_codedeploy" {
109109
type = bool
110110
description = "If true, CodeDeploy App and Deployment Group will be created and TF will not update alias to point to new versions of the Lambda (becuase CodeDeploy will do that)."
111111
default = false
112+
}
113+
114+
variable "timeout" {
115+
type = number
116+
description = "Timeout (in seconds) for lambda. Defaults to 3 (terraform default"
117+
default = 3
118+
}
119+
120+
variable "memory_size" {
121+
type = number
122+
description = "Memory Size of the lambda"
123+
default = 128
112124
}

0 commit comments

Comments
 (0)