Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 2a59ba2

Browse files
feat: Added timeouts for Lambda Functions (#485)
1 parent db9e6da commit 2a59ba2

File tree

5 files changed

+20
-6
lines changed

5 files changed

+20
-6
lines changed

‎.pre-commit-config.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/antonbabenko/pre-commit-terraform
3-
rev: v1.80.0
3+
rev: v1.81.0
44
hooks:
55
- id: terraform_fmt
66
- id: terraform_validate

‎README.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -847,6 +847,7 @@ No modules.
847847
| <a name="input_store_on_s3"></a> [store\_on\_s3](#input\_store\_on\_s3) | Whether to store produced artifacts on S3 or locally. | `bool` | `false` | no |
848848
| <a name="input_tags"></a> [tags](#input\_tags) | A map of tags to assign to resources. | `map(string)` | `{}` | no |
849849
| <a name="input_timeout"></a> [timeout](#input\_timeout) | The amount of time your Lambda Function has to run in seconds. | `number` | `3` | no |
850+
| <a name="input_timeouts"></a> [timeouts](#input\_timeouts) | Define maximum timeout for creating, updating, and deleting Lambda Function resources | `map(string)` | `{}` | no |
850851
| <a name="input_tracing_mode"></a> [tracing\_mode](#input\_tracing\_mode) | Tracing mode of the Lambda Function. Valid value can be either PassThrough or Active. | `string` | `null` | no |
851852
| <a name="input_trusted_entities"></a> [trusted\_entities](#input\_trusted\_entities) | List of additional trusted entities for assuming Lambda Function role (trust relationship) | `any` | `[]` | no |
852853
| <a name="input_use_existing_cloudwatch_log_group"></a> [use\_existing\_cloudwatch\_log\_group](#input\_use\_existing\_cloudwatch\_log\_group) | Whether to use an existing CloudWatch log group or create new | `bool` | `false` | no |

‎examples/complete/main.tf‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,12 @@ module "lambda_function" {
166166
}
167167
}
168168

169+
timeouts = {
170+
create = "20m"
171+
update = "20m"
172+
delete = "20m"
173+
}
174+
169175
tags = {
170176
Module = "lambda1"
171177
}

‎main.tf‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,12 @@ resource "aws_lambda_function" "this" {
112112
}
113113
}
114114

115+
timeouts {
116+
create = try(var.timeouts.create, null)
117+
update = try(var.timeouts.update, null)
118+
delete = try(var.timeouts.delete, null)
119+
}
120+
115121
tags = var.tags
116122

117123
depends_on = [

‎variables.tf‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,6 @@ variable "runtime" {
7272
description = "Lambda Function runtime"
7373
type = string
7474
default = ""
75-
76-
# validation {
77-
# condition = can(var.create && contains(["nodejs10.x", "nodejs12.x", "java8", "java11", "python2.7", " python3.6", "python3.7", "python3.8", "dotnetcore2.1", "dotnetcore3.1", "go1.x", "ruby2.5", "ruby2.7", "provided"], var.runtime))
78-
# error_message = "The runtime value must be one of supported by AWS Lambda."
79-
# }
8075
}
8176

8277
variable "lambda_role" {
@@ -241,6 +236,12 @@ variable "replacement_security_group_ids" {
241236
default = null
242237
}
243238

239+
variable "timeouts" {
240+
description = "Define maximum timeout for creating, updating, and deleting Lambda Function resources"
241+
type = map(string)
242+
default = {}
243+
}
244+
244245
###############
245246
# Function URL
246247
###############

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /