Skip to content

Commit

Permalink
feat: Add ability to define custom timeout for create/delete operatio…
Browse files Browse the repository at this point in the history
…ns for fargate profiles
  • Loading branch information
Ivan Dechovski committed Oct 12, 2021
1 parent 306ad72 commit 446ddb7
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
6 changes: 6 additions & 0 deletions examples/complete/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,12 @@ module "eks" {
tags = {
Owner = "test"
}

# Set custom timeout for create/delete operation on fargate profiles
timeouts = {
create = "20m"
delete = "20m"
}
}
}

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

# Set custom timeout for create/delete operation on fargate profiles
timeouts = {
create = "20m"
delete = "20m"
}
}

secondary = {
Expand All @@ -89,6 +95,12 @@ module "eks" {
tags = {
Owner = "secondary"
}

# Set custom timeout for create/delete operation on fargate profiles
timeouts = {
create = "20m"
delete = "20m"
}
}
}

Expand Down Expand Up @@ -154,6 +166,12 @@ module "fargate_profile_existing_cluster" {
Owner = "profile2"
submodule = "true"
}

# Set custom timeout for create/delete operation on fargate profiles
timeouts = {
create = "20m"
delete = "20m"
}
}
}

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 = contains(keys(each.value), "timeouts") ? lookup(each.value["timeouts"], "create", null) : null
delete = contains(keys(each.value), "timeouts") ? lookup(each.value["timeouts"], "delete", null) : null
}

tags = merge(var.tags, lookup(each.value, "tags", {}))
}

0 comments on commit 446ddb7

Please sign in to comment.