Merge branch 'vpc_missing' of https://github.com/bitglue/terraform into bitglue-vpc_missing

Conflicts:
	builtin/providers/aws/resource_aws_vpc.go
This commit is contained in:
Mitchell Hashimoto 2015-03-26 10:17:14 -07:00
commit 944ff16d4e
3 changed files with 6 additions and 5 deletions

View File

@ -107,6 +107,7 @@ func resourceAwsRouteTableRead(d *schema.ResourceData, meta interface{}) error {
return err return err
} }
if rtRaw == nil { if rtRaw == nil {
d.SetId("")
return nil return nil
} }

View File

@ -195,13 +195,13 @@ func resourceAwsVpcUpdate(d *schema.ResourceData, meta interface{}) error {
} }
log.Printf( log.Printf(
"[INFO] Modifying enable_dns_hostnames vpc attribute for %s: %#v", "[INFO] Modifying enable_dns_support vpc attribute for %s: %#v",
d.Id(), modifyOpts) d.Id(), modifyOpts)
if err := ec2conn.ModifyVPCAttribute(modifyOpts); err != nil { if err := ec2conn.ModifyVPCAttribute(modifyOpts); err != nil {
return err return err
} }
d.SetPartial("enable_dns_hostnames") d.SetPartial("enable_dns_support")
} }
if d.HasChange("enable_dns_support") { if d.HasChange("enable_dns_support") {
@ -241,7 +241,7 @@ func resourceAwsVpcDelete(d *schema.ResourceData, meta interface{}) error {
} }
log.Printf("[INFO] Deleting VPC: %s", d.Id()) log.Printf("[INFO] Deleting VPC: %s", d.Id())
if err := ec2conn.DeleteVPC(DeleteVpcOpts); err != nil { if err := ec2conn.DeleteVPC(DeleteVpcOpts); err != nil {
ec2err, ok := err.(*aws.APIError) ec2err, ok := err.(aws.APIError)
if ok && ec2err.Code == "InvalidVpcID.NotFound" { if ok && ec2err.Code == "InvalidVpcID.NotFound" {
return nil return nil
} }
@ -261,7 +261,7 @@ func VPCStateRefreshFunc(conn *ec2.EC2, id string) resource.StateRefreshFunc {
} }
resp, err := conn.DescribeVPCs(DescribeVpcOpts) resp, err := conn.DescribeVPCs(DescribeVpcOpts)
if err != nil { if err != nil {
if ec2err, ok := err.(*aws.APIError); ok && ec2err.Code == "InvalidVpcID.NotFound" { if ec2err, ok := err.(aws.APIError); ok && ec2err.Code == "InvalidVpcID.NotFound" {
resp = nil resp = nil
} else { } else {
log.Printf("Error on VPCStateRefresh: %s", err) log.Printf("Error on VPCStateRefresh: %s", err)

View File

@ -133,7 +133,7 @@ func testAccCheckVpcDestroy(s *terraform.State) error {
} }
// Verify the error is what we want // Verify the error is what we want
ec2err, ok := err.(*aws.APIError) ec2err, ok := err.(aws.APIError)
if !ok { if !ok {
return err return err
} }