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

Building Dependencies Works Even if a Command Fails #388

Closed p0fi closed 1 year ago

p0fi commented 1 year ago

Description

When using the build dependencies functionality of this module via the commands array the success of any given command is not considered when running the next commands form the array.

Versions

Reproduction Code [Required]

If a commands array might look like this:

commands = [
  "yarn install",
  "yarn build",
  ":zip dist/index.js ."
]

Every command is still run, no matter how the previous command exited. It does not make sense to run a build if an install failed and furthermore a zip would result in something completely different from what is expected.

Steps to reproduce the behavior:

  1. Modify the install command to make it fail.
  2. Run terraform apply

Expected behavior

Apply would fail with an error message.

Actual behavior

Apply works fine but lambda code is not working since it was not build correctly.

Terminal Output Screenshot(s)

–

Additional context

Noticed the problem when yarn install commands would fail in CI but the run was "successful" but lambdas didn't work.

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has been open 30 days with no activity. Remove stale label or comment or this issue will be closed in 10 days

p0fi commented 1 year ago

This is still an issue

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has been open 30 days with no activity. Remove stale label or comment or this issue will be closed in 10 days

p0fi commented 1 year ago

This is still a problem

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has been open 30 days with no activity. Remove stale label or comment or this issue will be closed in 10 days

p0fi commented 1 year ago

This is still an issue 😒

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has been open 30 days with no activity. Remove stale label or comment or this issue will be closed in 10 days

github-actions[bot] commented 1 year ago

This issue was automatically closed because of stale in 10 days

vecchp commented 1 year ago

I believe this is still an issue

github-actions[bot] commented 1 year ago

I'm going to lock this issue 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 similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.