-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Lambda Layers- New Version Every Run #7185
Comments
@bbernays I believe the reason this is occurring is because you have the From the AWS docs on object versioning:
A lambda layer resource in AWS has a source code hash that contains an sha256 hash of the actual source code. Likely what you're seeing is that the base64sha256 hash of the version id (a random string) is different than what AWS is returning as the source_code_hash of the lambda layer, so it shows a diff every time. I think you should be able to fix the issue (and still retain the behavior you want) by removing the |
@acburdine- Thank you for that! Do you think that the |
Does it not already? I thought it did. If not that’s something I must have overlooked implementing it initially, and can definitely be added |
No it doesn't. That's why I was trying to pass the |
@bbernays I tested this locally and unfortunately couldn't reproduce what you're seeing. I added an acceptance test that tested whether or not a changing version_id would update the lambda layer, using this configuration:
Changing the "source" of the s3_bucket object correctly caused the object and the layer version to be updated. I'd imagine there's something else going on that's causing you to not see your layer updating. Are you sure versioning is enabled on the s3 bucket that your lambda layer code is in? |
Closing due to lack of response to the above. If there is something else expected here, please do reach out. |
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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
Community Note
Terraform Version
Affected Resource(s)
Terraform Configuration Files
Debug Output
Panic Output
Expected Behavior
This should only be creating a new Lambda Layer Version when the Version_ ID changes
Actual Behavior
A new version is created every time that
terraform apply
is runSteps to Reproduce
terraform apply
Important Factoids
References
The text was updated successfully, but these errors were encountered: