provider/aws: Return if Bucket not found

This commit is contained in:
Clint Shryock 2015-08-03 16:17:01 -05:00
parent 2cea7c7d0c
commit c10c47623e
1 changed files with 2 additions and 0 deletions

View File

@ -163,7 +163,9 @@ func resourceAwsS3BucketRead(d *schema.ResourceData, meta interface{}) error {
})
if err != nil {
if awsError, ok := err.(awserr.RequestFailure); ok && awsError.StatusCode() == 404 {
log.Printf("[WARN] S3 Bucket (%s) not found, error code (404)", d.Id())
d.SetId("")
return nil
} else {
// some of the AWS SDK's errors can be empty strings, so let's add
// some additional context.