diff --git a/autogen/safer-cluster/main.tf.tmpl b/autogen/safer-cluster/main.tf.tmpl index 2b6926483..7459598fb 100644 --- a/autogen/safer-cluster/main.tf.tmpl +++ b/autogen/safer-cluster/main.tf.tmpl @@ -193,4 +193,6 @@ module "gke" { filestore_csi_driver = var.filestore_csi_driver notification_config_topic = var.notification_config_topic + + timeouts = var.timeouts } diff --git a/autogen/safer-cluster/variables.tf.tmpl b/autogen/safer-cluster/variables.tf.tmpl index d7720b77c..66afc7d3c 100644 --- a/autogen/safer-cluster/variables.tf.tmpl +++ b/autogen/safer-cluster/variables.tf.tmpl @@ -474,3 +474,13 @@ variable "notification_config_topic" { description = "The desired Pub/Sub topic to which notifications will be sent by GKE. Format is projects/{project}/topics/{topic}." default = "" } + +variable "timeouts" { + type = map(string) + description = "Timeout for cluster operations." + default = {} + validation { + condition = !contains([for t in keys(var.timeouts) : contains(["create", "update", "delete"], t)], false) + error_message = "Only create, update, delete timeouts can be specified." + } +} diff --git a/modules/safer-cluster-update-variant/README.md b/modules/safer-cluster-update-variant/README.md index d3676146e..21eff2cba 100644 --- a/modules/safer-cluster-update-variant/README.md +++ b/modules/safer-cluster-update-variant/README.md @@ -267,6 +267,7 @@ For simplicity, we suggest using `roles/container.admin` and | sandbox\_enabled | (Beta) Enable GKE Sandbox (Do not forget to set `image_type` = `COS_CONTAINERD` to use it). | `bool` | `false` | no | | stub\_domains | Map of stub domains and their resolvers to forward DNS queries for a certain domain to an external DNS server | `map(list(string))` | `{}` | no | | subnetwork | The subnetwork to host the cluster in | `string` | n/a | yes | +| timeouts | Timeout for cluster operations. | `map(string)` | `{}` | no | | upstream\_nameservers | If specified, the values replace the nameservers taken by default from the node’s /etc/resolv.conf | `list(string)` | `[]` | no | | windows\_node\_pools | List of maps containing node pools | `list(map(string))` | `[]` | no | | zones | The zones to host the cluster in | `list(string)` | `[]` | no | diff --git a/modules/safer-cluster-update-variant/main.tf b/modules/safer-cluster-update-variant/main.tf index 948969857..9bd0429ca 100644 --- a/modules/safer-cluster-update-variant/main.tf +++ b/modules/safer-cluster-update-variant/main.tf @@ -189,4 +189,6 @@ module "gke" { filestore_csi_driver = var.filestore_csi_driver notification_config_topic = var.notification_config_topic + + timeouts = var.timeouts } diff --git a/modules/safer-cluster-update-variant/variables.tf b/modules/safer-cluster-update-variant/variables.tf index bf39b9535..7a2f1a69d 100644 --- a/modules/safer-cluster-update-variant/variables.tf +++ b/modules/safer-cluster-update-variant/variables.tf @@ -474,3 +474,13 @@ variable "notification_config_topic" { description = "The desired Pub/Sub topic to which notifications will be sent by GKE. Format is projects/{project}/topics/{topic}." default = "" } + +variable "timeouts" { + type = map(string) + description = "Timeout for cluster operations." + default = {} + validation { + condition = !contains([for t in keys(var.timeouts) : contains(["create", "update", "delete"], t)], false) + error_message = "Only create, update, delete timeouts can be specified." + } +} diff --git a/modules/safer-cluster/README.md b/modules/safer-cluster/README.md index d3676146e..21eff2cba 100644 --- a/modules/safer-cluster/README.md +++ b/modules/safer-cluster/README.md @@ -267,6 +267,7 @@ For simplicity, we suggest using `roles/container.admin` and | sandbox\_enabled | (Beta) Enable GKE Sandbox (Do not forget to set `image_type` = `COS_CONTAINERD` to use it). | `bool` | `false` | no | | stub\_domains | Map of stub domains and their resolvers to forward DNS queries for a certain domain to an external DNS server | `map(list(string))` | `{}` | no | | subnetwork | The subnetwork to host the cluster in | `string` | n/a | yes | +| timeouts | Timeout for cluster operations. | `map(string)` | `{}` | no | | upstream\_nameservers | If specified, the values replace the nameservers taken by default from the node’s /etc/resolv.conf | `list(string)` | `[]` | no | | windows\_node\_pools | List of maps containing node pools | `list(map(string))` | `[]` | no | | zones | The zones to host the cluster in | `list(string)` | `[]` | no | diff --git a/modules/safer-cluster/main.tf b/modules/safer-cluster/main.tf index 1f831cd1c..b87a2f1d8 100644 --- a/modules/safer-cluster/main.tf +++ b/modules/safer-cluster/main.tf @@ -189,4 +189,6 @@ module "gke" { filestore_csi_driver = var.filestore_csi_driver notification_config_topic = var.notification_config_topic + + timeouts = var.timeouts } diff --git a/modules/safer-cluster/variables.tf b/modules/safer-cluster/variables.tf index bf39b9535..7a2f1a69d 100644 --- a/modules/safer-cluster/variables.tf +++ b/modules/safer-cluster/variables.tf @@ -474,3 +474,13 @@ variable "notification_config_topic" { description = "The desired Pub/Sub topic to which notifications will be sent by GKE. Format is projects/{project}/topics/{topic}." default = "" } + +variable "timeouts" { + type = map(string) + description = "Timeout for cluster operations." + default = {} + validation { + condition = !contains([for t in keys(var.timeouts) : contains(["create", "update", "delete"], t)], false) + error_message = "Only create, update, delete timeouts can be specified." + } +}