Skip to content

Commit 0fe683e

Browse files
authored
Merge pull request #4 from intelematics/feat/invoke_config
feat: add optional invoke config parms maximum_event_age_in_seconds &…
2 parents 3347320 + 2705786 commit 0fe683e

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

lambda.tf

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ resource "aws_lambda_function" "lambda" {
4848
}
4949
}
5050
}
51+
resource "aws_lambda_function_event_invoke_config" "lambda" {
52+
count = var.s3_bucket_lambda_package != null ? 0 : 1
53+
function_name = aws_lambda_function.lambda.function_name
54+
maximum_event_age_in_seconds = var.maximum_event_age_in_seconds
55+
maximum_retry_attempts = var.maximum_retry_attempts
56+
}
5157

5258
# Note the module must manage the s3 bucket, rather than this be created in the caller then passed in
5359
# It's currently a constraint of Terraform when using the conditional (count hack)
@@ -120,3 +126,10 @@ resource "aws_lambda_function" "lambda_from_s3" {
120126
}
121127
}
122128
}
129+
130+
resource "aws_lambda_function_event_invoke_config" "lambda_from_s3" {
131+
count = var.s3_bucket_lambda_package != null ? 1 : 0
132+
function_name = aws_lambda_function.lambda_from_s3.function_name
133+
maximum_event_age_in_seconds = var.maximum_event_age_in_seconds
134+
maximum_retry_attempts = var.maximum_retry_attempts
135+
}

variables.tf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,3 +136,12 @@ variable "vpc_config" {
136136
})
137137
default = null
138138
}
139+
140+
variable "maximum_event_age_in_seconds" {
141+
type = number
142+
default = 60
143+
}
144+
variable "maximum_retry_attempts" {
145+
type = number
146+
default = 2
147+
}

0 commit comments

Comments
 (0)