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

fix: No need to set aws_s3_bucket_object etag as filename is already a hash of the content #180

Merged
merged 2 commits into from
Aug 20, 2021

Conversation

pdecat
Copy link
Contributor

@pdecat pdecat commented Jul 15, 2021

Description

There is no need to set the optional etag field of the aws_s3_bucket_object resource as the filename is a hash of the content that only changes when the actual content changes.

Setting etag to a computed MD5 hash of the locally built zip archive used to always trigger changes.

Motivation and Context

When building packages on several workspaces, the MD5 sum of the locally built zip archive always changes.
Setting the TF_RECREATE_MISSING_LAMBDA_PACKAGE to false alone does not resolve that issue.

Breaking Changes

N/A

How Has This Been Tested?

  • I have tested and validated these changes using one or more of the provided examples/* projects

When package source content changes, the hash of the zip archive changes, it is properly uploaded to S3, and the Lambda is properly updated to use that version.

@pdecat pdecat changed the title No need to set aws_s3_bucket_object etag as filename is a already hash of the content No need to set aws_s3_bucket_object etag as filename is already a hash of the content Jul 15, 2021
@pdecat pdecat marked this pull request as ready for review July 16, 2021 08:58
@pdecat pdecat changed the title No need to set aws_s3_bucket_object etag as filename is already a hash of the content fix: No need to set aws_s3_bucket_object etag as filename is already a hash of the content Jul 22, 2021
…t only changes when the actual content changes, while the computed etag was a MD5 hash of the locally built zip archive which always changed
@antonbabenko antonbabenko merged commit fd86a89 into terraform-aws-modules:master Aug 20, 2021
@antonbabenko
Copy link
Member

Looks good, thank you!

v2.11.0 has been just released.

PS: Thanks for all other PRs and comments, I am going to reply to those one at a time (ping me if you think one is more urgent than another).

@pdecat pdecat deleted the no_s3_etag branch August 20, 2021 21:26
@github-actions
Copy link

github-actions bot commented Nov 9, 2022

I'm going to lock this pull request 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 related to this change, 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 Nov 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants