providers/aws: internet gateway belongs to VPC

This commit is contained in:
Mitchell Hashimoto 2014-07-07 21:03:53 -07:00
parent c0dbb8febd
commit f7b7c30055
1 changed files with 8 additions and 1 deletions

View File

@ -66,7 +66,7 @@ func resource_aws_internet_gateway_update(
rs.Attributes["vpc_id"] = attr.New rs.Attributes["vpc_id"] = attr.New
} }
return rs, nil return resource_aws_internet_gateway_update_state(rs, nil)
} }
func resource_aws_internet_gateway_destroy( func resource_aws_internet_gateway_destroy(
@ -206,6 +206,13 @@ func resource_aws_internet_gateway_detach(
func resource_aws_internet_gateway_update_state( func resource_aws_internet_gateway_update_state(
s *terraform.ResourceState, s *terraform.ResourceState,
ig *ec2.InternetGateway) (*terraform.ResourceState, error) { ig *ec2.InternetGateway) (*terraform.ResourceState, error) {
if s.Attributes["vpc_id"] != "" {
// We belong to a VPC
s.Dependencies = []terraform.ResourceDependency{
terraform.ResourceDependency{ID: s.Attributes["vpc_id"]},
}
}
return s, nil return s, nil
} }