mirror of
https://github.com/ysoftdevs/terraform-aws-eks.git
synced 2026-01-16 08:37:18 +01:00
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:
@@ -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"
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user