Skip to content

Commit 917af3d

Browse files
authored
add vpc secondary cidrs associations (#17)
1 parent 8e68b28 commit 917af3d

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

network.tf

+6
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ resource "aws_vpc" "quortex" {
3232
# NOTE: The usage of the specific kubernetes.io/cluster/* resource tags below are required for EKS and Kubernetes to discover and manage networking resources.
3333
}
3434

35+
resource "aws_vpc_ipv4_cidr_block_association" "secondary" {
36+
for_each = var.vpc_secondary_cidrs
37+
vpc_id = aws_vpc.quortex.id
38+
cidr_block = each.value
39+
}
40+
3541
resource "aws_subnet" "quortex" {
3642
for_each = var.subnets
3743

variables.tf

+6
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ variable "vpc_name" {
2020
default = "quortex"
2121
}
2222

23+
variable "vpc_secondary_cidrs" {
24+
type = list(string)
25+
description = "IPv4 secondary CIDRs to add to the VPC."
26+
default = []
27+
}
28+
2329
variable "cluster_name" {
2430
type = string
2531
description = "The name of the EKS cluster. Will be used to set the kubernetes.io/cluster/<cluster-name> tag on the VPC and subnets. It is required for Kubernetes to discover them."

0 commit comments

Comments
 (0)