Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down Expand Up @@ -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")
Expand Down
5 changes: 5 additions & 0 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ""
}