From b7539dc220f6b5fe199d67569b6f3619ec00fdf0 Mon Sep 17 00:00:00 2001 From: Ivan Dechovski Date: Wed, 3 Nov 2021 10:44:26 +0100 Subject: [PATCH] feat: Add ability to define custom timeout for fargate profiles (#1614) --- examples/complete/main.tf | 5 +++++ examples/fargate/main.tf | 9 +++++++++ modules/fargate/README.md | 1 + modules/fargate/main.tf | 5 +++++ 4 files changed, 20 insertions(+) diff --git a/examples/complete/main.tf b/examples/complete/main.tf index ba762e8e03..5cfcab668b 100644 --- a/examples/complete/main.tf +++ b/examples/complete/main.tf @@ -114,6 +114,11 @@ module "eks" { tags = { Owner = "test" } + + timeouts = { + create = "20m" + delete = "20m" + } } } diff --git a/examples/fargate/main.tf b/examples/fargate/main.tf index 869ed7e991..09e2e57e2d 100644 --- a/examples/fargate/main.tf +++ b/examples/fargate/main.tf @@ -68,6 +68,11 @@ module "eks" { tags = { Owner = "default" } + + timeouts = { + create = "20m" + delete = "20m" + } } secondary = { @@ -154,6 +159,10 @@ module "fargate_profile_existing_cluster" { Owner = "profile2" submodule = "true" } + + timeouts = { + delete = "20m" + } } } diff --git a/modules/fargate/README.md b/modules/fargate/README.md index c4dfaaf6fd..466b2a051a 100644 --- a/modules/fargate/README.md +++ b/modules/fargate/README.md @@ -15,6 +15,7 @@ See example code in `examples/fargate`. | name | Fargate profile name | `string` | Auto generated in the following format `[cluster_name]-fargate-[fargate_profile_map_key]`| no | | selectors | A list of Kubernetes selectors. See examples/fargate/main.tf for example format. |
list(map({
namespace = string
labels = map(string)
}))
| `[]` | no | | subnets | List of subnet IDs. Will replace the root module subnets. | `list(string)` | `var.subnets` | no | +| timeouts | A map of timeouts for create/delete operations. | `map(string)` | Provider default behavior | no | | tags | Key-value map of resource tags. Will be merged with root module tags. | `map(string)` | `var.tags` | no | diff --git a/modules/fargate/main.tf b/modules/fargate/main.tf index 74e3c9b2e2..a4e4b0d80f 100644 --- a/modules/fargate/main.tf +++ b/modules/fargate/main.tf @@ -63,5 +63,10 @@ resource "aws_eks_fargate_profile" "this" { } } + timeouts { + create = try(each.value["timeouts"].create, null) + delete = try(each.value["timeouts"].delete, null) + } + tags = merge(var.tags, lookup(each.value, "tags", {})) }