provider/aws: Fix check destroy method for s3 tests

This commit is contained in:
clint shryock 2015-12-16 11:07:15 -06:00
parent 37340179e1
commit b172d94381
1 changed files with 4 additions and 0 deletions

View File

@ -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
}
}