-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
provider/aws: StateFunc on db_subnet_group name to be lowercase #4340
provider/aws: StateFunc on db_subnet_group name to be lowercase #4340
Conversation
@@ -149,7 +149,7 @@ resource "aws_subnet" "bar" { | |||
} | |||
|
|||
resource "aws_db_subnet_group" "foo" { | |||
name = "FOO" | |||
name = "foo" |
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.
nitpick... shouldn't this be OK to leave as FOO
? The StateFunc
should downcast it, so really leaving it as caps or mixed case would test that we're actually doing this.
@catsby I was just talking to @jen20 about this. When I did that, I got this:
|
So... that's indication that the code isn't doing it's job, correct? The |
@catsby the actual code seems to work. Currently, when I tail the logs, I see this:
So I see it working there. I am wondering if this is to do with the testing framework |
My state file after running a config file shows |
47c4e1f
to
2406c4b
Compare
Actually after discussing with @catsby, it might be better to just adjust the validation here to ensure the name is lower case as prescribed by the AWS documentation. Anyone who has already applied a plan with the upper case name will see a plan loop until they change their configuration, but future users will be prevented from falling into this. |
We found this to be an issue where we were later re-setting the name in the d.Set("name", d.Id())
d.Set("description", *subnetGroup.DBSubnetGroupDescription) @stack72 is fixing things up 😄 |
2406c4b
to
8c47b3c
Compare
this happens, throw a validation error Add some ValidationTests for the DBSubnetGroupName ValidateFunc
8c47b3c
to
57bcb49
Compare
LGTM. Thanks @stack72! |
…case provider/aws: StateFunc on db_subnet_group name to be lowercase
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. |
Fixes: #4255
We actually excluded uppercase chars on the DBSubnetName. This was causing a plan loop and would have been hidden by using a StateFunc to LowerCase
We actually throw a validate error now on any uppercase letters