Skip to content

Commit

Permalink
Merge pull request #2820 from sjauld/2819-aws_s3_bucket_policy_derp
Browse files Browse the repository at this point in the history
r/aws_s3_bucket_policy: set the resource ID after successful creation
  • Loading branch information
radeksimko authored Jan 2, 2018
2 parents c3b13ed + e21ad5c commit 86502f0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions aws/resource_aws_s3_bucket_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ func resourceAwsS3BucketPolicyPut(d *schema.ResourceData, meta interface{}) erro
bucket := d.Get("bucket").(string)
policy := d.Get("policy").(string)

d.SetId(bucket)

log.Printf("[DEBUG] S3 bucket: %s, put policy: %s", bucket, policy)

params := &s3.PutBucketPolicyInput{
Expand All @@ -67,6 +65,8 @@ func resourceAwsS3BucketPolicyPut(d *schema.ResourceData, meta interface{}) erro
return fmt.Errorf("Error putting S3 policy: %s", err)
}

d.SetId(bucket)

return nil
}

Expand Down

0 comments on commit 86502f0

Please sign in to comment.