| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172 |
- variable "name" {
- description = "Base name used for created resources."
- type = string
- }
- variable "region" {
- description = "AWS region for informational outputs and examples."
- type = string
- }
- variable "kubernetes_version" {
- description = "EKS Kubernetes version."
- type = string
- default = "1.35"
- }
- variable "vpc_cidr" {
- description = "CIDR block for the new VPC."
- type = string
- default = "10.0.0.0/16"
- }
- variable "create_vpc" {
- description = "Whether to create a new VPC and subnets. Set to false to use existing networking."
- type = bool
- default = true
- }
- variable "existing_vpc_id" {
- description = "Existing VPC ID to use when create_vpc is false."
- type = string
- default = null
- nullable = true
- validation {
- condition = var.create_vpc || var.existing_vpc_id != null
- error_message = "existing_vpc_id must be set when create_vpc is false."
- }
- }
- variable "existing_public_subnet_ids" {
- description = "Existing public subnet IDs to use when create_vpc is false."
- type = list(string)
- default = []
- }
- variable "existing_private_subnet_ids" {
- description = "Existing private subnet IDs to use when create_vpc is false."
- type = list(string)
- default = []
- validation {
- condition = var.create_vpc || length(var.existing_private_subnet_ids) >= 2
- error_message = "At least two existing_private_subnet_ids must be provided when create_vpc is false."
- }
- }
- variable "availability_zone_count" {
- description = "How many availability zones to spread the cluster across."
- type = number
- default = 2
- validation {
- condition = var.availability_zone_count >= 2
- error_message = "availability_zone_count must be at least 2."
- }
- }
- variable "single_nat_gateway" {
- description = "Whether to create one shared NAT gateway instead of one per private subnet AZ."
- type = bool
- default = true
- }
- variable "cluster_endpoint_public_access" {
- description = "Whether the EKS API server endpoint is publicly accessible."
- type = bool
- default = true
- }
- variable "cluster_endpoint_private_access" {
- description = "Whether the EKS API server endpoint is privately accessible."
- type = bool
- default = true
- }
- variable "cluster_public_access_cidrs" {
- description = "CIDR ranges allowed to access the public EKS API endpoint."
- type = list(string)
- default = ["0.0.0.0/0"]
- }
- variable "node_instance_types" {
- description = "EC2 instance types for the managed node group."
- type = list(string)
- default = ["t3.medium"]
- }
- variable "node_capacity_type" {
- description = "Capacity type for the managed node group."
- type = string
- default = "ON_DEMAND"
- validation {
- condition = contains(["ON_DEMAND", "SPOT"], var.node_capacity_type)
- error_message = "node_capacity_type must be ON_DEMAND or SPOT."
- }
- }
- variable "node_disk_size" {
- description = "Disk size in GiB for worker nodes."
- type = number
- default = 20
- }
- variable "node_desired_size" {
- description = "Desired node count for the managed node group."
- type = number
- default = 2
- }
- variable "node_min_size" {
- description = "Minimum node count for the managed node group."
- type = number
- default = 2
- }
- variable "node_max_size" {
- description = "Maximum node count for the managed node group."
- type = number
- default = 4
- }
- variable "tags" {
- description = "Additional tags to apply to all supported resources."
- type = map(string)
- default = {}
- }
- variable "cluster_admin_principal_arns" {
- description = "Additional IAM principal ARNs to grant EKS cluster-admin access."
- type = list(string)
- default = []
- }
- variable "coredns_addon_version" {
- description = "Optional explicit version for the CoreDNS EKS addon."
- type = string
- default = null
- nullable = true
- }
- variable "kube_proxy_addon_version" {
- description = "Optional explicit version for the kube-proxy EKS addon."
- type = string
- default = null
- nullable = true
- }
- variable "vpc_cni_addon_version" {
- description = "Optional explicit version for the VPC CNI EKS addon."
- type = string
- default = null
- nullable = true
- }
- variable "pod_identity_agent_addon_version" {
- description = "Optional explicit version for the EKS Pod Identity Agent addon."
- type = string
- default = null
- nullable = true
- }
|