-
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
RDS resources with passwords always get destroyed / rebuilt #689
Comments
I wonder if this attribute should just be computed once then and never updated on read. |
It appears that the the password field is special-cased, so as to not keep it in the state file: I just ran into this too. I assume this means no one is using terraform to manage RDS in a production environment? |
I just ran into this as well. @ryanking Interestingly, that special-casing is at odds with the documentation which states the following (emphasis added):
Manually adding the plaintext password to the state file is a temporary workaround for the issue. Be sure to revert the change before committing though! I'm glad that the password is not stored in the state file, and I'm happy to see that this was done by design in the code. Perhaps storing the password in the state file as a hash, or using scrypt, would be advisable. That way the password could still be compared to see if it has changed between runs, but it would not need to be stored in plaintext in order to do so. |
Thats a general problem with passwords and confidential data in terraform. I think that would be a great idea to mark data as confidential in schema file, and store the hash of it in the state file. BTW - this problem also question the whole idea of putting the state file in version control. @mitchellh ^ ? |
I also have this issue. Actually this particular issue stops me from using terraform for production. I have switched to Ansible, but completely unhappy with it. |
It's worth noting that the RDS API's I too like @jlund's proposal that we store a hash of the password in the state file to detect changes. Then if we can add Update support to the |
+1 for this to get somehow solved. Maybe worth looking into how Ansible deals with confidential information through a concept of a vault |
Several of the arguments were optional, and if omitted, they are calculated. Mark them as such in the schema to avoid triggering an update. Go back to storing the password in the state file. Without doing so, there's no way for Terraform to know the password has changed. It should be hashed, but then interpolating the password yields a hash instead of the password. Make the `name` parameter optional. It's not required in any engine, and in some (MS SQL Server) it's not allowed at all. Drop the `skip_final_snapshot` argument. If `final_snapshot_identifier` isn't specified, then don't make a final snapshot. As things were, it was possible to create a resource with neither of these arguments specified which would later fail when it was to be deleted since the RDS API requires exactly one of the two. Resolves issue hashicorp#689.
Alright the fix for this was just merged and should come out with 0.3.7! 💃 For now we are storing the password in plaintext in the state file and documenting that fact. Further discussion around the general topic of sensitive values in the state file can be found over at #516 . |
Thanks! 🎉 |
Several of the arguments were optional, and if omitted, they are calculated. Mark them as such in the schema to avoid triggering an update. Go back to storing the password in the state file. Without doing so, there's no way for Terraform to know the password has changed. It should be hashed, but then interpolating the password yields a hash instead of the password. Make the `name` parameter optional. It's not required in any engine, and in some (MS SQL Server) it's not allowed at all. Drop the `skip_final_snapshot` argument. If `final_snapshot_identifier` isn't specified, then don't make a final snapshot. As things were, it was possible to create a resource with neither of these arguments specified which would later fail when it was to be deleted since the RDS API requires exactly one of the two. Resolves issue hashicorp#689.
This issue has re-appeared with TF 0.9.4 |
@djandruczyk I'm also seeing this. Have you found a work around? |
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. |
If you run
terraform plan
immediately after a cleanterraform apply
with an RDS resource, the presence of a password field causes terraform to report the following:password: "" => "foobarfoobar" (forces new resource)
I'm guessing because the interrogation it does of running resources doesn't bring the password back.
The text was updated successfully, but these errors were encountered: