From b172d94381ac5fd4c3948fc523a343f2a74cd856 Mon Sep 17 00:00:00 2001 From: clint shryock Date: Wed, 16 Dec 2015 11:07:15 -0600 Subject: [PATCH] provider/aws: Fix check destroy method for s3 tests --- builtin/providers/aws/resource_aws_s3_bucket_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/builtin/providers/aws/resource_aws_s3_bucket_test.go b/builtin/providers/aws/resource_aws_s3_bucket_test.go index 0026775c8..f37ae882a 100644 --- a/builtin/providers/aws/resource_aws_s3_bucket_test.go +++ b/builtin/providers/aws/resource_aws_s3_bucket_test.go @@ -14,6 +14,7 @@ import ( "github.com/hashicorp/terraform/terraform" "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/service/s3" ) @@ -265,6 +266,9 @@ func testAccCheckAWSS3BucketDestroy(s *terraform.State) error { Bucket: aws.String(rs.Primary.ID), }) if err != nil { + if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == "NoSuchBucket" { + return nil + } return err } }