From 6d0786cccb2322450e32b56ceecacf59c876ba5c Mon Sep 17 00:00:00 2001 From: clint shryock Date: Mon, 15 May 2017 10:24:43 -0500 Subject: [PATCH] provider/aws: Improve Checkdestroy to not fail if the ami is not found (it's deleted afterall) and improve tagging --- builtin/providers/aws/resource_aws_ami_test.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/builtin/providers/aws/resource_aws_ami_test.go b/builtin/providers/aws/resource_aws_ami_test.go index cf34187f17..2f2e481a40 100644 --- a/builtin/providers/aws/resource_aws_ami_test.go +++ b/builtin/providers/aws/resource_aws_ami_test.go @@ -82,6 +82,10 @@ func testAccCheckAmiDestroy(s *terraform.State) error { } resp, err := conn.DescribeImages(DescribeAmiOpts) if err != nil { + if isAWSErr(err, "InvalidAMIID", "NotFound") { + log.Printf("[DEBUG] AMI not found, passing") + return nil + } return err } @@ -183,7 +187,7 @@ resource "aws_ebs_volume" "foo" { availability_zone = "us-west-2a" size = 8 tags { - Name = "tf-acc-test" + Name = "testAccAmiConfig_basic" } } @@ -209,7 +213,7 @@ resource "aws_ebs_volume" "foo" { availability_zone = "us-west-2a" size = 20 tags { - Name = "tf-acc-test" + Name = "testAccAmiConfig_snapshotSize" } }