Add proper reading/updating of tags for S3

This commit is contained in:
Clint Shryock 2015-03-26 11:45:16 -05:00
parent c6d832333b
commit be60d39b24
1 changed files with 12 additions and 0 deletions

View File

@ -91,6 +91,18 @@ func resourceAwsS3BucketRead(d *schema.ResourceData, meta interface{}) error {
if err != nil {
return err
}
resp, err := s3conn.GetBucketTagging(&s3.GetBucketTaggingRequest{
Bucket: aws.String(d.Id()),
})
if err != nil {
return err
}
if err := d.Set("tags", tagsToMapS3(resp.TagSet)); err != nil {
return err
}
return nil
}