Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add ability to define custom timeout for fargate profiles #1614

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions examples/complete/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,11 @@ module "eks" {
tags = {
Owner = "test"
}

timeouts = {
create = "20m"
delete = "20m"
}
}
}

Expand Down
9 changes: 9 additions & 0 deletions examples/fargate/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ module "eks" {
tags = {
Owner = "default"
}

timeouts = {
create = "20m"
delete = "20m"
}
}

secondary = {
Expand Down Expand Up @@ -154,6 +159,10 @@ module "fargate_profile_existing_cluster" {
Owner = "profile2"
submodule = "true"
}

timeouts = {
delete = "20m"
}
}
}

Expand Down
1 change: 1 addition & 0 deletions modules/fargate/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. | <pre>list(map({<br>namespace = string<br>labels = map(string)<br>}))</pre>| `[]` | 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 |
antonbabenko marked this conversation as resolved.
Show resolved Hide resolved
| tags | Key-value map of resource tags. Will be merged with root module tags. | `map(string)` | `var.tags` | no |

<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
Expand Down
5 changes: 5 additions & 0 deletions modules/fargate/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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", {}))
}