Skip to content

JudeQuintana/terraform-aws-centralized-router

Repository files navigation

Transit Gateway Centralized Router Description

  • This Transit Gateway Centralized Router module will create a hub spoke topology from existing Tiered VPCs.
  • Will use the special public subnet in each AZ when a Tiered VPC is passed to it.
  • All attachments will be associated and routes propagated to one TGW Route Table.
  • Each Tiered VPC will have all their route tables updated in each VPC with a route to all other VPC networks via the TGW.
  • Will generate and add routes in each VPC to all other networks.

Example:

module "centralized_router" {
  source  = "JudeQuintana/centralized-router/aws"
  version = "1.0.0"

  env_prefix       = var.env_prefix
  region_az_labels = var.region_az_labels
  centralized_router = {
    name            = "bishop"
    amazon_side_asn = 64512
    blackhole_cidrs = ["172.16.8.0/24"]
    vpcs            = module.vpcs
  }
}

Networking Trifecta Demo

Blog Post: Terraform Networking Trifecta

Main:

Requirements

Name Version
terraform >=1.3
aws >=4.20

Providers

Name Version
aws >=4.20

Modules

Name Source Version
this_generate_routes_to_other_vpcs ./modules/generate_routes_to_other_vpcs n/a

Resources

Name Type
aws_ec2_transit_gateway.this resource
aws_ec2_transit_gateway_route.this_blackholes resource
aws_ec2_transit_gateway_route_table.this resource
aws_ec2_transit_gateway_route_table_association.this resource
aws_ec2_transit_gateway_route_table_propagation.this resource
aws_ec2_transit_gateway_vpc_attachment.this resource
aws_route.this_vpc_routes_to_other_vpcs resource
aws_caller_identity.this data source
aws_region.this data source

Inputs

Name Description Type Default Required
centralized_router Centralized Router configuration
object({
name = string
amazon_side_asn = number
blackhole_cidrs = optional(list(string), [])
vpcs = optional(map(object({
account_id = string
full_name = string
id = string
name = string
network_cidr = string
private_route_table_ids = list(string)
public_route_table_ids = list(string)
public_special_subnet_ids = list(string)
region = string
})), {})
})
n/a yes
env_prefix prod, stage, test string n/a yes
region_az_labels Region and AZ names mapped to short naming conventions for labeling map(string) n/a yes
tags Additional Tags map(string) {} no

Outputs

Name Description
account_id n/a
amazon_side_asn n/a
blackhole_cidrs n/a
full_name n/a
id n/a
name n/a
region n/a
route_table_id n/a
vpc n/a

About

Centralized Router

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages