diff --git a/README.md b/README.md index 693e017c13..a0638a01f1 100644 --- a/README.md +++ b/README.md @@ -267,6 +267,7 @@ Apache 2 Licensed. See [LICENSE](https://github.com/terraform-aws-modules/terraf | [permissions\_boundary](#input\_permissions\_boundary) | If provided, all IAM roles will be created with this permissions boundary attached. | `string` | `null` | no | | [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 | +| [timeouts](#input\_timeouts) | A map of timeouts for create/update/delete operations. | `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](#input\_wait\_for\_cluster\_timeout) | A timeout (in seconds) to wait for cluster to be available. | `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 | diff --git a/local.tf b/local.tf index 7f4799d418..6064876f86 100644 --- a/local.tf +++ b/local.tf @@ -96,6 +96,7 @@ locals { additional_ebs_volumes = [] # A list of additional volumes to be attached to the instances on this Auto Scaling group. Each volume should be an object with the following: block_device_name (required), volume_size, volume_type, iops, throughput, encrypted, kms_key_id (only on launch-template), delete_on_termination. Optional values are grabbed from root volume or from defaults additional_instance_store_volumes = [] # A list of additional instance store (local disk) volumes to be attached to the instances on this Auto Scaling group. Each volume should be an object with the following: block_device_name (required), virtual_name. warm_pool = null # If this block is configured, add a Warm Pool to the specified Auto Scaling group. + timeouts = {} # A map of timeouts for create/update/delete operations # Settings for launch templates root_block_device_name = concat(data.aws_ami.eks_worker.*.root_device_name, [""])[0] # Root device name for Linux workers. If not provided, will assume default Linux AMI was used. diff --git a/modules/node_groups/README.md b/modules/node_groups/README.md index 1ac6612eab..4811e1a709 100644 --- a/modules/node_groups/README.md +++ b/modules/node_groups/README.md @@ -48,6 +48,7 @@ The role ARN specified in `var.default_iam_role_arn` will be used by default. In | subnets | Subnets to contain workers | list(string) | `var.workers_group_defaults[subnets]` | | version | Kubernetes version | string | Provider default behavior | | taints | Kubernetes node taints | list(map) | empty | +| timeouts | A map of timeouts for create/update/delete operations. | `map(string)` | Provider default behavior | | update_default_version | Whether or not to set the new launch template version the Default | bool | `true` | @@ -89,6 +90,7 @@ No modules. | [node\_groups](#input\_node\_groups) | Map of maps of `eks_node_groups` to create. See "`node_groups` and `node_groups_defaults` keys" section in README.md for more details | `any` | `{}` | no | | [node\_groups\_defaults](#input\_node\_groups\_defaults) | map of maps of node groups to create. See "`node_groups` and `node_groups_defaults` keys" section in README.md for more details | `any` | n/a | yes | | [tags](#input\_tags) | A map of tags to add to all resources | `map(string)` | n/a | yes | +| [timeouts](#input\_timeouts) | A map of timeouts for create/update/delete operations. | `map(string)` | n/a | yes | | [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\_security\_group\_id](#input\_worker\_security\_group\_id) | If provided, all workers will be attached to this security group. If not given, a security group will be created with necessary ingress/egress to work with the EKS cluster. | `string` | `""` | no | | [workers\_group\_defaults](#input\_workers\_group\_defaults) | Workers group defaults from parent | `any` | n/a | yes | diff --git a/modules/node_groups/locals.tf b/modules/node_groups/locals.tf index da8d20e582..6d40e03808 100644 --- a/modules/node_groups/locals.tf +++ b/modules/node_groups/locals.tf @@ -24,6 +24,7 @@ locals { pre_userdata = var.workers_group_defaults["pre_userdata"] additional_security_group_ids = var.workers_group_defaults["additional_security_group_ids"] taints = [] + timeouts = var.workers_group_defaults["timeouts"] update_default_version = true ebs_optimized = null }, diff --git a/modules/node_groups/node_groups.tf b/modules/node_groups/node_groups.tf index 4e3bf596ad..865f3ae634 100644 --- a/modules/node_groups/node_groups.tf +++ b/modules/node_groups/node_groups.tf @@ -69,6 +69,12 @@ resource "aws_eks_node_group" "workers" { } } + timeouts { + create = lookup(each.value["timeouts"], "create", null) + update = lookup(each.value["timeouts"], "update", null) + delete = lookup(each.value["timeouts"], "delete", null) + } + version = lookup(each.value, "version", null) labels = merge( diff --git a/modules/node_groups/variables.tf b/modules/node_groups/variables.tf index 52209e5ef0..d881968b06 100644 --- a/modules/node_groups/variables.tf +++ b/modules/node_groups/variables.tf @@ -36,6 +36,11 @@ variable "tags" { type = map(string) } +variable "timeouts" { + description = "A map of timeouts for create/update/delete operations." + type = map(string) +} + variable "node_groups_defaults" { description = "map of maps of node groups to create. See \"`node_groups` and `node_groups_defaults` keys\" section in README.md for more details" type = any diff --git a/node_groups.tf b/node_groups.tf index ec483b8f02..2a3580828a 100644 --- a/node_groups.tf +++ b/node_groups.tf @@ -7,6 +7,7 @@ module "node_groups" { worker_security_group_id = local.worker_security_group_id worker_additional_security_group_ids = var.worker_additional_security_group_ids tags = var.tags + timeouts = var.timeouts node_groups_defaults = var.node_groups_defaults node_groups = var.node_groups ebs_optimized_not_supported = local.ebs_optimized_not_supported diff --git a/variables.tf b/variables.tf index 064243605f..b2019fafc4 100644 --- a/variables.tf +++ b/variables.tf @@ -104,6 +104,12 @@ variable "cluster_tags" { default = {} } +variable "timeouts" { + description = "A map of timeouts for create/update/delete operations." + type = map(string) + default = {} +} + variable "vpc_id" { description = "VPC where the cluster and workers will be deployed." type = string @@ -404,4 +410,5 @@ variable "openid_connect_audiences" { description = "List of OpenID Connect audience client IDs to add to the IRSA provider." type = list(string) default = [] -} \ No newline at end of file +} +