diff --git a/main.tf b/main.tf index 72aafaf..47169ea 100644 --- a/main.tf +++ b/main.tf @@ -4,6 +4,8 @@ resource "castai_gke_cluster" "castai_cluster" { name = var.gke_cluster_name delete_nodes_on_disconnect = var.delete_nodes_on_disconnect credentials_json = var.gke_credentials + client_service_account = var.client_service_account_email + cast_service_account = "to-be-computed" } resource "castai_node_configuration" "this" { @@ -144,8 +146,8 @@ resource "castai_node_template" "this" { resource "castai_workload_scaling_policy" "this" { for_each = { for k, v in var.workload_scaling_policies : k => v } - name = try(each.value.name, each.key) - cluster_id = castai_gke_cluster.castai_cluster.id + name = try(each.value.name, each.key) + cluster_id = castai_gke_cluster.castai_cluster.id apply_type = try(each.value.apply_type, "DEFERRED") management_option = try(each.value.management_option, "READ_ONLY") diff --git a/outputs.tf b/outputs.tf index 0f61b4f..8d4c645 100644 --- a/outputs.tf +++ b/outputs.tf @@ -17,3 +17,8 @@ output "castai_node_templates" { for k, v in castai_node_template.this : v.name => v.name } } + +output "castai_service_account" { + description = "Service account used by CAST AI to manage the cluster" + value = castai_gke_cluster.castai_cluster.cast_service_account +} diff --git a/variables.tf b/variables.tf index 035fb74..4341aa6 100644 --- a/variables.tf +++ b/variables.tf @@ -226,4 +226,10 @@ variable "workload_autoscaler_values" { description = "List of YAML formatted string with cluster-workload-autoscaler values" type = list(string) default = [] +} + +variable "client_service_account_email" { + description = "Email of the service account used to impersonate the client" + type = string + default = "" } \ No newline at end of file