File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff 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+ }
Original file line number Diff line number Diff 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+ }
You can’t perform that action at this time.
0 commit comments