Skip to content

Commit

Permalink
Add ability to route to transit gateway instead of NAT gateway.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dave Barnum authored and Dave Barnum committed Nov 28, 2023
1 parent dcb51a3 commit 6f723c3
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 8 deletions.
20 changes: 12 additions & 8 deletions terraform/010-cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,18 @@
* Create VPC
*/
module "vpc" {
source = "github.com/silinternational/terraform-modules//aws/vpc?ref=8.6.0"
app_name = var.app_name
app_env = var.app_env
aws_zones = var.aws_zones
create_nat_gateway = var.create_nat_gateway
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
source = "github.com/silinternational/terraform-modules//aws/vpc?ref=8.6.0"
app_name = var.app_name
app_env = var.app_env
aws_zones = var.aws_zones
create_nat_gateway = var.create_nat_gateway
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
create_transit_gateway_attachment = var.create_transit_gateway_attachment
transit_gateway_id = var.transit_gateway_id
transit_gateway_default_route_table_association = var.transit_gateway_default_route_table_association
transit_gateway_default_route_table_propagation = var.transit_gateway_default_route_table_propagation
}

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

variable "create_transit_gateway_attachment" {
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
default = false
}

variable "ecs_cluster_name" {
type = string
}
Expand Down Expand Up @@ -68,6 +74,24 @@ variable "tags" {
default = {}
}

variable "transit_gateway_id" {
description = "The ID of the transit gateway to attach to when using create_transit_gateway_attachment."
type = string
default = ""
}

variable "transit_gateway_default_route_table_association" {
description = "Whether or not to associate with the default route table of the transit gateway."
type = bool
default = true
}

variable "transit_gateway_default_route_table_propagation" {
description = "Whether or not to send propigation of this route to the default route table of the transit gateway."
type = bool
default = true
}

variable "vpc_cidr_block" {
description = "The block of IP addresses (as a CIDR) the VPC should use"
type = string
Expand Down

0 comments on commit 6f723c3

Please sign in to comment.