providers/aws: internet gateway belongs to VPC
This commit is contained in:
parent
c0dbb8febd
commit
f7b7c30055
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue