From 54edf1cd2c7777b22e68ff30ac1d6be8b580f67f Mon Sep 17 00:00:00 2001 From: Clint Shryock Date: Wed, 18 Mar 2015 10:50:36 -0500 Subject: [PATCH] provider/aws: Fix issue when changing map-public-ip in Subnets --- builtin/providers/aws/resource_aws_subnet.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/builtin/providers/aws/resource_aws_subnet.go b/builtin/providers/aws/resource_aws_subnet.go index d1db5aed9..fbb82d89d 100644 --- a/builtin/providers/aws/resource_aws_subnet.go +++ b/builtin/providers/aws/resource_aws_subnet.go @@ -133,8 +133,10 @@ func resourceAwsSubnetUpdate(d *schema.ResourceData, meta interface{}) error { if d.HasChange("map_public_ip_on_launch") { modifyOpts := &ec2.ModifySubnetAttributeRequest{ - SubnetID: aws.String(d.Id()), - MapPublicIPOnLaunch: &ec2.AttributeBooleanValue{aws.Boolean(true)}, + SubnetID: aws.String(d.Id()), + MapPublicIPOnLaunch: &ec2.AttributeBooleanValue{ + aws.Boolean(d.Get("map_public_ip_on_launch").(bool)), + }, } log.Printf("[DEBUG] Subnet modify attributes: %#v", modifyOpts)