Terraform module to provision AWS Transit Gateway resources.
- Peering Attachment (https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ec2_transit_gateway_peering_attachmen)
- Peering Attachment Acceptor (https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ec2_transit_gateway_peering_attachment_accepter)
- VPC Attachment Acceptor (https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ec2_transit_gateway_vpc_attachment_accepter)
Terraform 0.13. Pin module to version to ~> v1.0
. Submit pull-requests to main
branch.
module "transit_gateway" {
source = "../.."
version = "~> 1.0.0"
vpc_attachments = {
vpc = {
vpc_id = module.vpc.vpc_id
subnet_ids = module.vpc.private_subnets
transit_gateway_routes = [
{
destination_cidr_block = "10.0.0.0/16"
}
]
}
}
transit_gateway_blackhole_routes = [
"0.0.0.0/0"
]
tags = {
Project = "test-tgw-terraform"
Environment = "test"
}
}
module "vpc" {
source = "terraform-aws-modules/vpc/aws"
version = "~> 2.0"
name = "vpc"
cidr = "10.0.0.0/16"
azs = ["eu-west-1a", "eu-west-1b", "eu-west-1c"]
private_subnets = ["10.0.1.0/24", "10.0.2.0/24", "10.0.3.0/24"]
enable_nat_gateway = false
tags = {
Environment = "test"
}
}
Module is to be used with Terraform > 0.13.
## Examples
Module managed by:
Name | Version |
---|---|
terraform | >= 0.13 |
aws | >= 3.11 |
Name | Version |
---|---|
aws | >= 3.11 |
Name | Description | Type | Default | Required |
---|---|---|---|---|
amazon_side_asn | The Autonomous System Number (ASN) for the Amazon side of the gateway. By default the TGW is created with the current default Amazon ASN. | string |
"64512" |
no |
description | Description of the Transit Gateway | string |
"" |
no |
enable_auto_accept_shared_attachments | Whether resource attachment requests are automatically accepted | bool |
false |
no |
enable_default_route_table_association | Whether resource attachments are automatically associated with the default association route table | bool |
true |
no |
enable_default_route_table_propagation | Whether resource attachments automatically propagate routes to the default propagation route table | bool |
true |
no |
enable_dns_support | Should be true to enable DNS support in the TGW | bool |
true |
no |
enable_vpn_ecmp_support | Whether VPN Equal Cost Multipath Protocol support is enabled | bool |
true |
no |
tags | A map of tags to add to all resources | map(string) |
{} |
no |
transit_gateway_blackhole_routes | Transit Gateway Blackhole Routes | list(string) |
[] |
no |
transit_gateway_route_table_id | Identifier of EC2 Transit Gateway Route Table to use with the Target Gateway when reusing it between multiple TGWs | string |
null |
no |
vpc_attachments | Maps of maps of VPC details to attach to TGW. | any |
{} |
no |
Name | Description |
---|---|
transit_gateway_arn | Transit Gateway Amazon Resource Name (ARN) |
transit_gateway_asn | The Private Autonomous System Number (ASN) of the Transit Gateway |
transit_gateway_association_default_route_table_id | Identifier of the default association route table id |
transit_gateway_attachments_ids | List of VPC Attachments identifiers |
transit_gateway_id | Transit Gateway Identifier |
transit_gateway_propagation_default_route_table_id | Identifier of the default propagation route table |
transit_gateway_route_table_arn | Transit Gateway Route Table ARN |
transit_gateway_route_table_association_ids | List of Transit Gateway Route Table identifiers combined with Transit Gateway Attachment identifiers |
transit_gateway_route_table_association_resource_ids | List of identifiers of the resources |
transit_gateway_route_table_association_resource_types | List of types of resources |
transit_gateway_route_table_id | Transit Gateway Route Table Identifier |
transit_gateway_route_table_propagation_ids | List of Transit Gateway Route Table identifiers combined with Transit Gateway Attachment identifiers |
transit_gateway_route_table_propagation_resource_ids | List of identifiers of the resources |
transit_gateway_route_table_propagation_resource_types | List of types of resources |
See LICENSE for full details.
pre-commit
terraform-docs
required forterraform_docs
hooks.TFLint
required forterraform_tflint
hook.
brew install pre-commit terraform-docs tflint
brew tap git-chglog/git-chglog
brew install git-chglog