File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
examples/gke/gke_impersonate Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change 1+ # Configure Data sources and providers required for CAST AI connection.
12locals {
2- service_account_id = " castai-gke-tf-${ substr (sha1 (var. cluster_name ), 0 , 8 )} "
3+ service_account_id = var . service_account_id != " " ? var . service_account_id : " castai-gke-tf-${ substr (sha1 (var. cluster_name ), 0 , 8 )} "
34}
45
6+ # Configure GKE cluster connection.
57module "iam-impersonate" {
68 source = " castai/iam-impersonate/gke"
79 version = " 1.0.0"
@@ -153,5 +155,8 @@ module "castai-gke-cluster" {
153155 }
154156 }
155157 }
158+
159+ // depends_on helps terraform with creating proper dependencies graph in case of resource creation and in this case destroy
160+ // module "castai-gke-cluster" has to be destroyed before module "castai-gke-iam" and "module.gke"
156161 depends_on = [module . gke ]
157162}
Original file line number Diff line number Diff line change @@ -48,3 +48,9 @@ variable "tags" {
4848 description = " Optional tags for new cluster nodes. This parameter applies only to new nodes - tags for old nodes are not reconciled."
4949 default = {}
5050}
51+
52+ variable "service_account_id" {
53+ type = string
54+ description = " Cast service account id for impersonation."
55+ default = " "
56+ }
You can’t perform that action at this time.
0 commit comments