-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
resource/aws_s3_bucket_policy: add import ability #6543
resource/aws_s3_bucket_policy: add import ability #6543
Conversation
@@ -86,6 +89,9 @@ func resourceAwsS3BucketPolicyRead(d *schema.ResourceData, meta interface{}) err | |||
if err := d.Set("policy", v); err != nil { | |||
return err | |||
} | |||
if err := d.Set("bucket", d.Id()); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bflad not sure if this will break anything - had to do it in order for import to work correctly though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a valid (non-breaking) change, thanks!
@@ -9,7 +9,7 @@ import ( | |||
"github.com/hashicorp/terraform/helper/acctest" | |||
"github.com/hashicorp/terraform/helper/resource" | |||
"github.com/hashicorp/terraform/terraform" | |||
"github.com/jen20/awspolicyequivalence" | |||
awspolicy "github.com/jen20/awspolicyequivalence" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
goimports added this automatically, let me know if I need to revert the change.
0dbd003
to
2b4f06f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with the one minor little formatting fix on merge, thanks @acburdine! 🚀
--- PASS: TestAccAWSS3BucketPolicy_basic (28.39s)
--- PASS: TestAccAWSS3BucketPolicy_policyUpdate (44.97s)
@@ -86,6 +89,9 @@ func resourceAwsS3BucketPolicyRead(d *schema.ResourceData, meta interface{}) err | |||
if err := d.Set("policy", v); err != nil { | |||
return err | |||
} | |||
if err := d.Set("bucket", d.Id()); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a valid (non-breaking) change, thanks!
|
||
## Import | ||
S3 bucket policies can be imported using the bucket name, e.g. | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like an extra space snuck in here, which would likely break the page formatting. Maybe someday we'll get markdownlint running against pull requests to catch this. 😅 I'll fix this on merge.
This was released (4 days ago) in version 1.47.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
closes #6519
Changes proposed in this pull request:
Output from acceptance testing: