-
Notifications
You must be signed in to change notification settings - Fork 233
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
Required
field using data source output isn't evaluated as set
#706
Comments
In the sample configuration ownership_challenge = aws_s3_bucket_object.challenge_file.body ownership_challenge = data.aws_s3_bucket_object.challenge_file.body |
Thanks @ewbankkit, that was my bad when stripping down this test case. I'm afraid the reference isn't the issue here 😞 I've updated the test case accordingly. |
I am getting the same issue on the tf 14.9 and cf provider 2.19.2 resource "google_storage_bucket" "log-storage" {
project = var.gcp-project
name = "${replace(var.global_zonename,".","-")}-logs"
location = "US"
force_destroy = true
lifecycle_rule {
condition {
age = 365
}
action {
type = "SetStorageClass"
storage_class = "COLDLINE"
}
}
}
resource "google_project_iam_binding" "cf-storageadmin" {
project = var.gcp-project
role = "roles/storage.objectAdmin"
members = [
"serviceAccount:[email protected]",
]
}
data "google_iam_policy" "cf-storageadmin" {
depends_on = [google_project_iam_binding.cf-storageadmin]
binding {
role = "roles/storage.objectAdmin"
members = [
"serviceAccount:[email protected]",
]
}
}
resource "google_storage_bucket_iam_policy" "add-cf-storage-admin" {
bucket = google_storage_bucket.log-storage.name
policy_data = data.google_iam_policy.cf-storageadmin.policy_data
}
resource "cloudflare_logpush_ownership_challenge" "ownership_challenge" {
depends_on = [google_storage_bucket_iam_policy.add-cf-storage-admin]
zone_id = var.zoneid
destination_conf = "gs://${replace(var.global_zonename,".","-")}-logs/logs"
}
data "google_storage_bucket_object_content" "challenge_data" {
bucket = google_storage_bucket.log-storage.name
name = cloudflare_logpush_ownership_challenge.ownership_challenge.ownership_challenge_filename
}
resource "cloudflare_logpush_job" "cf_logpush" {
depends_on = [google_storage_bucket.log-storage]
enabled = true
zone_id = var.zoneid
name = "all-logs"
logpull_options = "fields=ParentRayID,RayID,SecurityLevel,SmartRouteColoID,ClientIP,EdgeStartTimestamp×tamps=rfc3339,sample=1.0"
destination_conf = "gs://${replace(var.global_zonename,".","-")}-logs/logs"
ownership_challenge = data.google_storage_bucket_object_content.challenge_data.content
dataset = "http_requests"
} |
Hi folks 👋 There have been numerous changes and fixes to terraform-plugin-sdk and Terraform CLI since the versions mentioned in the original issue report. In particular, Terraform CLI 0.13.x handled data source references different than all other Terraform CLI versions. If you still believe there is an issue with the SDK, it would be great if you could verify it against Terraform CLI 1.1.x and terraform-plugin-sdk 2.11.0 so we can take a fresh look in a new issue (especially showing the |
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. |
While chasing down a customer issue, I discovered that a
Required
field (herecloudflare_logpush_job.example_job.ownership_challenge
) pointing at a data source value doesn't register as being set despite the data source value definitely being present (confirmed usingoutputs
). This results in the following error:Versions
provider registry.terraform.io/cloudflare/cloudflare
v2.18.0 (https://github.com/cloudflare/terraform-provider-cloudflare)terraform-sdk-plugin
v1.16.0(example configuration from https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/logpush_job)
I unfortunately haven't been able to narrow down a smaller reproduction test case however I suspect any two resources where one is a data source and the other has a required field may do it.
I've also tried using explicit
depends_on
in the resources to no avail.cc @paddycarver from our discussion in Slack.
The text was updated successfully, but these errors were encountered: