|
|
1 сар өмнө | |
|---|---|---|
| examples | 1 сар өмнө | |
| .gitignore | 1 сар өмнө | |
| .terraform.lock.hcl | 1 сар өмнө | |
| README.md | 1 сар өмнө | |
| eks.tf | 1 сар өмнө | |
| iam.tf | 1 сар өмнө | |
| locals.tf | 1 сар өмнө | |
| networking.tf | 1 сар өмнө | |
| outputs.tf | 1 сар өмнө | |
| variables.tf | 1 сар өмнө | |
| versions.tf | 1 сар өмнө | |
| vpc.tf | 1 сар өмнө |
This module creates a new AWS VPC and deploys an Amazon EKS cluster with a single managed node group into private subnets.
It can also reuse an existing VPC and existing private/public subnets instead of creating new networking.
provider "aws" {
region = "us-east-1"
}
module "eks" {
source = "./tfmods"
name = "demo-eks"
region = "us-east-1"
kubernetes_version = "1.35"
availability_zone_count = 2
node_instance_types = ["t3.large"]
node_desired_size = 2
node_min_size = 2
node_max_size = 4
cluster_admin_principal_arns = [
"arn:aws:iam::123456789012:role/platform-admin",
"arn:aws:iam::123456789012:user/cluster-operator",
]
tags = {
Project = "platform"
Owner = "infra"
}
}
To use existing networking instead of creating a new VPC:
module "eks" {
source = "./tfmods"
name = "demo-eks"
region = "us-east-1"
create_vpc = false
existing_vpc_id = "vpc-0123456789abcdef0"
existing_private_subnet_ids = ["subnet-aaa", "subnet-bbb"]
existing_public_subnet_ids = ["subnet-ccc", "subnet-ddd"]
}
After terraform apply, configure kubectl with:
aws eks update-kubeconfig --region us-east-1 --name demo-eks
create_vpc = false, the module skips all VPC, subnet, NAT, IGW, and route table creation and uses the supplied subnet IDs instead.cluster_public_access_cidrs in real environments.AmazonEKSClusterAdminPolicy at cluster scope.eks-pod-identity-agent.