Skip to content

Commit

Permalink
providers/aws: fix tests for subnet map_public_ip, add docs
Browse files Browse the repository at this point in the history
This working depends on merging mitchellh/goamz#109

Related: #285

cc/ @hden
  • Loading branch information
pearkes committed Sep 16, 2014
1 parent ee24fce commit 9fc775e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
6 changes: 2 additions & 4 deletions builtin/providers/aws/resource_aws_subnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion builtin/providers/aws/resource_aws_subnet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
3 changes: 3 additions & 0 deletions website/source/docs/providers/aws/r/subnet.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9fc775e

Please sign in to comment.