-
Notifications
You must be signed in to change notification settings - Fork 66
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
Add hash outputs of file content #142
Conversation
(copied from hashicorp/terraform-provider-archive#165 (comment)) Hello @zachwhaley - my apologies for the delay in getting these reviewed. Our team synced up with the Terraform Core engineers and discussed this PR. As currently implemented, users will need to apply changes twice on updates before they are realized in downstream resources/outputs/etc. This issue can be solved by using a CustomizeDiff, so the plan also sees the expected value changes, which in turn any references can also see those value changes at the same time. However, both local and archive providers are scheduled to be migrated to the Terraform Plugin Framework this quarter, and we have a strong preference to implement this feature using attribute plan modifiers with the framework. For now, we are going to hold off on bringing these changes in. Our plan is to reevaluate this once the migration to the plugin framework is complete. |
@zachwhaley the issue for tracking migration to the Terraform Plugin Framework is #84 |
@bendbennett I see that #84 has been closed 🎉 Is there another issue/PR to add the additional hash outputs that I can follow? |
Would you be happy to update this PR to use the latest changes in main for the additional hash outputs? |
I can take a look, but all of my changes have conflicts now so it may take me some time to work out the new way to do things. Y'all feel free to make the changes without me :) |
@bendbennett I've pushed my first attempt at resolving the conflicts, although I'm not sure if I'm taking advantage of the (edit) attribute plan modifiers @bookshelfdave mentioned. |
@zachwhaley thank you for updating the PR. Could you run Will ask the team to review this shortly. Thanks again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution! I left a few suggestions about changing the description for the id
attribute to add clarity. After you make those changes, run make generate
and commit it to Git so that those changes are reflected in the documentation.
Can you also add similar changes that you made to the tests in data_source_local_file_test
to the other resources/data sources?
@SBGoods Friendly poke :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The implementation here looks good to me! Two things:
- Can you add acceptance tests for the
local_sensitive_file
data source and both resources? - Can you add a Changelog entry for this change? Our
CONTRIBUTING.md
describes how to do this, but please let me know if the instructions are not clear. A potential changelog entry for this change can look like this under theFEATURES
category:
provider: added support for
MD5
,SHA1
,SHA256
, andSHA512
checksum outputs.
As always, please reach out if there are any questions, Thank you!
Yep 👍🏻
That seems like something y'all would want to do as opposed to external contributors? Would I put the entry under 2.3? Or add a new 2.4 release? Ultimately, I'd feel more comfortable if y'all updated that file :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Thanks again for the contribution!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Hi! @bendbennett Don't mean to rush y'all, but I was wondering how often this provider ships a release? I tried looking at the repo's documentation but didn't find anything. |
hi @zachwhaley - we don't have a defined cadence for releasing the utility providers. This release is queued behind a few other things, but it should be out in the next few weeks. My apologies for the delay! |
@zachwhaley We just released |
<Actions> <action id="433396668ffbe69847f17a09a6cf8e8e490b1f5912247cfc582e78aa0c952904"> <h3>Bump Terraform `local` provider version</h3> <details id="1d9343c012f5434ac9fe8a98135bae3667b399259be16d9b14302ea3bd424a24"> <summary>Update Terraform lock file</summary> <p>"hashicorp/local" updated from "2.4.0" to "2.4.0" in file ".terraform.lock.hcl"</p> <details> <summary>2.4.0</summary> <pre>Changelog retrieved from:
	https://github.com/hashicorp/terraform-provider-local/releases/tag/v2.4.0
NOTES:

* This Go module has been updated to Go 1.19 per the [Go support policy](https://golang.org/doc/devel/release.html#policy). Any consumers building on earlier Go versions may experience errors. ([#184](https://github.com/hashicorp/terraform-provider-local/issues/184))

FEATURES:

* resource/local_file: added support for `MD5`, `SHA1`, `SHA256`, and `SHA512` checksum outputs. ([#142](hashicorp/terraform-provider-local#142 resource/local_sensitive_file: added support for `MD5`, `SHA1`, `SHA256`, and `SHA512` checksum outputs. ([#142](hashicorp/terraform-provider-local#142 data-source/local_file: added support for `MD5`, `SHA1`, `SHA256`, and `SHA512` checksum outputs. ([#142](hashicorp/terraform-provider-local#142 data-source/local_sensitive-file: added support for `MD5`, `SHA1`, `SHA256`, and `SHA512` checksum outputs. ([#142](https://github.com/hashicorp/terraform-provider-local/issues/142))


</pre> </details> </details> </action> </Actions> --- <table> <tr> <td width="77"> <img src="https://www.updatecli.io/images/updatecli.png" alt="Updatecli logo" width="50" height="50"> </td> <td> <p> Created automatically by <a href="https://www.updatecli.io/">Updatecli</a> </p> <details><summary>Options:</summary> <br /> <p>Most of Updatecli configuration is done via <a href="https://www.updatecli.io/docs/prologue/quick-start/">its manifest(s)</a>.</p> <ul> <li>If you close this pull request, Updatecli will automatically reopen it, the next time it runs.</li> <li>If you close this pull request and delete the base branch, Updatecli will automatically recreate it, erasing all previous commits made.</li> </ul> <p> Feel free to report any issues at <a href="https://github.com/updatecli/updatecli/issues">github.com/updatecli/updatecli</a>.<br /> If you find this tool useful, do not hesitate to star <a href="https://github.com/updatecli/updatecli/stargazers">our GitHub repository</a> as a sign of appreciation, and/or to tell us directly on our <a href="https://matrix.to/#/#Updatecli_community:gitter.im">chat</a>! </p> </details> </td> </tr> </table> Co-authored-by: Jenkins Infra Bot (updatecli) <[email protected]>
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 contributions. |
Per #137 this brings the provider up to feature parity with all of Terraform's built-in file-reading functions
The following outputs are added to
local_file
,local_sensitive_file
,data_local_file
, anddata_local_sensitive_file
:content_md5
- MD5 checksum of file content.content_sha1
- SHA1 checksum of file content.content_sha256
- SHA256 checksum of file content.content_base64sha256
- Base64 encoded SHA256 checksum of file content.content_sha512
- SHA512 checksum of file content.content_base64sha512
- Base64 encoded SHA512 checksum of file content.Closes #137