You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Terraform chokes with Error: Inconsistent conditional result types when trying to compute gcp_service_account output in workload-identity/output.tf.
Expected behavior
No response
Observed behavior
The full error message is:
paulius@xps:~/Documents/gcloud-infrastructure/terraform_v2$ terraform apply
╷
│ Error: Inconsistent conditional result types
│
│ on .terraform/modules/kubernetes-engine_workload-identity/modules/workload-identity/output.tf line 44, in output "gcp_service_account":
│ 44: value = var.use_existing_gcp_sa ? data.google_service_account.cluster_service_account[0] : google_service_account.cluster_service_account[0]
│ ├────────────────
│ │ data.google_service_account.cluster_service_account[0] is a object, known only after apply
│ │ google_service_account.cluster_service_account[0] is a object, known only after apply
│ │ var.use_existing_gcp_sa is a bool, known only after apply
│
│ The true and false result expressions must have consistent types. The given expressions are object and object, respectively.
It did work initially, when I created the cluster, and I'm not sure what happened since then. I'm pretty sure I did not upgrade anything.
When I got this bug, I did reinit terraform, with no positive effect. My current workaround is to manually edit the .terraform/modules/kubernetes-engine_workload-identity/modules//workload-identity/output.tf file and replace line 44 by value = google_service_account.cluster_service_account[0].
The text was updated successfully, but these errors were encountered:
Interesting, seems like a change in Terraform v1.1.0. We might have to use a data source in both cases or construct an object with an overlapping subset of the fields.
TL;DR
Terraform chokes with
Error: Inconsistent conditional result types
when trying to computegcp_service_account
output inworkload-identity/output.tf
.Expected behavior
No response
Observed behavior
The full error message is:
Terraform Configuration
Additional information
It did work initially, when I created the cluster, and I'm not sure what happened since then. I'm pretty sure I did not upgrade anything.
When I got this bug, I did reinit terraform, with no positive effect. My current workaround is to manually edit the
.terraform/modules/kubernetes-engine_workload-identity/modules//workload-identity/output.tf
file and replace line 44 byvalue = google_service_account.cluster_service_account[0]
.The text was updated successfully, but these errors were encountered: