diff --git a/builtin/providers/aws/resource_aws_s3_bucket.go b/builtin/providers/aws/resource_aws_s3_bucket.go index 2ec1c32e6..d4e384b64 100644 --- a/builtin/providers/aws/resource_aws_s3_bucket.go +++ b/builtin/providers/aws/resource_aws_s3_bucket.go @@ -417,6 +417,11 @@ func resourceAwsS3BucketRead(d *schema.ResourceData, meta interface{}) error { } } + // In the import case, we won't have this + if _, ok := d.GetOk("bucket"); !ok { + d.Set("bucket", d.Id()) + } + // Read the policy pol, err := s3conn.GetBucketPolicy(&s3.GetBucketPolicyInput{ Bucket: aws.String(d.Id()), diff --git a/builtin/providers/aws/resource_aws_s3_bucket_test.go b/builtin/providers/aws/resource_aws_s3_bucket_test.go index a1cfd0315..c6a893e7e 100644 --- a/builtin/providers/aws/resource_aws_s3_bucket_test.go +++ b/builtin/providers/aws/resource_aws_s3_bucket_test.go @@ -23,10 +23,13 @@ func TestAccAWSS3Bucket_basic(t *testing.T) { "^arn:aws:s3:::") resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - IDRefreshName: "aws_s3_bucket.bucket", - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSS3BucketDestroy, + PreCheck: func() { testAccPreCheck(t) }, + /* + IDRefreshName: "aws_s3_bucket.bucket", + IDRefreshIgnore: []string{"force_destroy"}, + */ + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSS3BucketDestroy, Steps: []resource.TestStep{ resource.TestStep{ Config: testAccAWSS3BucketConfig(rInt),