providers/aws: fix tests for subnet map_public_ip, add docs
This working depends on merging mitchellh/goamz#109 Related: #285 cc/ @hden
This commit is contained in:
parent
ee24fce321
commit
9fc775e41c
|
@ -55,12 +55,10 @@ func resource_aws_subnet_create(
|
||||||
s.ID, err)
|
s.ID, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
var attr string
|
|
||||||
|
|
||||||
// Map public ip on launch must be set in another API call
|
// Map public ip on launch must be set in another API call
|
||||||
if attr = s.Attributes["map_public_ip_on_launch"]; attr == "true" {
|
if attr := s.Attributes["map_public_ip_on_launch"]; attr == "true" {
|
||||||
modifyOpts := &ec2.ModifySubnetAttribute{
|
modifyOpts := &ec2.ModifySubnetAttribute{
|
||||||
SubnetId: s.ID,
|
SubnetId: s.ID,
|
||||||
MapPublicIpOnLaunch: true,
|
MapPublicIpOnLaunch: true,
|
||||||
}
|
}
|
||||||
log.Printf("[DEBUG] Subnet modify attributes: %#v", modifyOpts)
|
log.Printf("[DEBUG] Subnet modify attributes: %#v", modifyOpts)
|
||||||
|
|
|
@ -20,7 +20,7 @@ func TestAccAWSSubnet(t *testing.T) {
|
||||||
if v.MapPublicIpOnLaunch != true {
|
if v.MapPublicIpOnLaunch != true {
|
||||||
return fmt.Errorf("bad MapPublicIpOnLaunch: %s", v.MapPublicIpOnLaunch)
|
return fmt.Errorf("bad MapPublicIpOnLaunch: %s", v.MapPublicIpOnLaunch)
|
||||||
}
|
}
|
||||||
return fmt.Errorf("bad MapPublicIpOnLaunch: %s", v.MapPublicIpOnLaunch)
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,9 @@ The following arguments are supported:
|
||||||
|
|
||||||
* `availability_zone`- (Optional) The AZ for the subnet.
|
* `availability_zone`- (Optional) The AZ for the subnet.
|
||||||
* `cidr_block` - (Required) The CIDR block for the subnet.
|
* `cidr_block` - (Required) The CIDR block for the subnet.
|
||||||
|
* `map_public_ip_on_launch` - (Optional) Specify true to indicate
|
||||||
|
that instances launched into the subnet should be assigned
|
||||||
|
a public IP address.
|
||||||
* `vpc_id` - (Required) The VPC ID.
|
* `vpc_id` - (Required) The VPC ID.
|
||||||
|
|
||||||
## Attributes Reference
|
## Attributes Reference
|
||||||
|
|
Loading…
Reference in New Issue