Skip to content
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

Reset parameter group values when they are removed from config #10161

Closed
wants to merge 1 commit into from

Conversation

ryndaniels
Copy link
Contributor

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" comments, they generate extra noise for pull request followers and do not help prioritize the request

Closes #661

Release note for CHANGELOG:

BUG FIXES:
* resource/aws_db_parameter_group: Resets parameters to default values when they are removed from Terraform config

Output from acceptance testing:

  • New test - before the fix:
$ make testacc TESTARGS="-run=TestAccAWSDBParameterGroup_resetParameters"
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./... -v -parallel 20 -run=TestAccAWSDBParameterGroup_resetParameters -timeout 120m
?       github.com/terraform-providers/terraform-provider-aws   [no test files]
=== RUN   TestAccAWSDBParameterGroup_resetParameters
=== PAUSE TestAccAWSDBParameterGroup_resetParameters
=== CONT  TestAccAWSDBParameterGroup_resetParameters
--- FAIL: TestAccAWSDBParameterGroup_resetParameters (66.42s)
    testing.go:569: Step 1 error: After applying this step and refreshing, the plan was not empty:
        
        DIFF:
        
        UPDATE: aws_db_parameter_group.bar
          arn:                      "arn:aws:rds:us-west-2:187416307283:pg:parameter-group-test-terraform-5010972312428257489" => "arn:aws:rds:us-west-2:187416307283:pg:parameter-group-test-terraform-5010972312428257489"
          description:              "Managed by Terraform" => "Managed by Terraform"
          family:                   "mysql5.6" => "mysql5.6"
          id:                       "parameter-group-test-terraform-5010972312428257489" => "parameter-group-test-terraform-5010972312428257489"
          name:                     "parameter-group-test-terraform-5010972312428257489" => "parameter-group-test-terraform-5010972312428257489"
          parameter.#:              "3" => "1"
          parameter.0.apply_method: "immediate" => "immediate"
          parameter.0.name:         "character_set_client" => "character_set_server"
          parameter.0.value:        "utf8" => "utf8"
          parameter.1.apply_method: "immediate" => ""
          parameter.1.name:         "character_set_results" => ""
          parameter.1.value:        "utf8" => ""
          parameter.2.apply_method: "immediate" => ""
          parameter.2.name:         "character_set_server" => ""
          parameter.2.value:        "utf8" => ""
        
        
        
        STATE:
        
        aws_db_parameter_group.bar:
          ID = parameter-group-test-terraform-5010972312428257489
          provider = provider.aws
          arn = arn:aws:rds:us-west-2:187416307283:pg:parameter-group-test-terraform-5010972312428257489
          description = Managed by Terraform
          family = mysql5.6
          name = parameter-group-test-terraform-5010972312428257489
          parameter.# = 3
          parameter.0.apply_method = immediate
          parameter.0.name = character_set_client
          parameter.0.value = utf8
          parameter.1.apply_method = immediate
          parameter.1.name = character_set_results
          parameter.1.value = utf8
          parameter.2.apply_method = immediate
          parameter.2.name = character_set_server
          parameter.2.value = utf8
FAIL
FAIL    github.com/terraform-providers/terraform-provider-aws/aws       67.852s
make: *** [testacc] Error 1
  • New test - after the fix:
$ make testacc TESTARGS="-run=TestAccAWSDBParameterGroup_resetParameters"
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./... -v -parallel 20 -run=TestAccAWSDBParameterGroup_resetParameters -timeout 120m
?       github.com/terraform-providers/terraform-provider-aws   [no test files]
=== RUN   TestAccAWSDBParameterGroup_resetParameters
=== PAUSE TestAccAWSDBParameterGroup_resetParameters
=== CONT  TestAccAWSDBParameterGroup_resetParameters
--- PASS: TestAccAWSDBParameterGroup_resetParameters (66.51s)
PASS
ok      github.com/terraform-providers/terraform-provider-aws/aws       67.490s
  • All tests - after the fix:
$ make testacc TESTARGS="-run=TestAccAWSDBParameterGroup_"         ==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./... -v -parallel 20 -run=TestAccAWSDBParameterGroup_ -timeout 120m
?       github.com/terraform-providers/terraform-provider-aws   [no test files]
=== RUN   TestAccAWSDBParameterGroup_importBasic
=== PAUSE TestAccAWSDBParameterGroup_importBasic
=== RUN   TestAccAWSDBParameterGroup_limit
=== PAUSE TestAccAWSDBParameterGroup_limit
=== RUN   TestAccAWSDBParameterGroup_basic
=== PAUSE TestAccAWSDBParameterGroup_basic
=== RUN   TestAccAWSDBParameterGroup_resetParameters
=== PAUSE TestAccAWSDBParameterGroup_resetParameters
=== RUN   TestAccAWSDBParameterGroup_Disappears
=== PAUSE TestAccAWSDBParameterGroup_Disappears
=== RUN   TestAccAWSDBParameterGroup_namePrefix
=== PAUSE TestAccAWSDBParameterGroup_namePrefix
=== RUN   TestAccAWSDBParameterGroup_generatedName
=== PAUSE TestAccAWSDBParameterGroup_generatedName
=== RUN   TestAccAWSDBParameterGroup_withApplyMethod
=== PAUSE TestAccAWSDBParameterGroup_withApplyMethod
=== RUN   TestAccAWSDBParameterGroup_Only
=== PAUSE TestAccAWSDBParameterGroup_Only
=== RUN   TestAccAWSDBParameterGroup_MatchDefault
=== PAUSE TestAccAWSDBParameterGroup_MatchDefault
=== CONT  TestAccAWSDBParameterGroup_importBasic
=== CONT  TestAccAWSDBParameterGroup_MatchDefault
=== CONT  TestAccAWSDBParameterGroup_Disappears
=== CONT  TestAccAWSDBParameterGroup_resetParameters
=== CONT  TestAccAWSDBParameterGroup_namePrefix
=== CONT  TestAccAWSDBParameterGroup_basic
=== CONT  TestAccAWSDBParameterGroup_limit
=== CONT  TestAccAWSDBParameterGroup_Only
=== CONT  TestAccAWSDBParameterGroup_generatedName
=== CONT  TestAccAWSDBParameterGroup_withApplyMethod
--- PASS: TestAccAWSDBParameterGroup_Disappears (26.55s)
--- PASS: TestAccAWSDBParameterGroup_Only (29.57s)
--- PASS: TestAccAWSDBParameterGroup_MatchDefault (36.03s)
--- PASS: TestAccAWSDBParameterGroup_generatedName (37.48s)
--- PASS: TestAccAWSDBParameterGroup_withApplyMethod (39.59s)
--- PASS: TestAccAWSDBParameterGroup_namePrefix (39.80s)
--- PASS: TestAccAWSDBParameterGroup_importBasic (41.77s)
--- PASS: TestAccAWSDBParameterGroup_resetParameters (67.72s)
--- PASS: TestAccAWSDBParameterGroup_basic (70.27s)
--- PASS: TestAccAWSDBParameterGroup_limit (73.93s)
PASS
ok      github.com/terraform-providers/terraform-provider-aws/aws       75.404s

@ryndaniels ryndaniels requested review from nywilken and a team September 19, 2019 11:52
@ghost ghost added size/M Managed by automation to categorize the size of a PR. service/rds Issues and PRs that pertain to the rds service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Sep 19, 2019
@ryndaniels
Copy link
Contributor Author

Closing as a dupe of #5728! 👍

@ryndaniels ryndaniels closed this Oct 4, 2019
@ghost
Copy link

ghost commented Nov 3, 2019

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!

@ghost ghost locked and limited conversation to collaborators Nov 3, 2019
@bflad bflad deleted the rfd-reset-params branch April 23, 2020 03:38
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service/rds Issues and PRs that pertain to the rds service. size/M Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot "un-set" parameter group values
1 participant