Merge pull request #1234 from hashicorp/b-fix-aws-subnet-map-public-change
provider/aws: Fix issue when changing map-public-ip in Subnets
This commit is contained in:
commit
fa2d41ef55
|
@ -42,7 +42,7 @@ func resourceAwsSubnet() *schema.Resource {
|
||||||
"map_public_ip_on_launch": &schema.Schema{
|
"map_public_ip_on_launch": &schema.Schema{
|
||||||
Type: schema.TypeBool,
|
Type: schema.TypeBool,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true,
|
Default: false,
|
||||||
},
|
},
|
||||||
|
|
||||||
"tags": tagsSchema(),
|
"tags": tagsSchema(),
|
||||||
|
@ -134,7 +134,9 @@ func resourceAwsSubnetUpdate(d *schema.ResourceData, meta interface{}) error {
|
||||||
if d.HasChange("map_public_ip_on_launch") {
|
if d.HasChange("map_public_ip_on_launch") {
|
||||||
modifyOpts := &ec2.ModifySubnetAttributeRequest{
|
modifyOpts := &ec2.ModifySubnetAttributeRequest{
|
||||||
SubnetID: aws.String(d.Id()),
|
SubnetID: aws.String(d.Id()),
|
||||||
MapPublicIPOnLaunch: &ec2.AttributeBooleanValue{aws.Boolean(true)},
|
MapPublicIPOnLaunch: &ec2.AttributeBooleanValue{
|
||||||
|
aws.Boolean(d.Get("map_public_ip_on_launch").(bool)),
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("[DEBUG] Subnet modify attributes: %#v", modifyOpts)
|
log.Printf("[DEBUG] Subnet modify attributes: %#v", modifyOpts)
|
||||||
|
|
Loading…
Reference in New Issue