README.md

transit-gateway

Creates an AWS Transit Gateway in the network account with RAM-based cross-account sharing.

Provisions a TGW with configurable BGP ASN, route table association/propagation, DNS support, and ECMP for VPN. Creates additional custom route tables beyond the default, and shares the TGW to spoke accounts or OUs via AWS Resource Access Manager. Spoke accounts attach via the networking/tgw-attachment module.

Usage

module "tgw" {
  source  = "hcassc.jfrog.io/iac-terraform-modules-virtual/networking/transit-gateway/aws"
  version = "0.1.0"

  name           = "core-tgw"
  ram_share_name = "tgw-share"
  ram_principals = ["arn:aws:organizations::111122223333:organization/o-xxxx"]
}

Requirements

Name Version
terraform ~> 1.5
aws ~> 6.50

Providers

Name Version
aws 6.50.0

Resources

Name Type
aws_ec2_transit_gateway.this resource
aws_ec2_transit_gateway_route_table.this resource
aws_ram_principal_association.this resource
aws_ram_resource_association.this resource
aws_ram_resource_share.this resource

Inputs

Name Description Type Default Required
name Name for the Transit Gateway string n/a yes
amazon_side_asn BGP ASN for the Amazon side (64512–65534, or 4200000000–4294967294) number 64512 no
auto_accept_shared_attachments Auto-accept cross-account VPC attachments string "disable" no
default_route_table_association Associate attachments with the default route table string "enable" no
default_route_table_propagation Propagate routes to the default route table string "enable" no
description Description of the Transit Gateway string "" no
dns_support DNS support across VPC attachments string "enable" no
ram_principals List of AWS account IDs or org ARNs to share the TGW with via RAM list(string) [] no
ram_share_name Name for the RAM resource share (null to skip sharing) string null no
route_tables Map of additional TGW route tables to create (beyond the default) map(object({ name = string })) {} no
tags Resource tags to apply to all resources map(string) {} no
vpn_ecmp_support ECMP routing for VPN attachments string "enable" no

Outputs

Name Description
arn Transit Gateway ARN
default_route_table_id Default TGW route table ID
id Transit Gateway ID
ram_share_arn RAM resource share ARN (null if sharing not configured)
route_table_ids Map of additional route table logical key to ID