terraform-aws-modules / terraform-aws-lambda

Terraform module, which takes care of a lot of AWS Lambda/serverless tasks (build dependencies, packages, updates, deployments) in countless combinations πŸ‡ΊπŸ‡¦
https://registry.terraform.io/modules/terraform-aws-modules/lambda/aws
Apache License 2.0
911 stars 683 forks source link

fix: Forces the local_filename output to wait for the package to be built #356

Closed lorengordon closed 1 year ago

lorengordon commented 1 year ago

Description

Uses depends_on to force the output local_filename to wait until the package is available, so the output can be relied on to tailor the terraform graph in cases where the package must be available before it is used.

Fixes #355

Motivation and Context

See #355

Breaking Changes

I don't believe there are any breaking changes.

How Has This Been Tested?

antonbabenko commented 1 year ago

This PR is included in version 4.1.1 :tada:

lorengordon commented 1 year ago

@antonbabenko You are amazing. πŸ₯‡

Example output showing the lambda function is waiting for the package to finish:

module.test_create_package.null_resource.archive[0] (local-exec): Base64sha256: mjUxYWr/sarJAcoe9xYIG6+geDQg4Gn9+/h8HNhhtPQ=
module.test_create_package.null_resource.archive[0]: Creation complete after 11s [id=1861059490256417180]
module.test_create_function.module.lambda.aws_lambda_function.this[0]: Creating...
module.test_create_function.module.lambda.aws_lambda_function.this[0]: Still creating... [10s elapsed]
module.test_create_function.module.lambda.aws_lambda_function.this[0]: Creation complete after 12s [id=foo]
github-actions[bot] commented 1 year ago

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.