From d7a7db9c5afe5bb658f300ac325d8389cf6e40c8 Mon Sep 17 00:00:00 2001 From: Colin Hebert Date: Wed, 30 Mar 2016 09:33:44 +1100 Subject: [PATCH 1/3] provider/aws: Subnet group description modification Do not force a new resource when changing the description of a subnet group --- builtin/providers/aws/resource_aws_db_subnet_group.go | 1 - 1 file changed, 1 deletion(-) diff --git a/builtin/providers/aws/resource_aws_db_subnet_group.go b/builtin/providers/aws/resource_aws_db_subnet_group.go index 004fae10b114..d08f2009fd42 100644 --- a/builtin/providers/aws/resource_aws_db_subnet_group.go +++ b/builtin/providers/aws/resource_aws_db_subnet_group.go @@ -38,7 +38,6 @@ func resourceAwsDbSubnetGroup() *schema.Resource { "description": &schema.Schema{ Type: schema.TypeString, Required: true, - ForceNew: true, }, "subnet_ids": &schema.Schema{ From 3ae21f089184590c6628fc0aa568d1e611cdb869 Mon Sep 17 00:00:00 2001 From: Colin Hebert Date: Thu, 31 Mar 2016 09:36:42 +1100 Subject: [PATCH 2/3] Add the description as a part of the update request --- builtin/providers/aws/resource_aws_db_subnet_group.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/builtin/providers/aws/resource_aws_db_subnet_group.go b/builtin/providers/aws/resource_aws_db_subnet_group.go index d08f2009fd42..1af99d85b4f5 100644 --- a/builtin/providers/aws/resource_aws_db_subnet_group.go +++ b/builtin/providers/aws/resource_aws_db_subnet_group.go @@ -165,8 +165,9 @@ func resourceAwsDbSubnetGroupUpdate(d *schema.ResourceData, meta interface{}) er } _, err := conn.ModifyDBSubnetGroup(&rds.ModifyDBSubnetGroupInput{ - DBSubnetGroupName: aws.String(d.Id()), - SubnetIds: sIds, + DBSubnetGroupName: aws.String(d.Id()), + DBSubnetGroupDescription: aws.String(d.Get("description").(string)), + SubnetIds: sIds, }) if err != nil { From 1389bb2f5ee03c18937721a541ebc9da3543f065 Mon Sep 17 00:00:00 2001 From: Colin Hebert Date: Thu, 31 Mar 2016 10:37:26 +1100 Subject: [PATCH 3/3] Do not check only whether the subnet_ids have changed --- builtin/providers/aws/resource_aws_db_subnet_group.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/providers/aws/resource_aws_db_subnet_group.go b/builtin/providers/aws/resource_aws_db_subnet_group.go index 1af99d85b4f5..233533396e26 100644 --- a/builtin/providers/aws/resource_aws_db_subnet_group.go +++ b/builtin/providers/aws/resource_aws_db_subnet_group.go @@ -152,7 +152,7 @@ func resourceAwsDbSubnetGroupRead(d *schema.ResourceData, meta interface{}) erro func resourceAwsDbSubnetGroupUpdate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).rdsconn - if d.HasChange("subnet_ids") { + if d.HasChange("subnet_ids") || d.HasChange("description") { _, n := d.GetChange("subnet_ids") if n == nil { n = new(schema.Set)