-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
Support ChecksumSHA256 in aws_s3_object data source output #23901
Comments
This would be useful to me too in conjunction with the aws_signer_signing_job, as i want to know the checksum ob the artifact it uploaded to S3. |
I'm automating lambda layer and function updates from objects delivered to an S3 bucket right now, and doing so is a little clunky without support for this. What I'm doing at the moment is adding the sha256 value to the object's metadata when I copy it:
Then I'm using Aside from being clunky, this is not great because I have to trust that the metadata on the object is correct. In this case I think the worst that can happen is the metadata value is wrong, and the object gets re-deployed, though. I'm delivering layer.zip to S3 outside of Terraform because it's non-deterministic, so the hash is changing every time anyway. My choices are I think to do this (and control updates via my CI system), or implement something where I download the file to have Terraform read it via |
This functionality has been released in v5.17.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
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. |
Community Note
Description
I do have a project setup were i need to handle lambda update triggers by providing lambda layer code from an S3 bucket. I cannot provide the code on runtime e.g. terraform apply because the internal hash calculation seems to differ on different machines which may be a bug but that is not my point. I just found out that AWS S3 API supports "custom" checksums additionally to the ETag. Those have been introduced in February of 2022 . Thus the AWS API now supports additional parameters to access those values which are available in the go API as well e.g. https://docs.aws.amazon.com/sdk-for-go/api/service/s3/#GetObjectOutput (Note: They messed up theirs docs but it is there!). You can see it in the GetObjectOutput struct:
I would really love to have access to those parameters on the aws_s3_object data source. It would help a lot.
New or Affected Resource(s)
Potential Terraform Configuration
References
The text was updated successfully, but these errors were encountered: