File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ module "lambda_function" {
26
26
source_path = " ${ path . module } /../fixtures/python3.8-app1"
27
27
28
28
store_on_s3 = true
29
- s3_bucket = module. s3_bucket . this_s3_bucket_id
29
+ s3_bucket = module. s3_bucket . s3_bucket_id
30
30
31
31
layers = [
32
32
module . lambda_layer_local . this_lambda_layer_arn ,
@@ -183,7 +183,7 @@ module "lambda_layer_s3" {
183
183
source_path = " ${ path . module } /../fixtures/python3.8-app1"
184
184
185
185
store_on_s3 = true
186
- s3_bucket = module. s3_bucket . this_s3_bucket_id
186
+ s3_bucket = module. s3_bucket . s3_bucket_id
187
187
}
188
188
189
189
# #############
Original file line number Diff line number Diff line change @@ -83,7 +83,11 @@ resource "aws_lambda_function" "this" {
83
83
84
84
tags = var. tags
85
85
86
- depends_on = [null_resource. archive , aws_s3_bucket_object . lambda_package ]
86
+ # Depending on the log group is necessary to allow Terraform to create the log group before AWS can.
87
+ # When a lambda function is invoked, AWS creates the log group automatically if it doesn't exist yet.
88
+ # Without the dependency, this can result in a race condition if the lambda function is invoked before
89
+ # Terraform can create the log group.
90
+ depends_on = [null_resource. archive , aws_s3_bucket_object . lambda_package , aws_cloudwatch_log_group . lambda ]
87
91
}
88
92
89
93
resource "aws_lambda_layer_version" "this" {
You can’t perform that action at this time.
0 commit comments