providers/aws: some id-only work on s3 buckets more work needed

This commit is contained in:
Mitchell Hashimoto 2016-04-21 08:44:45 -07:00
parent 7292c9df25
commit 8b4e98e732
No known key found for this signature in database
GPG Key ID: 744E147AA52F5B0A
2 changed files with 12 additions and 4 deletions

View File

@ -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()),

View File

@ -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),