Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Terraform saving s3key of lambda to state, when deploy failed due to s3key not found #18054

Closed
lijok opened this issue Mar 11, 2021 · 2 comments
Labels
bug Addresses a defect in current functionality. service/lambda Issues and PRs that pertain to the lambda service.

Comments

@lijok
Copy link

lijok commented Mar 11, 2021

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform CLI and Terraform AWS Provider Version

Terraform v0.14.6

  • provider registry.terraform.io/grafana/grafana v1.8.1
  • provider registry.terraform.io/hashicorp/aws v3.12.0
  • provider registry.terraform.io/hashicorp/null v3.0.0
  • provider registry.terraform.io/hashicorp/random v3.0.1
  • provider registry.terraform.io/hashicorp/template v2.2.0
  • provider registry.terraform.io/hashicorp/tls v3.0.0

Affected Resource(s)

  • aws_lambda_function

Terraform Configuration Files

Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.

# Copy-paste your Terraform configurations here - for large Terraform configs,
# please use a service like Dropbox and share a link to the ZIP file. For
# security, you can also encrypt the files using our GPG public key: https://keybase.io/hashicorp

Debug Output

Panic Output

Expected Behavior

if s3key is not found, on next plan, terraform shows diff that lambda needs to be updated

Actual Behavior

if s3key is not found, terraform saves the key to state anyway, so there's no diff between the code and the state, so it doesnt want to redeploy the lambda on next plan

Steps to Reproduce

  1. terraform apply
  2. change s3key to non-existing one
  3. terraform apply
  4. observe the apply fail due to key not found
  5. change nothing
  6. terraform plan
  7. observe plan output empty

Important Factoids

References

  • #0000
@ghost ghost added the service/lambda Issues and PRs that pertain to the lambda service. label Mar 11, 2021
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Mar 11, 2021
@breathingdust breathingdust added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Sep 8, 2021
@ewbankkit
Copy link
Contributor

@lijok Thanks for raising this issue.
It has already been noticed in #25886. I'm going to close this one as a duplicate so that we can concentrate discussion in the linked issue.
Please add any additional comments there.

@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/lambda Issues and PRs that pertain to the lambda service.
Projects
None yet
Development

No branches or pull requests

3 participants