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:
Jack Pearkes 2014-09-16 10:37:22 -04:00
parent ee24fce321
commit 9fc775e41c
3 changed files with 6 additions and 5 deletions

View File

@ -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)

View File

@ -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
}

View File

@ -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