Skip to content

Commit b7539dc

Browse files
feat: Add ability to define custom timeout for fargate profiles (terraform-aws-modules#1614)
1 parent 6959b9b commit b7539dc

File tree

4 files changed

+20
-0
lines changed

4 files changed

+20
-0
lines changed

examples/complete/main.tf

+5
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,11 @@ module "eks" {
114114
tags = {
115115
Owner = "test"
116116
}
117+
118+
timeouts = {
119+
create = "20m"
120+
delete = "20m"
121+
}
117122
}
118123
}
119124

examples/fargate/main.tf

+9
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@ module "eks" {
6868
tags = {
6969
Owner = "default"
7070
}
71+
72+
timeouts = {
73+
create = "20m"
74+
delete = "20m"
75+
}
7176
}
7277

7378
secondary = {
@@ -154,6 +159,10 @@ module "fargate_profile_existing_cluster" {
154159
Owner = "profile2"
155160
submodule = "true"
156161
}
162+
163+
timeouts = {
164+
delete = "20m"
165+
}
157166
}
158167
}
159168

modules/fargate/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ See example code in `examples/fargate`.
1515
| name | Fargate profile name | `string` | Auto generated in the following format `[cluster_name]-fargate-[fargate_profile_map_key]`| no |
1616
| selectors | A list of Kubernetes selectors. See examples/fargate/main.tf for example format. | <pre>list(map({<br>namespace = string<br>labels = map(string)<br>}))</pre>| `[]` | no |
1717
| subnets | List of subnet IDs. Will replace the root module subnets. | `list(string)` | `var.subnets` | no |
18+
| timeouts | A map of timeouts for create/delete operations. | `map(string)` | Provider default behavior | no |
1819
| tags | Key-value map of resource tags. Will be merged with root module tags. | `map(string)` | `var.tags` | no |
1920

2021
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

modules/fargate/main.tf

+5
Original file line numberDiff line numberDiff line change
@@ -63,5 +63,10 @@ resource "aws_eks_fargate_profile" "this" {
6363
}
6464
}
6565

66+
timeouts {
67+
create = try(each.value["timeouts"].create, null)
68+
delete = try(each.value["timeouts"].delete, null)
69+
}
70+
6671
tags = merge(var.tags, lookup(each.value, "tags", {}))
6772
}

0 commit comments

Comments
 (0)