-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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 0.12 data.aws_iam_policy_document still contains unknown values during apply #22424
Comments
Same issue here. Terraform apply:
My tf template is even simpler, the only dynamic resource is the resource reference: data "aws_iam_policy_document" "data_dev_bucket" {
# Only allow TLS communication with the bucket contents
statement {
effect = "Deny"
actions = [
"*",
]
principals {
type = "*"
identifiers = ["*"]
}
resources = [
"${aws_s3_bucket.data_dev[0].arn}/*",
]
condition {
test = "Bool"
variable = "aws:SecureTransport"
values = ["false"]
}
}
} |
Seems terraform returns I was able to reproduce this error with the following code. provider "aws" {
region = "us-east-1"
}
resource "null_resource" "foo" {
count = 0
}
data "aws_iam_policy_document" "bar" {
statement {
actions = ["*"]
resources = ["${null_resource.foo[0].id}"]
}
}
Not sure it's the root cause of the issue reported here though, I guess it's worthwhile to check if there exist any error in expressions used in |
Still not working for me either
Using the output of a module as an input to this data source still does not work, was absolutely fine on Terraform 0.11 edit: oddly that output |
Thanks @nozaq, that is indeed the root cause in this situation. @dsnellgrove, since you seem to have the next smallest configuration, can you make a more complete example to confirm if |
Closed by #22846 |
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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Terraform Version
Terraform Configuration Files
Expected Behavior
The Bucket Policy should have been created and attached to the S3 Bucket.
Actual Behavior
Terraform throws the following error on apply
Steps to Reproduce
terraform init
terraform plan
terraform apply
Additional Context
This worked with v0.11.14
Hardcoding the bucket name in the
aws_s3_bucket_policy
resource and theaws_iam_policy_document
data resolves the issue:References
Possibly related to
The text was updated successfully, but these errors were encountered: