-
-
Notifications
You must be signed in to change notification settings - Fork 712
Provider produced inconsistent final plan in github actions pipeline #158
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
Comments
We are also running into this issue. |
Any chance somebody could take a look? We've had to work around the issue by manually packaging our lambdas for the time being but it would be really nice to use the module for that |
The issue happens when the correct zip archive is not yet created before running apply and previous If the content of |
We are seeing this now when we run |
The contents of the source code has not changed in our case, but because the repository is checked out separately between the plan and apply steps the metadata of the files changes (which in turn produces a different source code hash). We've had to work around this by forcibly setting the modification time on every file to a fixed point after checking out (which makes the hash generation fully deterministic) |
I would say this is not resolved by #175 but that that change enables a different form of deployment. I would still like to be able to use the lambda module to package my lambda code during a plan and then deploy that lambda code during an apply without error. |
Thanks, @zachwhaley ! Let's keep it open in case anyone can spend some time and make a fix for the problem you've described which is very much a valid use-case. |
Please take a look at #181 (version v2.16.0). It allows one to not worry about archive recreation when it has been deployed but currently missing (eg, a different step in the pipeline). It may be not 100% related to the issue but it will help a lot of users. Actually, I don't know a better solution at the moment. There is one important factor implemented by the module - I want to close this issue but please open a new one using the latest version of the module because there were several small improvements since this issue was originally created. |
For the record, we are still hitting this issue with all the workarounds and latest updates π© It seems to be a particular lambda that is the offender π€·π» I can create a new issue with more details once I've collected said details. Thanks for the hard work π |
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. |
Description
I'm seeing an issue deploying a lambda function using Github actions CI/CD. Specifically we have the pipeline set up to perform
terraform plan
, store the output, then runterraform apply
in a later step. The issue appears to be due to the source_code_hash attribute that is calculated during plan not matching the hash during apply:Versions
Terraform v0.15.1
on darwin_amd64
Reproduction
Steps to reproduce the behavior:
Are you using workspaces? : No
I think this is to do with the source files being checked out twice (once for plan and again for apply) and so having different metadata in each of the phases. I've been able to reproduce this issue locally by performing the following steps:
TF_RECREATE_MISSING_LAMBDA_PACKAGE=false terraform plan -out sandbox.plan
cp src/index.js src/index_1.js
rm src/index.js
mv src/index_1.js src/index.js
TF_RECREATE_MISSING_LAMBDA_PACKAGE=false terraform apply sandbox.plan
Code Snippet to Reproduce
main.tf
providers.tf
src/index.js
Expected behavior
The new lambda is applied by Terraform
Actual behavior
The new lambda deployment fails with
Error: Provider produced inconsistent final plan
Terminal Output Screenshot(s)
Additional context
The text was updated successfully, but these errors were encountered: