Skip to content

Commit

Permalink
doc: add comment about the dependency on the log group
Browse files Browse the repository at this point in the history
  • Loading branch information
Neki committed Mar 25, 2021
1 parent 04a0416 commit 413af30
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ resource "aws_lambda_function" "this" {

tags = var.tags

# Depending on the log group is necessary to allow Terraform to create the log group before AWS can.
# When a lambda function is invoked, AWS creates the log group automatically if it doesn't exist yet.
# Without the dependency, this can result in a race condition if the lambda function is invoked before
# Terraform can create the log group.
depends_on = [null_resource.archive, aws_s3_bucket_object.lambda_package, aws_cloudwatch_log_group.lambda]
}

Expand Down

0 comments on commit 413af30

Please sign in to comment.