Skip to content
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

Support S3 bucket policy import #6519

Closed
rwolfson opened this issue Nov 19, 2018 · 5 comments · Fixed by #6543
Closed

Support S3 bucket policy import #6519

rwolfson opened this issue Nov 19, 2018 · 5 comments · Fixed by #6543
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/s3 Issues and PRs that pertain to the s3 service.
Milestone

Comments

@rwolfson
Copy link
Contributor

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

It appears that S3 bucket policies bucket policies cannot be imported at this time. It would be nice if they could be. This was hit in AWS provider v1.45.0

terraform import aws_s3_bucket_policy.sanitized-bucket-name sanitized-bucket-name
aws_s3_bucket_policy.sanitized-bucket-name: Importing from ID "sanitized-bucket-name"...

Error: aws_s3_bucket_policy.sanitized-bucket-name (import id: sanitized-bucket-name): import aws_s3_bucket_policy.sanitized-bucket-name (id: sanitized-bucket-name): resource aws_s3_bucket_policy doesn't support import

New or Affected Resource(s)

  • aws_s3_bucket_policy

Potential Terraform Configuration

The Terraform configuration used to hit this issue was:

data "aws_s3_bucket" "sanitized-bucket-name" {
  bucket = "sanitized-bucket-name"
}
data "aws_iam_policy_document" "sanitized-bucket-name" {
  ### Policy contents removed
}

resource "aws_s3_bucket_policy" "sanitized-bucket-name" {
  bucket = "${data.aws_s3_bucket.sanitized-bucket-name.id}"
  policy = "${data.aws_iam_policy_document.sanitized-bucket-name.json}"
}
@bflad bflad added enhancement Requests to existing resources that expand the functionality or scope. service/s3 Issues and PRs that pertain to the s3 service. labels Nov 19, 2018
acburdine added a commit to acburdine/terraform-provider-aws that referenced this issue Nov 21, 2018
@bflad bflad added this to the v1.47.0 milestone Nov 25, 2018
@bflad
Copy link
Contributor

bflad commented Nov 25, 2018

Support for aws_s3_bucket_policy resource import has been merged in and will release with version 1.47.0 of the AWS provider, sometime later this week. 👍

@erriapo
Copy link

erriapo commented Nov 30, 2018

How can I use the newly merged changes ?

@bflad
Copy link
Contributor

bflad commented Nov 30, 2018

Sorry due to re:Invent related activities, I missed commenting with our normal release comment -- hopefully this helps:

This has been released 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.

e.g. if you have existing provider configuration block(s), updating the version attribute and running terraform init will upgrade your provider:

provider "aws" {
  version = "1.47.0"
}

@erriapo
Copy link

erriapo commented Nov 30, 2018

@bflad Thanks for replying. Enjoy re:Invent. It's all good on my side now.

@ghost
Copy link

ghost commented Apr 2, 2020

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!

@ghost ghost locked and limited conversation to collaborators Apr 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/s3 Issues and PRs that pertain to the s3 service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants