diff --git a/cluster/README.md b/cluster/README.md index 0a0bddf..e87d2fb 100644 --- a/cluster/README.md +++ b/cluster/README.md @@ -66,6 +66,9 @@ | [environment](#input\_environment) | Environment name | `string` | `"dev"` | no | | [instance\_capacity\_type](#input\_instance\_capacity\_type) | Capacity type used by EKS managed node groups | `string` | `"SPOT"` | no | | [instance\_types](#input\_instance\_types) | List of instance types used by EKS managed node groups | `list(any)` |
[| no | +| [vpc\_cidr](#input\_vpc\_cidr) | VPC CIDR | `string` | `"10.0.0.0/16"` | no | +| [vpc\_private\_subnet\_cidr](#input\_vpc\_private\_subnet\_cidr) | List of private subnet configurations | `list(any)` |
"m5.large",
"m5d.large",
"m5a.large",
"m5ad.large",
"m4.large"
]
[| no | +| [vpc\_public\_subnet\_cidr](#input\_vpc\_public\_subnet\_cidr) | List of public subnet configurations | `list(any)` |
"10.0.0.0/19",
"10.0.32.0/19",
"10.0.64.0/19"
]
[| no | | [worker\_node\_size](#input\_worker\_node\_size) | Node size of the worker node group | `map(number)` |
"10.0.96.0/19",
"10.0.128.0/19",
"10.0.160.0/19"
]
{| no | ## Outputs diff --git a/cluster/variables.tf b/cluster/variables.tf index 0666bb6..0cd3dc9 100644 --- a/cluster/variables.tf +++ b/cluster/variables.tf @@ -116,6 +116,32 @@ variable "dmz_node_size" { } } +variable "vpc_cidr" { + type = string + description = "VPC CIDR" + default = "10.0.0.0/16" +} + +variable "vpc_private_subnet_cidr" { + description = "List of private subnet configurations" + type = list(any) + default = [ + "10.0.0.0/19", + "10.0.32.0/19", + "10.0.64.0/19", + ] +} + +variable "vpc_public_subnet_cidr" { + description = "List of public subnet configurations" + type = list(any) + default = [ + "10.0.96.0/19", + "10.0.128.0/19", + "10.0.160.0/19", + ] +} + variable "default_storage_class" { type = string description = "Default storage class used for describing the EBS usage" diff --git a/cluster/vpc.tf b/cluster/vpc.tf index 9a605c9..664dc14 100644 --- a/cluster/vpc.tf +++ b/cluster/vpc.tf @@ -3,7 +3,7 @@ module "vpc" { version = "~> 5.0" name = "${var.eks_cluster_name}-vpc" - cidr = "10.0.0.0/16" + cidr = var.vpc_cidr azs = [ "${var.AWS_REGION}a", @@ -11,17 +11,8 @@ module "vpc" { "${var.AWS_REGION}c", ] - private_subnets = [ - "10.0.0.0/19", - "10.0.32.0/19", - "10.0.64.0/19", - ] - - public_subnets = [ - "10.0.96.0/19", - "10.0.128.0/19", - "10.0.160.0/19", - ] + private_subnets = var.vpc_private_subnet_cidr + public_subnets = var.vpc_public_subnet_cidr public_subnet_tags = { "kubernetes.io/role/elb" = "1"
"desired": 2,
"max": 10,
"min": 0
}