Skip to content
This repository was archived by the owner on Mar 19, 2025. It is now read-only.

Commit 4610259

Browse files
authored
feat: added new input variables 'wait_till' and 'wait_till_timeout' to support a cluster to get into desired state (#161)
1 parent 3719316 commit 4610259

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

solutions/agents/provider.tf

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,14 @@ provider "helm" {
2020
}
2121
}
2222

23+
data "ibm_container_vpc_cluster" "cluster" {
24+
name = var.cluster_name
25+
wait_till = var.wait_till
26+
wait_till_timeout = var.wait_till_timeout
27+
}
28+
2329
data "ibm_container_cluster_config" "cluster_config" {
24-
cluster_name_id = var.cluster_name
30+
cluster_name_id = data.ibm_container_vpc_cluster.cluster.name
2531
config_dir = "${path.module}/kubeconfig"
2632
endpoint_type = var.cluster_endpoint_type
2733
}

solutions/agents/variables.tf

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,3 +90,25 @@ variable "cluster_endpoint_type" {
9090
condition = contains(["private", "public"], var.cluster_endpoint_type)
9191
}
9292
}
93+
94+
variable "wait_till" {
95+
description = "To avoid long wait times when you run your Terraform code, you can specify the stage when you want Terraform to mark the cluster resource creation as completed. Depending on what stage you choose, the cluster creation might not be fully completed and continues to run in the background. However, your Terraform code can continue to run without waiting for the cluster to be fully created. Supported args are `MasterNodeReady`, `OneWorkerNodeReady`, `IngressReady` and `Normal`"
96+
type = string
97+
default = "Normal"
98+
99+
validation {
100+
error_message = "`wait_till` value must be one of `MasterNodeReady`, `OneWorkerNodeReady`, `IngressReady` or `Normal`."
101+
condition = contains([
102+
"MasterNodeReady",
103+
"OneWorkerNodeReady",
104+
"IngressReady",
105+
"Normal"
106+
], var.wait_till)
107+
}
108+
}
109+
110+
variable "wait_till_timeout" {
111+
description = "Timeout for wait_till in minutes."
112+
type = number
113+
default = 30
114+
}

0 commit comments

Comments
 (0)