Skip to content

Commit

Permalink
add IPv6 capability for ingress traffic
Browse files Browse the repository at this point in the history
  • Loading branch information
briskt committed Nov 27, 2024
1 parent edb4013 commit 0530be8
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 9 deletions.
2 changes: 2 additions & 0 deletions terraform/010-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ ssl certificate, core application load balancer, and a CloudWatch log group
## Optional Inputs

- `create_nat_gateway` - default `true`
- `disable_public_ipv4` - Set to true to remove the public IPv4 addresses from the ALB. Requires enable_ipv6 = true.
- `enable_ipv6` - Set to true to enable IPv6 in the ALB and VPC
- `private_subnet_cidr_blocks`
- `public_subnet_cidr_blocks`
- `vpc_cidr_block`
Expand Down
21 changes: 12 additions & 9 deletions terraform/010-cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ module "vpc" {
app_env = var.app_env
aws_zones = var.aws_zones
create_nat_gateway = var.create_nat_gateway
enable_ipv6 = var.enable_ipv6
private_subnet_cidr_blocks = var.private_subnet_cidr_blocks
public_subnet_cidr_blocks = var.public_subnet_cidr_blocks
vpc_cidr_block = var.vpc_cidr_block
Expand Down Expand Up @@ -68,15 +69,17 @@ data "aws_acm_certificate" "wildcard" {
*/
module "alb" {
source = "silinternational/alb/aws"
version = "~> 1.0"

app_name = var.app_name
app_env = var.app_env
internal = "false"
vpc_id = module.vpc.id
security_groups = [module.vpc.vpc_default_sg_id, module.cloudflare-sg.id]
subnets = module.vpc.public_subnet_ids
certificate_arn = data.aws_acm_certificate.wildcard.arn
version = "~> 1.1"

app_name = var.app_name
app_env = var.app_env
enable_ipv6 = var.enable_ipv6
disable_public_ipv4 = var.disable_public_ipv4
internal = "false"
vpc_id = module.vpc.id
security_groups = [module.vpc.vpc_default_sg_id, module.cloudflare-sg.id]
subnets = module.vpc.public_subnet_ids
certificate_arn = data.aws_acm_certificate.wildcard.arn
}

/*
Expand Down
12 changes: 12 additions & 0 deletions terraform/010-cluster/vars.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,18 @@ variable "create_nat_gateway" {
default = true
}

variable "disable_public_ipv4" {
description = "Set to true to remove the public IPv4 addresses from the ALB. Requires enable_ipv6 = true"
type = bool
default = false
}

variable "enable_ipv6" {
description = "Set to true to enable IPV6 in the ALB and VPC"
type = bool
default = false
}

variable "use_transit_gateway" {
description = "Set to true to attach a transit gateway to this VPC and route traffic to it. Use in conjunction with transit_gateway_id and create_nat_gateway=false."
type = bool
Expand Down

0 comments on commit 0530be8

Please sign in to comment.