From 23f310cd952461384725d39f09106777a501bdf5 Mon Sep 17 00:00:00 2001 From: Sahal Ansari Date: Tue, 1 Jun 2021 14:34:56 -0500 Subject: [PATCH 1/5] add variable to allow configuring the wait for cluster timeout. --- data.tf | 2 +- variables.tf | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/data.tf b/data.tf index f97692e53e..9352be80a2 100644 --- a/data.tf +++ b/data.tf @@ -90,7 +90,7 @@ data "http" "wait_for_cluster" { count = var.create_eks && var.manage_aws_auth ? 1 : 0 url = format("%s/healthz", aws_eks_cluster.this[0].endpoint) ca_certificate = base64decode(coalescelist(aws_eks_cluster.this[*].certificate_authority[0].data, [""])[0]) - timeout = 300 + timeout = var.wait_for_cluster_create_timeout depends_on = [ aws_eks_cluster.this, diff --git a/variables.tf b/variables.tf index 6cb9d20910..ceeb46e2fd 100644 --- a/variables.tf +++ b/variables.tf @@ -387,3 +387,8 @@ variable "workers_egress_cidrs" { type = list(string) default = ["0.0.0.0/0"] } + +variable "wait_for_cluster_create_timeout" { + description = "A timeout of 5mn when waiting for cluster to be available." + default = 300 +} From d7d549b5f76971e92518afc1aaf53edd27e16fb6 Mon Sep 17 00:00:00 2001 From: Sahal Ansari Date: Tue, 1 Jun 2021 14:44:03 -0500 Subject: [PATCH 2/5] add documentation, update README with wait_for_cluster_create_timeout --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 607c8be86c..d5cfff04f4 100644 --- a/README.md +++ b/README.md @@ -266,6 +266,7 @@ Apache 2 Licensed. See [LICENSE](https://github.com/terraform-aws-modules/terraf | [subnets](#input\_subnets) | A list of subnets to place the EKS cluster and workers within. | `list(string)` | n/a | yes | | [tags](#input\_tags) | A map of tags to add to all resources. Tags added to launch configuration or templates override these values for ASG Tags only. | `map(string)` | `{}` | no | | [vpc\_id](#input\_vpc\_id) | VPC where the cluster and workers will be deployed. | `string` | n/a | yes | +| [wait\_for\_cluster\_create\_timeout](#wait\_for\_cluster\_create\_timeout) | Allows for a configurable timeout when waiting for a cluster to come up | `string` | `300` | no | | [worker\_additional\_security\_group\_ids](#input\_worker\_additional\_security\_group\_ids) | A list of additional security group ids to attach to worker instances | `list(string)` | `[]` | no | | [worker\_ami\_name\_filter](#input\_worker\_ami\_name\_filter) | Name filter for AWS EKS worker AMI. If not provided, the latest official AMI for the specified 'cluster\_version' is used. | `string` | `""` | no | | [worker\_ami\_name\_filter\_windows](#input\_worker\_ami\_name\_filter\_windows) | Name filter for AWS EKS Windows worker AMI. If not provided, the latest official AMI for the specified 'cluster\_version' is used. | `string` | `""` | no | From 4239c36a5043fb8ab6b57c1205ebbd5e2e8482a2 Mon Sep 17 00:00:00 2001 From: Sahal Ansari Date: Tue, 1 Jun 2021 14:53:15 -0500 Subject: [PATCH 3/5] a string is not a number. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d5cfff04f4..5523476086 100644 --- a/README.md +++ b/README.md @@ -266,7 +266,7 @@ Apache 2 Licensed. See [LICENSE](https://github.com/terraform-aws-modules/terraf | [subnets](#input\_subnets) | A list of subnets to place the EKS cluster and workers within. | `list(string)` | n/a | yes | | [tags](#input\_tags) | A map of tags to add to all resources. Tags added to launch configuration or templates override these values for ASG Tags only. | `map(string)` | `{}` | no | | [vpc\_id](#input\_vpc\_id) | VPC where the cluster and workers will be deployed. | `string` | n/a | yes | -| [wait\_for\_cluster\_create\_timeout](#wait\_for\_cluster\_create\_timeout) | Allows for a configurable timeout when waiting for a cluster to come up | `string` | `300` | no | +| [wait\_for\_cluster\_create\_timeout](#wait\_for\_cluster\_create\_timeout) | Allows for a configurable timeout when waiting for a cluster to come up | `number` | `300` | no | | [worker\_additional\_security\_group\_ids](#input\_worker\_additional\_security\_group\_ids) | A list of additional security group ids to attach to worker instances | `list(string)` | `[]` | no | | [worker\_ami\_name\_filter](#input\_worker\_ami\_name\_filter) | Name filter for AWS EKS worker AMI. If not provided, the latest official AMI for the specified 'cluster\_version' is used. | `string` | `""` | no | | [worker\_ami\_name\_filter\_windows](#input\_worker\_ami\_name\_filter\_windows) | Name filter for AWS EKS Windows worker AMI. If not provided, the latest official AMI for the specified 'cluster\_version' is used. | `string` | `""` | no | From 5daf586675666c8829dfe5cd25e4c3f7737f2f69 Mon Sep 17 00:00:00 2001 From: Sahal Ansari Date: Tue, 1 Jun 2021 15:41:30 -0500 Subject: [PATCH 4/5] variable naming suggestion. --- README.md | 2 +- data.tf | 2 +- variables.tf | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5523476086..8c965e245a 100644 --- a/README.md +++ b/README.md @@ -266,7 +266,7 @@ Apache 2 Licensed. See [LICENSE](https://github.com/terraform-aws-modules/terraf | [subnets](#input\_subnets) | A list of subnets to place the EKS cluster and workers within. | `list(string)` | n/a | yes | | [tags](#input\_tags) | A map of tags to add to all resources. Tags added to launch configuration or templates override these values for ASG Tags only. | `map(string)` | `{}` | no | | [vpc\_id](#input\_vpc\_id) | VPC where the cluster and workers will be deployed. | `string` | n/a | yes | -| [wait\_for\_cluster\_create\_timeout](#wait\_for\_cluster\_create\_timeout) | Allows for a configurable timeout when waiting for a cluster to come up | `number` | `300` | no | +| [wait\_for\_cluster\_timeout](#wait\_for\_cluster\_timeout) | Allows for a configurable timeout when waiting for a cluster to come up | `number` | `300` | no | | [worker\_additional\_security\_group\_ids](#input\_worker\_additional\_security\_group\_ids) | A list of additional security group ids to attach to worker instances | `list(string)` | `[]` | no | | [worker\_ami\_name\_filter](#input\_worker\_ami\_name\_filter) | Name filter for AWS EKS worker AMI. If not provided, the latest official AMI for the specified 'cluster\_version' is used. | `string` | `""` | no | | [worker\_ami\_name\_filter\_windows](#input\_worker\_ami\_name\_filter\_windows) | Name filter for AWS EKS Windows worker AMI. If not provided, the latest official AMI for the specified 'cluster\_version' is used. | `string` | `""` | no | diff --git a/data.tf b/data.tf index 9352be80a2..bc80e74a69 100644 --- a/data.tf +++ b/data.tf @@ -90,7 +90,7 @@ data "http" "wait_for_cluster" { count = var.create_eks && var.manage_aws_auth ? 1 : 0 url = format("%s/healthz", aws_eks_cluster.this[0].endpoint) ca_certificate = base64decode(coalescelist(aws_eks_cluster.this[*].certificate_authority[0].data, [""])[0]) - timeout = var.wait_for_cluster_create_timeout + timeout = var.wait_for_cluster_timeout depends_on = [ aws_eks_cluster.this, diff --git a/variables.tf b/variables.tf index ceeb46e2fd..0fb685b3c3 100644 --- a/variables.tf +++ b/variables.tf @@ -388,7 +388,7 @@ variable "workers_egress_cidrs" { default = ["0.0.0.0/0"] } -variable "wait_for_cluster_create_timeout" { +variable "wait_for_cluster_timeout" { description = "A timeout of 5mn when waiting for cluster to be available." default = 300 } From a4fa895d0a492092b311fe45b3cf305b7d183d20 Mon Sep 17 00:00:00 2001 From: Sahal Ansari Date: Tue, 1 Jun 2021 15:57:12 -0500 Subject: [PATCH 5/5] updated with additional suggestions. --- README.md | 2 +- variables.tf | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8c965e245a..45b06aaeba 100644 --- a/README.md +++ b/README.md @@ -266,7 +266,7 @@ Apache 2 Licensed. See [LICENSE](https://github.com/terraform-aws-modules/terraf | [subnets](#input\_subnets) | A list of subnets to place the EKS cluster and workers within. | `list(string)` | n/a | yes | | [tags](#input\_tags) | A map of tags to add to all resources. Tags added to launch configuration or templates override these values for ASG Tags only. | `map(string)` | `{}` | no | | [vpc\_id](#input\_vpc\_id) | VPC where the cluster and workers will be deployed. | `string` | n/a | yes | -| [wait\_for\_cluster\_timeout](#wait\_for\_cluster\_timeout) | Allows for a configurable timeout when waiting for a cluster to come up | `number` | `300` | no | +| [wait\_for\_cluster\_timeout](#wait\_for\_cluster\_timeout) | Allows for a configurable timeout (in seconds) when waiting for a cluster to come up | `number` | `300` | no | | [worker\_additional\_security\_group\_ids](#input\_worker\_additional\_security\_group\_ids) | A list of additional security group ids to attach to worker instances | `list(string)` | `[]` | no | | [worker\_ami\_name\_filter](#input\_worker\_ami\_name\_filter) | Name filter for AWS EKS worker AMI. If not provided, the latest official AMI for the specified 'cluster\_version' is used. | `string` | `""` | no | | [worker\_ami\_name\_filter\_windows](#input\_worker\_ami\_name\_filter\_windows) | Name filter for AWS EKS Windows worker AMI. If not provided, the latest official AMI for the specified 'cluster\_version' is used. | `string` | `""` | no | diff --git a/variables.tf b/variables.tf index 0fb685b3c3..b7d560e402 100644 --- a/variables.tf +++ b/variables.tf @@ -389,6 +389,7 @@ variable "workers_egress_cidrs" { } variable "wait_for_cluster_timeout" { - description = "A timeout of 5mn when waiting for cluster to be available." + description = "A timeout (in seconds) to wait for cluster to be available." + type = number default = 300 }