-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Db param group case sensitivity #12973
Db param group case sensitivity #12973
Conversation
AWS provided variables for rds parameter groups are case sensitive. These test updates demonstrate the failure returned from AWS. Proving that "join_buffer_size" = "{dbInstanceClassMemory/10000}" is invalid TestAccAWSDBParameterGroup_basic: testing.go:669: Step 0 error: errors during apply: Error: Error modifying DB Parameter Group: InvalidParameterValue: value does not match pattern status code: 400, request id: <redacted> on /var/folders/7b/22x5nfns40gb2qkfgjh7s2k40000gp/T/tf-test908586078/main.tf line 2: (source code not available)
We use a variable that was proven bad in the previous commit. This should really fail.
Bad values detected as they should have been TestAccAWSDBParameterGroup_basic: testing.go:669: Step 2 error: errors during apply: Error: Error modifying DB Parameter Group: InvalidParameterValue: value does not match pattern status code: 400, request id: <redacted>
Can anyone review this? Am I missing anything to get a review? |
@apparentlymart @bflad This was from a bit ago. Can I get some input here? |
Hi @kevincormier-toast 👋 Thank you for submitting this. I'm not directly familiar with the decision to lowercase these values to begin with, so for a future reviewer (not sure if it will be me or another maintainer) it may be super helpful to lookup and provide references to why the original code was written the way it was. Generally speaking, these lowercase value workarounds are for when the API is doing this type of canonicalization automatically from operator provided values on create/update. Removing that lowercasing may cause unexpected differences to show up when operators update their provider version if there are test cases we are missing. From a more tactical perspective though some general comments:
Thanks again. |
@bflad looking over the history, I came to the same conclusion you did that this was in response to the API being case insensitive and always returning lowered results. If that was one the case, it is no longer true. I found some older issues from before this provider was split out of core terraform that hint at that being true, though nothing definitive. Either way, the api is now case preserving and for SOME values case sensitive. As far as existing issues, I don't know if the case sensitive variables used in the parameters are widely used yet. I haven't seen other complaints about the issue yet. I don't believe making this case sensitive would actually affect operators in a negative way. These are the scenarios I've been able to think through. In each case, I think the change introduced is less impactful than the side effects of leaving the existing behavior.
I'm happy to create a new test case rather than update existing ones. Can you give me any pointers on how the numeric portion of the key is generated? For example, in |
@kevincormier-toast we just merged #13556 yesterday, which provides functionality for testing |
If I'd only looked at the branch conflicts... Looking at the test cases that were updated, those tests won't pass with the existing change. They are all simulating the second scenario in my table above. Code issues aside, do you think we are likely to get this change merged? Since this will change existing behavior, I don't want to go down that path if you disagree with my assessment of the situation in my last comment! I know as a rule we try not to change existing behavior. |
@bflad I realized I forgot to @ you in my previous comment |
My organization has observed live problems with case insensitivity re: RDS parameter groups, which I suspect (dearly hope!) this PR would resolve. I'll see if we can get the simplest possible isolated repro case documented and added here. |
We also need this functionality. Given that the DB Parameter Group Formula syntax is parsed by something other than terraform it seems reasonable to pass it straight through. |
OK, after some testing, I have to retract my prior comment! With Terraform 0.13.1 and AWS provider 3.4.0, I can't manifest the problems I was seeing before, so maybe #12112 resolved it? With this simplest-possible config:
I can apply it, and I don't get any diffs on plan, with or without What I did find, related to lowercase variables, is that if you put a variable calculation where you don't match AWS expected case for a variable, AWS will reject the parameter group change with There's definitely an annoyance here where using all lowercase for AWS RDS parameter groups variable calculations used to work fine, and at some point AWS started enforcing case matching, but I'm not sure if Terraform can do anything here other than attempting to pre-discover the proper case for all valid variables for RDS parameter group calculations, which seems like an operational nightmare. 😐 |
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! |
aws_db_parameter_group.parameter.value has a number of weird edge cases around capitalization/casing. The long standing fix using lower() is causing problems with Parameter Formula Variables, which are case sensitive and use capital letters.
This PR is a quick attempt to make the values case sensitive.
Community Note
Relates OR Closes #0000
Release note for CHANGELOG:
Output from acceptance testing: