Skip to content

Repo provides module to create transit gateway(s), handle attachments and routes

License

Notifications You must be signed in to change notification settings

defenseunicorns/terraform-aws-transit-gateway

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

terraform-aws-transit-gateway

Repo provides module to create (or not, if already existing) transit gateway(s), handle attachments, and routes, and more

Requirements

Name Version
terraform >= 1.3
aws >= 5.30.0
random >= 3.0.0

Providers

Name Version
aws >= 5.30.0
random >= 3.0.0

Modules

Name Source Version
subnet_route ./modules/subnet_route n/a
transit_gateway_route ./modules/transit_gateway_route n/a

Resources

Name Type
aws_ec2_transit_gateway.this 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
random_id.this resource
aws_ec2_transit_gateway.this data source
aws_vpc.this data source

Inputs

Name Description Type Default Required
auto_accept_shared_attachments Whether resource attachment requests are automatically accepted. Valid values: disable, enable. Default value: disable string "disable" no
config Configuration for VPC attachments, Transit Gateway routes, and subnet routes
map(object({
vpc_name = string
vpc_id = string
vpc_cidr = string
subnet_ids = set(string)
subnet_route_table_ids = set(string)
route_to = set(string)
route_to_cidr_blocks = set(string)
transit_gateway_vpc_attachment_id = string
transit_gateway_vpc_attachment_name_tag = string
static_routes = set(object({
blackhole = bool
destination_cidr_block = string
route_transit_gateway_attachment_id = string
}))
}))
null no
create_transit_gateway Whether to create a Transit Gateway. If set to false, an existing Transit Gateway ID must be provided in the variable existing_transit_gateway_id bool true no
create_transit_gateway_propagation Whether to enable Transit Gateway propagation on the specified route table and attachment bool true no
create_transit_gateway_route_table Whether to create a Transit Gateway Route Table. If set to false, an existing Transit Gateway Route Table ID must be provided in the variable existing_transit_gateway_route_table_id bool true no
create_transit_gateway_route_table_association Whether to create Transit Gateway Route Table association bool true no
create_transit_gateway_vpc_attachment Whether to create Transit Gateway VPC Attachments bool true no
default_route_table_association Whether resource attachments are automatically associated with the default association route table. Valid values: disable, enable. Default value: enable string "disable" no
default_route_table_propagation Whether resource attachments automatically propagate routes to the default propagation route table. Valid values: disable, enable. Default value: disable string "disable" no
dns_support Whether resource attachments automatically propagate routes to the default propagation route table. Valid values: disable, enable. Default value: enable string "enable" no
existing_transit_gateway_id Existing Transit Gateway ID. If provided, the module will not create a Transit Gateway but instead will use the existing one string null no
existing_transit_gateway_route_table_id Existing Transit Gateway Route Table ID. If provided, the module will not create a Transit Gateway Route Table but instead will use the existing one string null no
route_keys_enabled If true, Terraform will use keys to label routes, preventing unnecessary changes,
but this requires that the VPCs and subnets already exist before using this module.
If false, Terraform will use numbers to label routes, and a single change may
cascade to a long list of changes because the index or order has changed, but
this will work when the true setting generates the error The "for_each" value depends on resource attributes...
bool false no
tags A map of tags to apply to all resources map(string) {} no
transit_gateway_cidr_blocks The list of associated CIDR blocks. It can contain up to 1 IPv4 CIDR block
of size up to /24 and up to one IPv6 CIDR block of size up to /64. The IPv4
block must not be from range 169.254.0.0/16.
list(string) null no
transit_gateway_description Transit Gateway description. If not provided, one will be automatically generated. string "" no
transit_gateway_name The name of the Transit Gateway string "" no
transit_gateway_route_table_name The name of the Transit Gateway Route Table string "" no
use_existing_transit_gateway Whether to use an existing Transit Gateway. If set to true, an existing Transit Gateway ID must be provided in the variable existing_transit_gateway_id bool false no
vpc_attachment_appliance_mode_support Whether Appliance Mode support is enabled. If enabled, a traffic flow between a source and destination uses the same Availability Zone for the VPC attachment for the lifetime of that flow. Valid values: disable, enable string "disable" no
vpc_attachment_dns_support Whether resource attachments automatically propagate routes to the default propagation route table. Valid values: disable, enable. Default value: enable string "enable" no
vpc_attachment_ipv6_support Whether resource attachments automatically propagate routes to the default propagation route table. Valid values: disable, enable. Default value: disable string "disable" no
vpn_ecmp_support Whether resource attachments automatically propagate routes to the default propagation route table. Valid values: disable, enable. Default value: enable string "enable" no

Outputs

Name Description
destination_cidr_blocks Destination CIDR blocks
route_config_list Route configuration list
route_config_map Route configuration map
subnet_route_ids Subnet route identifiers combined with destinations
transit_gateway_arn Transit Gateway ARN
transit_gateway_association_default_route_table_id Transit Gateway association default route table ID
transit_gateway_id Transit Gateway ID
transit_gateway_propagation_default_route_table_id Transit Gateway propagation default route table ID
transit_gateway_route_config Transit Gateway route configuration
transit_gateway_route_ids Transit Gateway route identifiers combined with destinations
transit_gateway_route_table_id Transit Gateway route table ID
transit_gateway_vpc_attachment_ids Transit Gateway VPC attachment IDs

About

Repo provides module to create transit gateway(s), handle attachments and routes

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •