-
-
Notifications
You must be signed in to change notification settings - Fork 839
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
fix(main.tf): change count check for privileged_principal_arns #103
Conversation
/test all |
Hmmm Error: Error putting S3 policy: MalformedPolicy: Could not parse the policy: Statement is not well formatted. |
With this change, I run this locally cd examples/complete
terraform init
terraform plan -var-file=object-lock.us-east-2.tfvars And it tries to create this empty resource # module.s3_bucket.aws_s3_bucket_policy.default[0] will be created
+ resource "aws_s3_bucket_policy" "default" {
+ bucket = (known after apply)
+ id = (known after apply)
+ policy = jsonencode(
{
+ Statement = null
+ Version = "2012-10-17"
}
)
} If we can change FYI the error you're probably getting (source)
|
In order to test, I added some more scenarios like a plain one and one creating an S3 bucket with a policy attached. The change to |
Is there a way to see if the statement is null? |
Dont think so. As soon as TF doesn't know what is stored inside the variable it won't work. I'd consider closing the ticket. If you'd like you can still take over the extended examples. What do you think? |
Let's close for now and reopen if there's a better solution |
what
length(var.privileged_principal_arns)
is not determinable before apply if the input itself is dependent on other resources.why
references