-
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 custom_cookbooks_source ssh_key keeps reapplying #3635
Comments
In the OpsWorks API there are a number of "write-only" attributes that return garbage like that on read. The Terraform support is supposed to skip these on I missed this one in the docs when I was implementing. I think the fix could be as simple as removing the code that assigns this, but I'm not near my Terraform dev environment to test this right now. I'll take a look when I get a chance, unless someone else feels like attacking it in the mean time. |
You can't just remove the setter. The write-only support has not been added to opsworks-stack, only classes that inherit from opsworks-layers. (Which puts it slightly beyond my midnight go coding abilities) |
"Write-only" is a concept that was invented just for those attributes, to enable code sharing between all of the layers. Since there's only one "stack" resource type, such generalization shouldn't be needed there. All that write-only flag does is cause the value to be skipped during I'll try to dig in some more during the week. |
Ahh, I'll try some more this week then, assuming I can find time. What I saw after removing those lines was it trying to set it anyhow, but the state file having no setting for that item. |
Fixes hashicorp#3635 This follows the suggestion of @apparentlymart in hashicorp#3635 (comment) to fix the issue of OpsWorks stacks always complaining about the custom cookbooks SSH key needing to be changed. Functional tests: * Created a new stack and gave it an SSH key. The key was written to OpsWorks properly. * Ran "plan" again and terraform indicated it needed to change the SSH key, which is expected since terraform cannot read what the existing SSH is. * Removed the key from my resource and this time, "plan" did not have any changes. The `tfstate` file indicated the SSH key was "" (empty string). * Changed an unrelated property of the stack. Previously this was not working for me due to terraform attempting to change the SSH key.
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. |
I have
Once the stack is created the key is correct and everything is fine. On subsequent runs it updates the key again. The state file lists the key as "****FILTERED****". I'm not sure there is a good way to tell when to and when not to update this. But I'm hoping there is an option other than updating every single time.
The text was updated successfully, but these errors were encountered: