provider/aws: Improve Checkdestroy to not fail if the ami is not found (it's deleted afterall) and improve tagging

This commit is contained in:
clint shryock 2017-05-15 10:24:43 -05:00
parent 5f724fc8a1
commit 6d0786cccb
1 changed files with 6 additions and 2 deletions

View File

@ -82,6 +82,10 @@ func testAccCheckAmiDestroy(s *terraform.State) error {
} }
resp, err := conn.DescribeImages(DescribeAmiOpts) resp, err := conn.DescribeImages(DescribeAmiOpts)
if err != nil { if err != nil {
if isAWSErr(err, "InvalidAMIID", "NotFound") {
log.Printf("[DEBUG] AMI not found, passing")
return nil
}
return err return err
} }
@ -183,7 +187,7 @@ resource "aws_ebs_volume" "foo" {
availability_zone = "us-west-2a" availability_zone = "us-west-2a"
size = 8 size = 8
tags { tags {
Name = "tf-acc-test" Name = "testAccAmiConfig_basic"
} }
} }
@ -209,7 +213,7 @@ resource "aws_ebs_volume" "foo" {
availability_zone = "us-west-2a" availability_zone = "us-west-2a"
size = 20 size = 20
tags { tags {
Name = "tf-acc-test" Name = "testAccAmiConfig_snapshotSize"
} }
} }