Skip to content

Commit

Permalink
Merge pull request #9193 from terraform-providers/b-aws_db_instance-a…
Browse files Browse the repository at this point in the history
…llow_major_version_update-modify

resource/aws_db_instance: Prevent InvalidParameterCombination: No modifications were requested error when updating only allow_major_version_upgrade argument
  • Loading branch information
bflad authored Jul 2, 2019
2 parents 9e6a225 + e0efdf7 commit 69fd743
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
// as it results in 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 69fd743

Please sign in to comment.