-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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
A aws_ssm_parameter with a lifecycle ignore changes for value stores the secret in state file #20349
Comments
Hi @aaronbrashears, "ignore_changes " is intended to direct terraform not to modify a resource if the indicated attribute changes. This does not prevent the attribute from ending up in state, however. While I'm making a bit of an educated guess here, I presume that terraform gets the new value during "refresh" and that's why you see it in state. You can read more about sensitive secrets in terraform state here. We strongly recommend that you use a remote state background that supports encryption at rest. This issue has a lot of good discussion and background on the topic of encrypting state. I'm sorry I don't have a more satisfying response for you! |
^ The above certainly makes sense, but I'm wondering whether we could consider this a feature request - for the ability for My use case: although I have an encrypted state backend, I like to provide read-only access to it in CI for the purposes of regularly reporting on drift. There are certain secret parameters that I would like to keep out of the state - and I don't need to manage those values in Terraform, but I'd still like to manage the rest of the resources without having to have those values recorded. |
Indeed, it seems like this request is mainly a re-statement of the use-case "provide a way to omit sensitive values from state", which is being covered by #516, so I'm going to close this out just to consolidate over there. |
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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Terraform Version
Terraform Configuration Files
Expected Behavior
I would expect that the lifecycle directives would ignore the change to the key.
Actual Behavior
The Secure string shows up in the tfstate file.
Steps to Reproduce
terraform apply
the eariler snippet.Additional Context
I am uncertain if this is a lifecycle bug or a a provider bug. Is it expected to extract the secret from the secure store and place it in the not secured at all tfstate file?
The text was updated successfully, but these errors were encountered: