Skip to content

Commit

Permalink
resource/aws_db_instance: Prevent InvalidParameterCombination: No mod…
Browse files Browse the repository at this point in the history
…ifications were requested error when updating only allow_major_version_upgrade argument

Reference: #500

Previous output from updated acceptance testing:

```
--- FAIL: TestAccAWSDBInstance_AllowMajorVersionUpgrade (491.43s)
    testing.go:568: Step 2 error: errors during apply:

        Error: Error modifying DB Instance tf-acc-test-4576888905000364877: InvalidParameterCombination: No modifications were requested
```

Output from acceptance testing:

```
--- PASS: TestAccAWSDBInstance_AllowMajorVersionUpgrade (433.02s)
```
  • Loading branch information
bflad committed Jul 1, 2019
1 parent 69965ad commit 8679e53
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion aws/resource_aws_db_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -1470,7 +1470,8 @@ func resourceAwsDbInstanceUpdate(d *schema.ResourceData, meta interface{}) error
if d.HasChange("allow_major_version_upgrade") {
d.SetPartial("allow_major_version_upgrade")
req.AllowMajorVersionUpgrade = aws.Bool(d.Get("allow_major_version_upgrade").(bool))
requestUpdate = true
// Having allowing_major_version_upgrade by itself should not trigger ModifyDBInstance
// InvalidParameterCombination: No modifications were requested
}
if d.HasChange("backup_retention_period") {
d.SetPartial("backup_retention_period")
Expand Down
7 changes: 7 additions & 0 deletions aws/resource_aws_db_instance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,13 @@ func TestAccAWSDBInstance_AllowMajorVersionUpgrade(t *testing.T) {
"skip_final_snapshot",
},
},
{
Config: testAccAWSDBInstanceConfigAllowMajorVersionUpgrade(rName, false),
Check: resource.ComposeTestCheckFunc(
testAccCheckAWSDBInstanceExists(resourceName, &dbInstance1),
resource.TestCheckResourceAttr(resourceName, "allow_major_version_upgrade", "false"),
),
},
},
})
}
Expand Down

0 comments on commit 8679e53

Please sign in to comment.