Skip to content
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

Don't read back opsworks stack cookbooks source password #6203

Merged
merged 1 commit into from
Apr 16, 2016
Merged

Don't read back opsworks stack cookbooks source password #6203

merged 1 commit into from
Apr 16, 2016

Conversation

apparentlymart
Copy link
Contributor

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.

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.
if v.Revision != nil {
m["revision"] = *v.Revision
}
// v.Password will, on read, contain the placeholder string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where does it have *****FILTERED*****?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AH! It comes back from the API :)

@stack72
Copy link
Contributor

stack72 commented Apr 16, 2016

LGTM! thanks @apparentlymart

@stack72 stack72 merged commit e416161 into hashicorp:master Apr 16, 2016
@eedwardsdisco
Copy link

@apparentlymart This is still happening in 0.6.16

The Terraform execution plan has been generated and is shown below.
Resources are shown in alphabetical order for quick scanning. Green resources
will be created (or destroyed and then created if an existing resource
exists), yellow resources are being changed in-place, and red resources
will be destroyed.

Note: You didn't specify an "-out" parameter to save this plan, so when
"apply" is called, Terraform can't guarantee this is what will execute.

~ aws_opsworks_stack.elasticsearch
    custom_cookbooks_source.0.password: "" => "<MY_IAM_PASSWORD (REDACTED)>"

@apparentlymart
Copy link
Contributor Author

@eedwardsdisco thanks for pointing that out. Looks like my fix here wasn't correct. I've opened a new issue #6826 to track the new bug.

@ghost
Copy link

ghost commented Apr 25, 2020

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.

@ghost ghost locked and limited conversation to collaborators Apr 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

aws_opsworks_stack custom cookbook password keeps re-applying
3 participants