-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
Store all config-specified DB params in state. #3182
Conversation
Prior to this commit, only database parameters that AWS recognised as being user-altered were stored in state. This would be fine, except if users specified the same value for a parameter as AWS' default for that value, they would get a perpetual diff, because AWS would report it as a non-user-changed parameter. Meaning it wouldn't be set in state, no matter how many times the user applied. This fixes the problem by retrieving all parameters, regardless of how AWS reports them being set. We then select out from those parameters only the ones that report that they're user-modified _or_ those that are found in a config, if a config is available. This commit also adds a test which exhibits this behaviour, which failed before this fix was applied, and passes now that it has been applied.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 one request otherwise looks great!
} | ||
} | ||
|
||
d.Set("parameter", flattenParameters(userParams)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check the error here please
Because our parameters are a set, let's just check the error when setting them in state, just in case.
Believe I addressed the request, happy with the resolution of it? |
This has been released in terraform-provider-aws version 1.9.0. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. |
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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
Prior to this commit, only database parameters that AWS recognised as
being user-altered were stored in state. This would be fine, except if
users specified the same value for a parameter as AWS' default for that
value, they would get a perpetual diff, because AWS would report it as a
non-user-changed parameter. Meaning it wouldn't be set in state, no
matter how many times the user applied.
This fixes the problem by retrieving all parameters, regardless of how
AWS reports them being set. We then select out from those parameters
only the ones that report that they're user-modified or those that are
found in a config, if a config is available.
This commit also adds a test which exhibits this behaviour, which failed
before this fix was applied, and passes now that it has been applied.
Test output:
Fixes #593.