Skip to content

Commit

Permalink
s3_bucket_notification: Fix not create bucket field when import (#978)
Browse files Browse the repository at this point in the history
* s3_bucket_notification: Fix not create `bucket` field when import

* s3_bucket_notification: Fix import acceptance test
  • Loading branch information
kjmkznr authored and radeksimko committed Jul 3, 2017
1 parent 41b6656 commit a39f0bb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
21 changes: 9 additions & 12 deletions aws/import_aws_s3_bucket_notification_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@ func TestAccAWSS3BucketNotification_importBasic(t *testing.T) {
},

resource.TestStep{
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"bucket"},
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
},
},
})
Expand All @@ -38,10 +37,9 @@ func TestAccAWSS3BucketNotification_importBasic(t *testing.T) {
},

resource.TestStep{
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"bucket"},
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
},
},
})
Expand All @@ -56,10 +54,9 @@ func TestAccAWSS3BucketNotification_importBasic(t *testing.T) {
},

resource.TestStep{
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"bucket"},
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
},
},
})
Expand Down
3 changes: 3 additions & 0 deletions aws/resource_aws_s3_bucket_notification.go
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,9 @@ func resourceAwsS3BucketNotificationRead(d *schema.ResourceData, meta interface{
return err
}
log.Printf("[DEBUG] S3 Bucket: %s, get notification: %v", d.Id(), notificationConfigs)

d.Set("bucket", d.Id())

// Topic Notification
if err := d.Set("topic", flattenTopicConfigurations(notificationConfigs.TopicConfigurations)); err != nil {
return fmt.Errorf("error reading S3 bucket \"%s\" topic notification: %s", d.Id(), err)
Expand Down

0 comments on commit a39f0bb

Please sign in to comment.