|
|
|
|
@ -179,18 +179,27 @@ func resourceAwsVpcRead(d *schema.ResourceData, meta interface{}) error {
|
|
|
|
|
DescribeClassiclinkOpts := &ec2.DescribeVpcClassicLinkInput{
|
|
|
|
|
VpcIds: []*string{&vpcid},
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Classic Link is only available in regions that support EC2 Classic
|
|
|
|
|
respClassiclink, err := conn.DescribeVpcClassicLink(DescribeClassiclinkOpts)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
classiclink_enabled := false
|
|
|
|
|
for _, v := range respClassiclink.Vpcs {
|
|
|
|
|
if *v.VpcId == vpcid {
|
|
|
|
|
classiclink_enabled = *v.ClassicLinkEnabled
|
|
|
|
|
break
|
|
|
|
|
if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == "UnsupportedOperation" {
|
|
|
|
|
log.Printf("[WARN] VPC Classic Link is not supported in this region")
|
|
|
|
|
} else {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
classiclink_enabled := false
|
|
|
|
|
for _, v := range respClassiclink.Vpcs {
|
|
|
|
|
if *v.VpcId == vpcid {
|
|
|
|
|
if v.ClassicLinkEnabled != nil {
|
|
|
|
|
classiclink_enabled = *v.ClassicLinkEnabled
|
|
|
|
|
}
|
|
|
|
|
break
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
d.Set("enable_classiclink", classiclink_enabled)
|
|
|
|
|
}
|
|
|
|
|
d.Set("enable_classiclink", classiclink_enabled)
|
|
|
|
|
|
|
|
|
|
// Get the main routing table for this VPC
|
|
|
|
|
// Really Ugly need to make this better - rmenn
|
|
|
|
|
|