Store aws_db_instance.password in tfstate, change to AttrTypeCreate #309
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Not storing the password in tfstate makes it impossible to tell when it's changed in the resource file, so
terraform plan
would incorrectly report that everything was up-to-date (the RDS API won't tell us what the current password is). IMO, this was a misfeature; the password should be interpolated from a variable, and I imagine the most common user scenario to be an organization-readable resource file, and a locked-down set of variable and state files (state files likely contain other sensitive information anyway, like private IP addresses).That said, perhaps Terraform could use some mechanism of storing sensitive data in state files - in this case, since we only need to check for changes, we could get away with just hashing the password (or encrypting it). Alternatively,
password
wouldn't be an attribute at all, but an input prompted for whenever the DB instance is (re-)created. This would depend on a way to force recreation of a resource, though.