From a7bbff6c1eb3256d9cddf4c8db70e7a7fbe52cbf Mon Sep 17 00:00:00 2001 From: Ben Lau Date: Mon, 20 Feb 2017 11:59:47 -0800 Subject: [PATCH 1/2] aws/provider: aws_s3_bucket doesn't report bucket name when encountering tag value problems --- builtin/providers/aws/resource_aws_s3_bucket.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/providers/aws/resource_aws_s3_bucket.go b/builtin/providers/aws/resource_aws_s3_bucket.go index a8c5f199d..028e14b29 100644 --- a/builtin/providers/aws/resource_aws_s3_bucket.go +++ b/builtin/providers/aws/resource_aws_s3_bucket.go @@ -450,7 +450,7 @@ func resourceAwsS3BucketCreate(d *schema.ResourceData, meta interface{}) error { func resourceAwsS3BucketUpdate(d *schema.ResourceData, meta interface{}) error { s3conn := meta.(*AWSClient).s3conn if err := setTagsS3(s3conn, d); err != nil { - return err + return fmt.Errorf("%s %q", err, d.Get("bucket").(string)) } if d.HasChange("policy") { From fa77fbf4f4cb411687a923f84485152553652688 Mon Sep 17 00:00:00 2001 From: Ben Lau Date: Tue, 21 Feb 2017 12:51:58 -0800 Subject: [PATCH 2/2] tweak the output string for better readability --- builtin/providers/aws/resource_aws_s3_bucket.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/providers/aws/resource_aws_s3_bucket.go b/builtin/providers/aws/resource_aws_s3_bucket.go index 028e14b29..646475be1 100644 --- a/builtin/providers/aws/resource_aws_s3_bucket.go +++ b/builtin/providers/aws/resource_aws_s3_bucket.go @@ -450,7 +450,7 @@ func resourceAwsS3BucketCreate(d *schema.ResourceData, meta interface{}) error { func resourceAwsS3BucketUpdate(d *schema.ResourceData, meta interface{}) error { s3conn := meta.(*AWSClient).s3conn if err := setTagsS3(s3conn, d); err != nil { - return fmt.Errorf("%s %q", err, d.Get("bucket").(string)) + return fmt.Errorf("%q: %s", d.Get("bucket").(string), err) } if d.HasChange("policy") {