From d793c6dbff0bfe190a2ace8bb58e6feb60f831bd Mon Sep 17 00:00:00 2001 From: Clint Shryock Date: Fri, 21 Aug 2015 16:56:04 -0500 Subject: [PATCH] provider/aws: Updates for RDS --- builtin/providers/aws/resource_aws_db_instance.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/builtin/providers/aws/resource_aws_db_instance.go b/builtin/providers/aws/resource_aws_db_instance.go index 3ef3146ce..0b85aea3c 100644 --- a/builtin/providers/aws/resource_aws_db_instance.go +++ b/builtin/providers/aws/resource_aws_db_instance.go @@ -255,6 +255,12 @@ func resourceAwsDbInstance() *schema.Resource { Optional: true, }, + "allow_major_version_upgrade": &schema.Schema{ + Type: schema.TypeBool, + Computed: false, + Optional: true, + }, + "tags": tagsSchema(), }, } @@ -616,6 +622,11 @@ func resourceAwsDbInstanceUpdate(d *schema.ResourceData, meta interface{}) error req.AllocatedStorage = aws.Int64(int64(d.Get("allocated_storage").(int))) requestUpdate = true } + 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 + } if d.HasChange("backup_retention_period") { d.SetPartial("backup_retention_period") req.BackupRetentionPeriod = aws.Int64(int64(d.Get("backup_retention_period").(int))) @@ -728,6 +739,7 @@ func resourceAwsDbInstanceUpdate(d *schema.ResourceData, meta interface{}) error } } d.Partial(false) + return resourceAwsDbInstanceRead(d, meta) } @@ -742,7 +754,6 @@ func resourceAwsDbInstanceRetrieve( log.Printf("[DEBUG] DB Instance describe configuration: %#v", opts) resp, err := conn.DescribeDBInstances(&opts) - if err != nil { dbinstanceerr, ok := err.(awserr.Error) if ok && dbinstanceerr.Code() == "DBInstanceNotFound" {