provider/aws: Allow `aws_rds_instance` to upgrade the major version (#8471)
Fixes #8468 If a user wished to bump the `engine_version` of an RDS instance, Terraform was not sending `allow_major_version_upgrade` to the API *unless* that value also changed at the same time. This caused the following error from RDS API: ``` * aws_db_instance.bar: Error modifying DB Instance * tf-20160825101420910562798obb: InvalidParameterCombination: The * AllowMajorVersionUpgrade flag must be present when upgrading to a new * major version. status code: 400, request id: 20e36364-6ab0-11e6-b794-51f12f4135f1 ``` This change will always send the `allow_major_version_upgrade` flag to the API when the `engine_version` changes. This still relies on the user setting the correct value i.e. if they are upgrading from postgres 0.4.7 -> 9.5.2 then the config will need to set the `allow_major_version_upgrade` flag to be `true`
This commit is contained in:
parent
5f567e7cd9
commit
0adc1fc4b2
|
@ -837,6 +837,7 @@ func resourceAwsDbInstanceUpdate(d *schema.ResourceData, meta interface{}) error
|
||||||
if d.HasChange("engine_version") {
|
if d.HasChange("engine_version") {
|
||||||
d.SetPartial("engine_version")
|
d.SetPartial("engine_version")
|
||||||
req.EngineVersion = aws.String(d.Get("engine_version").(string))
|
req.EngineVersion = aws.String(d.Get("engine_version").(string))
|
||||||
|
req.AllowMajorVersionUpgrade = aws.Bool(d.Get("allow_major_version_upgrade").(bool))
|
||||||
requestUpdate = true
|
requestUpdate = true
|
||||||
}
|
}
|
||||||
if d.HasChange("backup_window") {
|
if d.HasChange("backup_window") {
|
||||||
|
|
|
@ -19,6 +19,8 @@ phase because a modification has not yet taken place. You can use the
|
||||||
`apply_immediately` flag to instruct the service to apply the change immediately
|
`apply_immediately` flag to instruct the service to apply the change immediately
|
||||||
(see documentation below).
|
(see documentation below).
|
||||||
|
|
||||||
|
When upgrading the major version of an engine, `allow_major_version_upgrade` must be set to `true`
|
||||||
|
|
||||||
~> **Note:** using `apply_immediately` can result in a
|
~> **Note:** using `apply_immediately` can result in a
|
||||||
brief downtime as the server reboots. See the AWS Docs on [RDS Maintenance][2]
|
brief downtime as the server reboots. See the AWS Docs on [RDS Maintenance][2]
|
||||||
for more information.
|
for more information.
|
||||||
|
|
Loading…
Reference in New Issue