-
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
aws db parameter group ... converts keys and values to lower case and fails 'apply' due to aws_db_parameter_group changes #15583
Comments
This also affects |
Issue is still present with Terraform v0.14.4
In contrast to original report the tfstate file is now case sensitive. We have the following (shortened): terraform file:
tfstate file:
Plan output:
Terraform trace log:
|
I've been looking into this and I believe I have a good idea of what is going on, but I would like to confirm I'm matching the cases that are being reported. @jochen-st or @ebgc, can you please post a complete Terraform config I can run that will replicate your issue? |
@bill-rich Please find below the Terraform config. I was using RDS Module.
After apply, the
Note that parameters with mixed case (like |
This has been released in version 3.33.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks! |
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! |
This issue was originally opened by @ebgc as hashicorp/terraform#9215. It was migrated here as a result of the provider split. The original body of the issue is below.
Hi there,
Thank you for opening an issue. Please note that we try to keep the Terraform issue tracker reserved for bug reports and feature requests. For general usage questions, please see: https://www.terraform.io/community.html.
Terraform Version
mac os x 10.12
Terraform v0.7.4
Affected Resource(s)
Terraform Configuration Files
Debug Output
1 error(s) occurred:
Please include the following information in your report:
Panic Output
n.a.
Expected Behavior
take what aws api returns without modification (dont use flattenParameters)
save what tf file defines at tfstate file without modification (dont use flattenParameters)
Actual Behavior
all keys and values will be down-cased on tfstate file even though on initial run they are set on aws as defined in tf file
Steps to Reproduce
have an aws_db_instance (postgres, 9.4.5) with resource_aws_db_parameter_group (postgres9.4) which sets 'lc_messages' to 'en_US.utf8', or 'timezone' to 'UTF'
even though we set 'en_US.utf8' in tf file (terraform during 'apply' will set 'en_US.utf8' on aws rds resource) - tfstate file will have 'en_us.utf8' set.
next run of terraform 'apply' will read resource from aws and convert it to lower case 'en_us.utf8' (see below 'flattenParameters' function) which will not fail compared to state file value (match). but because there is a diff with tf file (remember we set 'en_US.utf8') value it will try to modify the resource.
here another bug comes in play where terraform complains that db parameter group has a diff and reports: '* aws_db_parameter_group.default: diffs didn't match during apply.'
Important Factoids
---- terraform/builtin/providers/aws/resource_aws_db_parameter_group.go ----
func resourceAwsDbParameterGroupRead
...
d.Set("parameter", flattenParameters(describeParametersResp.Parameters))
...
---- terraform/builtin/providers/aws/resource_aws_db_parameter_group.go ----
func flattenParameters
...
r["name"] = strings.ToLower(_i.ParameterName)
...
r["value"] = strings.ToLower(_i.ParameterValue)
....
---- terraform/builtin/providers/aws/structure.go ----
---- terraform/builtin/providers/aws/structure.go ----
References
The text was updated successfully, but these errors were encountered: