-
-
Notifications
You must be signed in to change notification settings - Fork 656
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
Module always detect change even if src code doesn't change #339
Comments
Nobody's faced this issue so far? |
Seeing the same behaviour |
Let's wait for other people, it's pretty annoying because I don't want that terraform deploys every time even if the src doesn't change. |
I have this issue, or at least a very similar one - I use the archive_file resource to just create a dummy zip with an empty txt file in it just so I can create the lambda skeleton. Then I perform code updates and deployments using gitlab CI. However, when I run terraform in CI-CD, as the dummy zip is generated in the different location, the filename changes, and thus it wants to re-deploy the function.. back as a dummy again. I had hoped the ignore_source_code_hash = true Arguments would help but they don't seem to. |
regarding the above, I think if the filename didn't use the full path (which can change based on execution environment) as part of calculating a change then this would not occur. To be honest i'm not sure if this is more a terraform issue itself or this module. I've now gone with the below featuring a static dummy archive. local_existing_package = "../../../lib/lambda_dummy.zip" and now the file itself doesn't change location due to not being generated during terraform execution I don't see my issue, so back to the OP's query- mine isn't related. |
@dc2tom I had the same issue in CI/CD context and rather than fighting with cache or any other persistency it is better to add ZIP creation just before calling terraform apply: - name: Prepare deployment package for Lambda
working-directory: lambda
run: |
touch -t 202001010000 index.js
zip -X deployment.zip index.js then: create_package = !var.install_deployment_zip
source_path = var.install_deployment_zip ? null : "${path.module}/lambda/index.js"
local_existing_package = var.install_deployment_zip ? "${path.module}/lambda/deployment.zip" : null so I can set |
I'm also hitting the same issue as I noticed that the
Is there any way to fix this issue other than building the package outside of the module @antonbabenko ? |
I'm seeing this problem when using this module through terragrunt. It seems that terragrunt creates a file in the source directory named Since my lambda only has a single source file, I'm fixing it by setting the filename as the |
I noticed that terragrunt will add that file but I have excluded it via the use of patterns too. I enabled debug logging and saw every single file being added to the zip and none of them are terragrunt related. The problem is that it reports there are changes when running through GitHub Actions since the runner directory is different. GitHub Actions:
Local Machine:
|
This issue has been automatically marked as stale because it has been open 30 days |
This issue was automatically closed because of stale in 10 days |
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. |
Hello everyone.
The problem is simple. I have a configuration with this module, but at every 'terraform plan' it detect changes even though the src code hasn't changed at all.
Is there a way to fix the issue?
An example of my setup:
The text was updated successfully, but these errors were encountered: