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)
|
||||
}
|
||||
|
||||
var attr string
|
||||
|
||||
// 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{
|
||||
SubnetId: s.ID,
|
||||
SubnetId: s.ID,
|
||||
MapPublicIpOnLaunch: true,
|
||||
}
|
||||
log.Printf("[DEBUG] Subnet modify attributes: %#v", modifyOpts)
|
||||
|
|
|
@ -20,7 +20,7 @@ func TestAccAWSSubnet(t *testing.T) {
|
|||
if v.MapPublicIpOnLaunch != true {
|
||||
return fmt.Errorf("bad MapPublicIpOnLaunch: %s", v.MapPublicIpOnLaunch)
|
||||
}
|
||||
return fmt.Errorf("bad MapPublicIpOnLaunch: %s", v.MapPublicIpOnLaunch)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
@ -23,6 +23,9 @@ The following arguments are supported:
|
|||
|
||||
* `availability_zone`- (Optional) The AZ 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.
|
||||
|
||||
## Attributes Reference
|
||||
|
|
Loading…
Reference in New Issue