Last active
October 20, 2021 11:37
-
-
Save joakimhew/b6ceeb4587bc81a3f419f9c6fbd804ec to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module "eks" { | |
source = "terraform-aws-modules/eks/aws" | |
version = "v17.20.0" | |
cluster_name = "dev-cluster" | |
cluster_version = "1.20" | |
subnets = ["10.24.56.128/26", "10.24.56.192/27", "10.24.56.224/27"] | |
vpc_id = var.eks_vpc_id | |
cluster_endpoint_private_access = true // In this example, we only want to allow access to the Kubernetes API from within our enterprise network | |
cluster_create_endpoint_private_access_sg_rule = true | |
cluster_endpoint_private_access_cidrs = ["10.0.0.0/8"] // Your enterprise CIDR range that should be allowed access to the k8s API | |
node_groups_defaults = { | |
ami_type = "AL2_x86_64" | |
disk_size = 50 | |
} | |
// Here we're using a managed EKS node group | |
node_groups = { | |
example = { | |
desired_capacity = 2 | |
max_capacity = 2 | |
min_capacity = 2 | |
instance_types = ["t3.medium"] | |
update_config = { | |
max_unavailable_percentage = 50 # or set `max_unavailable` | |
} | |
} | |
} | |
depends_on = [ | |
aws_subnet.extra_az_1a, | |
aws_subnet.extra_az_1b, | |
aws_subnet.extra_az_1c, | |
aws_route_table_association.a, | |
aws_route_table_association.b, | |
aws_route_table_association.c, | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment