Setting the VPC id to blank for unattached igws
This commit is contained in:
parent
3883e47902
commit
9b9d147585
|
@ -61,7 +61,8 @@ func resourceAwsInternetGatewayRead(d *schema.ResourceData, meta interface{}) er
|
|||
|
||||
ig := igRaw.(*ec2.InternetGateway)
|
||||
if len(ig.Attachments) == 0 {
|
||||
d.SetId("")
|
||||
// Gateway exists but not attached to the VPC
|
||||
d.Set("vpc_id", "")
|
||||
} else {
|
||||
d.Set("vpc_id", ig.Attachments[0].VpcId)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue