mirror of
https://github.com/opentofu/opentofu.git
synced 2024-12-28 18:01:01 -06:00
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
|
||||
}
|
||||
|
||||
return rs, nil
|
||||
return resource_aws_internet_gateway_update_state(rs, nil)
|
||||
}
|
||||
|
||||
func resource_aws_internet_gateway_destroy(
|
||||
@ -206,6 +206,13 @@ func resource_aws_internet_gateway_detach(
|
||||
func resource_aws_internet_gateway_update_state(
|
||||
s *terraform.ResourceState,
|
||||
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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user