-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
import aws_s3_bucket does not store important attributes like acl #6193
Comments
The issue is persist in Terraform v0.12.18. The |
I'm seeing this with Terraform 0.12.26 and version 2.69.0 of the aws provider. It's concerning when there are grants involved since trying to
I am not sure how to account for this without hacking the state file to add the |
we are experiencing the same issue. terraform v0.12.28, aws provider 2.58.0 |
This issue is still being seen with Terraform v0.12.24, aws-provider 3.3.0 |
Would be great to get some kind of update on this if possible. This still seems to be a problem and the issue has been around for about 2 years now. |
Still an issue with Terraform 0.12.24 and aws-provider 3.22.0 |
I had the same issue. I imported an existing bucket to terraform. The bucket was public: Here is the code:
After importing, during
But, after this action, terraform also removed logic from grant blocks (the bucket was not public anymore)! During another So, what I did? I used this guy: https://www.terraform.io/docs/configuration/meta-arguments/lifecycle.html#ignore_changes and added both
And it works. Terraform does not want to change this resource anymore and does not remove my grant blocks too. But, I think that it looks quite hacky. |
Still an issue. Terraform v0.14.5
+ provider registry.terraform.io/hashicorp/aws v3.24.1 |
Just curious here, how do I know what was the correct |
https://docs.aws.amazon.com/cli/latest/reference/s3api/get-bucket-acl.html |
Maybe so, but thank you nonetheless, as I am experiencing this issue and this worked for me. Currently I do not see any alternative. |
Here's an OK workaround depending on your comfort level: Step 1. Pull the state file down Ensure you're in the directory of your imported s3 bucket and run:
Step 2. Edit the state.json file and set the correct state on force_destroy/acl In the JSON file you'll have to find your resource and in the attributes object you'll find both the You can map your S3 ACL to set of canned ACLs here: Step 3. Increment the serial number at the top of the state.json file If its currently 5 set it to 6.. etc.. Step 4. Push the state file back up, and make sure to erase the local copy*
After that all of it came out clean without having to ignore the state. |
|
Hi all 👋 Just letting you know that this is issue is featured on this quarters roadmap. If a PR exists to close the issue a maintainer will review and either make changes directly, or work with the original author to get the contribution merged. If you have written a PR to resolve the issue please ensure the "Allow edits from maintainers" box is checked. Thanks for your patience and we are looking forward to getting this merged soon! |
Awesome news! I've opened this PR to fix this issue: #20670 |
closing per @pdecat comment. If there are still issues please open a new ticket with relevant details. |
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. |
i am trying to import exist s3 resource. generating hcl with terraforming, and importing statefile with terraform.
after import , while run terraform plan cannot get zero changes.
Terraform verion
Terraform Configuration Files
main.tf
resource.tf -- generated by terraforming
Output
and check s3/terraform.tfstate file, without acl attribute
Expected Behavior
run terraform plan get zero changes.
The text was updated successfully, but these errors were encountered: