-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
aws_opsworks_stack custom cookbook password keeps re-applying #6192
Comments
Oh, whoops... Looks like we missed another one of these odd cases where opsworks returns a placeholder string in place of a secret. This api does this a lot and each case requires some special handling to ignore the value when refreshing. Thanks for the report! Agreed that the solution here is likely similar to the other one you linked, and indeed a few others. 😀 |
As with several other sensitive values in Opsworks, the API returns a placeholder value rather than a nil. To avoid writing the placeholder value into the state we just skip updating the password on read, letting whatever value was in the state persist. This means that Terraform can't detect configuration drift where someone has changed the password via some other means, but Terraform will still be able to recognize changes to the password made within Terraform itself due to the "last-written" value in the state. This fixes #6192.
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
v0.6.14
Affected Resource(s)
Terraform Configuration Files
Expected Behavior
Terraform should have created the stack and set a value to the password field. On subsequent plan runs Terraform should report
No changes. Infrastructure is up-to-date.
.Actual Behavior
Terraform correctly creates the stack and sets the password. However on subsequent plan runs terraform reports
If I run an apply Terraform will correctly set the password. Terraform will continue to report that the resource needs to be updated.
After Terraform successfully sets the password If I try to comment out the password line in the TF file Terraform will try to set the password to an empty string.
This issue is more than just a minor annoyance. Every time Terraform unnecessarily updates the stack s3 password it removes the custom JSON associated with that stack.
Which in turn causes any instances associated with the stack to fail.
Steps to reproduce
terraform plan
and you should receive the unexpected output.References
The text was updated successfully, but these errors were encountered: