feat: Allow the overwrite of subnets for Fargate profiles (#1117)

NOTES: The EKS cluster can be provisioned with both private and public subnets. But Fargate only accepts private ones. This new variable allows to override the subnets to explicitly pass the private subnets to Fargate and work around that issue.
This commit is contained in:
Jonas Chevalier
2021-01-28 21:46:53 +00:00
committed by GitHub
parent 65777d0a37
commit 576aa293f5
3 changed files with 5 additions and 1 deletions

View File

@@ -100,6 +100,9 @@ module "eks" {
# GithubOrg = "terraform-aws-modules"
# }
# using specific subnets instead of all the ones configured in eks
# subnets = ["subnet-0ca3e3d1234a56c78"]
tags = {
Owner = "test"
}

View File

@@ -14,6 +14,7 @@ Helper submodule to create and manage resources related to `aws_eks_fargate_prof
| namespace | Kubernetes namespace for selection | `string` | n/a | yes |
| labels | Key-value map of Kubernetes labels for selection | `map(string)` | `{}` | no |
| tags | Key-value map of resource tags. Will be merged with root module tags. | `map(string)` | `var.tags` | no |
| subnets | List of subnet IDs. Will replace the root module subnets. | `list(string)` | `var.subnets` | no |
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
## Requirements

View File

@@ -18,7 +18,7 @@ resource "aws_eks_fargate_profile" "this" {
cluster_name = var.cluster_name
fargate_profile_name = lookup(each.value, "name", format("%s-fargate-%s", var.cluster_name, replace(each.key, "_", "-")))
pod_execution_role_arn = local.pod_execution_role_arn
subnet_ids = var.subnets
subnet_ids = lookup(each.value, "subnets", var.subnets)
tags = each.value.tags
selector {
namespace = each.value.namespace