-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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
Question: How to store an arbitrary value in state? #32270
Comments
Related: #31757 |
@jbardin I didn't think |
How about:
Not perfect as Terraform will always want to create the resource, but the value is stored in state. |
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. |
Terraform Version
Use Cases
I want to store an arbitrary value in state. I will know the value (passed in by an environment variable), and I just want to store it in state. I imagine there is a provider for this somewhere but I couldn't see an easy one to use .
My actual usecase is that I want to know from which git commit a terraform infra was last deployed. I have all my terraform resources in a module (module.root), so i figure outside the top level module I'll have some arbirary resource like this:
This will mean the some_resource only gets applied when everything in the module.root is successfully applied - great!
By looking at all my git_commit_hash resources across all my statefiles I will understand the last successful githash that was applied.
Attempted Solutions
I am looking for a provider or terraform resource that can just store a value, and I cant think of one, despite searching. I'm sure there is one
Proposal
No response
References
No response
The text was updated successfully, but these errors were encountered: