-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
tf.state saved without empty principal block for s3 bucket policy #5311
Comments
We can't use the s3 document bucket module until terraform-provider-aws have addressed this bug: hashicorp/terraform-provider-aws#5311
We can't use the s3 document bucket module until terraform-provider-aws have addressed this bug: hashicorp/terraform-provider-aws#5311
We can't use the s3 document bucket module until terraform-provider-aws have addressed this bug: hashicorp/terraform-provider-aws#5311
We can't use the s3 document bucket module until terraform-provider-aws have addressed this bug: hashicorp/terraform-provider-aws#5311
We can't use the s3 document bucket module until terraform-provider-aws have addressed this bug: hashicorp/terraform-provider-aws#5311
We can't use the s3 document bucket module until terraform-provider-aws have addressed this bug: hashicorp/terraform-provider-aws#5311
We can't use the s3 document bucket module until terraform-provider-aws have addressed this bug: hashicorp/terraform-provider-aws#5311
We can't use the s3 document bucket module until terraform-provider-aws have addressed this bug: hashicorp/terraform-provider-aws#5311
We can't use the s3 document bucket module until terraform-provider-aws have addressed this bug: hashicorp/terraform-provider-aws#5311
We can't use the s3 document bucket module until terraform-provider-aws have addressed this bug: hashicorp/terraform-provider-aws#5311
We can't use the s3 document bucket module until terraform-provider-aws have addressed this bug: hashicorp/terraform-provider-aws#5311
We can't use the s3 document bucket module until terraform-provider-aws have addressed this bug: hashicorp/terraform-provider-aws#5311
We can't use the s3 document bucket module until terraform-provider-aws have addressed this bug: hashicorp/terraform-provider-aws#5311
We can't use the s3 document bucket module until terraform-provider-aws have addressed this bug: hashicorp/terraform-provider-aws#5311
@bflad wondering if there is a workaround for above mentioned issue? |
@benvand |
Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label. If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you! |
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. |
This issue was originally opened by @benvand as hashicorp/terraform#18525. It was migrated here as a result of the provider split. The original body of the issue is below.
Terraform Version
Terraform Configuration Files
modules/s3-document-bucket/main.tf
So we have a simple module to create a bucket and attach a policy giving read/ write perms to specified roles based on arns passed in as variables.
main.tf
We call the module, in the first instance it's fine, creates the policy, saves it to the remote state file etc. The problem arises when we have an empty list as our principal variable (
read_only_bucket.write_object_roles
)Output of
terraform plan
Terraform plan shows there is a change to make and is saying it will add an empty principal block. It doesn't appear to complete this action because running plan, then apply then plan yields the same message.
What's happening
The state file gets saved without a principal block because it would have been empty.
The plan gets generated with an empty principal block.
There's always a mismatch.
Additional Context
It looks like this might be a known issue:
https://www.terraform.io/docs/providers/aws/r/s3_bucket.html#policy
However... This is slightly more of a problem than the issues referenced below. In those,
resource
,action
andprincipal
list variables are converted to strings if they contain a single value. In my case the principal block is removed altogether when no principal is specified. I can't replicate this in my terraform because I can't conditionally remove theprincipal
blockCan anyone suggest a work around until
0.12
? https://www.hashicorp.com/blog/terraform-0-1-2-previewReferences
hashicorp/terraform#5613
hashicorp/terraform#4948
The text was updated successfully, but these errors were encountered: