• Stars
    star
    141
  • Rank 259,971 (Top 6 %)
  • Language HCL
  • License
    Apache License 2.0
  • Created almost 5 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Terraform module to create AWS Transit Gateway resources ๐Ÿ‡บ๐Ÿ‡ฆ

AWS Transit Gateway Terraform module

Terraform module which creates Transit Gateway resources on AWS.

Usage with VPC module

module "tgw" {
  source  = "terraform-aws-modules/transit-gateway/aws"
  version = "~> 2.0"

  name        = "my-tgw"
  description = "My TGW shared with several other AWS accounts"

  enable_auto_accept_shared_attachments = true

  vpc_attachments = {
    vpc = {
      vpc_id       = module.vpc.vpc_id
      subnet_ids   = module.vpc.private_subnets
      dns_support  = true
      ipv6_support = true

      tgw_routes = [
        {
          destination_cidr_block = "30.0.0.0/16"
        },
        {
          blackhole = true
          destination_cidr_block = "40.0.0.0/20"
        }
      ]
    }
  }

  ram_allow_external_principals = true
  ram_principals = [307990089504]

  tags = {
    Purpose = "tgw-complete-example"
  }
}

module "vpc" {
  source  = "terraform-aws-modules/vpc/aws"
  version = "~> 3.0"

  name = "my-vpc"

  cidr = "10.10.0.0/16"

  azs             = ["eu-west-1a", "eu-west-1b", "eu-west-1c"]
  private_subnets = ["10.10.1.0/24", "10.10.2.0/24", "10.10.3.0/24"]

  enable_ipv6                                    = true
  private_subnet_assign_ipv6_address_on_creation = true
  private_subnet_ipv6_prefixes                   = [0, 1, 2]
}

Examples

Requirements

Name Version
terraform >= 0.13.1
aws >= 4.4

Providers

Name Version
aws >= 4.4

Modules

No modules.

Resources

Name Type
aws_ec2_tag.this resource
aws_ec2_transit_gateway.this resource
aws_ec2_transit_gateway_route.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
aws_ram_principal_association.this resource
aws_ram_resource_association.this resource
aws_ram_resource_share.this resource
aws_ram_resource_share_accepter.this resource
aws_route.this resource

Inputs

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 null no
create_tgw Controls if TGW should be created (it affects almost all resources) bool true no
description Description of the EC2 Transit Gateway string null 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_multicast_support Whether multicast support is enabled bool false no
enable_vpn_ecmp_support Whether VPN Equal Cost Multipath Protocol support is enabled bool true no
name Name to be used on all the resources as identifier string "" no
ram_allow_external_principals Indicates whether principals outside your organization can be associated with a resource share. bool false no
ram_name The name of the resource share of TGW string "" no
ram_principals A list of principals to share TGW with. Possible values are an AWS account ID, an AWS Organizations Organization ARN, or an AWS Organizations Organization Unit ARN list(string) [] no
ram_resource_share_arn ARN of RAM resource share string "" no
ram_tags Additional tags for the RAM map(string) {} no
share_tgw Whether to share your transit gateway with other accounts bool true no
tags A map of tags to add to all resources map(string) {} no
tgw_default_route_table_tags Additional tags for the Default TGW route table map(string) {} no
tgw_route_table_tags Additional tags for the TGW route table map(string) {} no
tgw_tags Additional tags for the TGW map(string) {} no
tgw_vpc_attachment_tags Additional tags for VPC attachments map(string) {} no
timeouts Create, update, and delete timeout configurations for the transit gateway map(string) {} no
transit_gateway_cidr_blocks One or more IPv4 or IPv6 CIDR blocks for the transit gateway. Must be a size /24 CIDR block or larger for IPv4, or a size /64 CIDR block or larger for IPv6 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. Type 'any' to disable type validation by Terraform. any {} no

Outputs

Name Description
ec2_transit_gateway_arn EC2 Transit Gateway Amazon Resource Name (ARN)
ec2_transit_gateway_association_default_route_table_id Identifier of the default association route table
ec2_transit_gateway_id EC2 Transit Gateway identifier
ec2_transit_gateway_owner_id Identifier of the AWS account that owns the EC2 Transit Gateway
ec2_transit_gateway_propagation_default_route_table_id Identifier of the default propagation route table
ec2_transit_gateway_route_ids List of EC2 Transit Gateway Route Table identifier combined with destination
ec2_transit_gateway_route_table_association Map of EC2 Transit Gateway Route Table Association attributes
ec2_transit_gateway_route_table_association_ids List of EC2 Transit Gateway Route Table Association identifiers
ec2_transit_gateway_route_table_default_association_route_table Boolean whether this is the default association route table for the EC2 Transit Gateway
ec2_transit_gateway_route_table_default_propagation_route_table Boolean whether this is the default propagation route table for the EC2 Transit Gateway
ec2_transit_gateway_route_table_id EC2 Transit Gateway Route Table identifier
ec2_transit_gateway_route_table_propagation Map of EC2 Transit Gateway Route Table Propagation attributes
ec2_transit_gateway_route_table_propagation_ids List of EC2 Transit Gateway Route Table Propagation identifiers
ec2_transit_gateway_vpc_attachment Map of EC2 Transit Gateway VPC Attachment attributes
ec2_transit_gateway_vpc_attachment_ids List of EC2 Transit Gateway VPC Attachment identifiers
ram_principal_association_id The Amazon Resource Name (ARN) of the Resource Share and the principal, separated by a comma
ram_resource_share_id The Amazon Resource Name (ARN) of the resource share

Authors

Module is maintained by Anton Babenko with help from these awesome contributors.

License

Apache 2 Licensed. See LICENSE for full details.

More Repositories

1

terraform-aws-eks

Terraform module to create Amazon Elastic Kubernetes (EKS) resources ๐Ÿ‡บ๐Ÿ‡ฆ
HCL
4,372
star
2

terraform-aws-vpc

Terraform module to create AWS VPC resources ๐Ÿ‡บ๐Ÿ‡ฆ
HCL
2,949
star
3

terraform-aws-lambda

Terraform module, which takes care of a lot of AWS Lambda/serverless tasks (build dependencies, packages, updates, deployments) in countless combinations ๐Ÿ‡บ๐Ÿ‡ฆ
HCL
899
star
4

terraform-aws-rds

Terraform module to create AWS RDS resources ๐Ÿ‡บ๐Ÿ‡ฆ
HCL
879
star
5

terraform-aws-iam

Terraform module to create AWS IAM resources ๐Ÿ‡บ๐Ÿ‡ฆ
HCL
779
star
6

terraform-aws-ec2-instance

Terraform module to create AWS EC2 instance(s) resources ๐Ÿ‡บ๐Ÿ‡ฆ
HCL
751
star
7

terraform-aws-security-group

Terraform module to create AWS Security Group resources ๐Ÿ‡บ๐Ÿ‡ฆ
HCL
563
star
8

terraform-aws-ecs

Terraform module to create AWS ECS resources ๐Ÿ‡บ๐Ÿ‡ฆ
HCL
555
star
9

terraform-aws-atlantis

Terraform module to deploy Atlantis on AWS Fargate ๐Ÿ‡บ๐Ÿ‡ฆ
HCL
519
star
10

terraform-aws-s3-bucket

Terraform module to create AWS S3 resources ๐Ÿ‡บ๐Ÿ‡ฆ
HCL
511
star
11

terraform-aws-notify-slack

Terraform module to create AWS resources for sending notifications to Slack ๐Ÿ‡บ๐Ÿ‡ฆ
Python
466
star
12

terraform-aws-alb

Terraform module to create AWS Application/Network Load Balancer (ALB/NLB) resources ๐Ÿ‡บ๐Ÿ‡ฆ
HCL
433
star
13

terraform-aws-rds-aurora

Terraform module to create AWS RDS Aurora resources ๐Ÿ‡บ๐Ÿ‡ฆ
HCL
384
star
14

terraform-aws-autoscaling

Terraform module to create AWS Auto Scaling resources ๐Ÿ‡บ๐Ÿ‡ฆ
HCL
292
star
15

terraform-aws-pricing

Terraform module which calculates price of AWS infrastructure (from Terraform state and plan) ๐Ÿ‡บ๐Ÿ‡ฆ
HCL
183
star
16

terraform-aws-acm

Terraform module to create AWS ACM resources ๐Ÿ‡บ๐Ÿ‡ฆ
HCL
182
star
17

terraform-aws-cloudwatch

Terraform module to create AWS Cloudwatch resources ๐Ÿ‡บ๐Ÿ‡ฆ
HCL
163
star
18

terraform-aws-elb

Terraform module to create AWS ELB resources ๐Ÿ‡บ๐Ÿ‡ฆ
HCL
148
star
19

terraform-aws-apigateway-v2

Terraform module to create AWS API Gateway v2 (HTTP/WebSocket) ๐Ÿ‡บ๐Ÿ‡ฆ
HCL
146
star
20

terraform-aws-eventbridge

Terraform module to create AWS EventBridge resources ๐Ÿ‡บ๐Ÿ‡ฆ
HCL
142
star
21

terraform-aws-route53

Terraform module to create AWS Route53 resources ๐Ÿ‡บ๐Ÿ‡ฆ
HCL
126
star
22

terraform-aws-cloudfront

Terraform module to create AWS CloudFront resources ๐Ÿ‡บ๐Ÿ‡ฆ
HCL
119
star
23

terraform-aws-vpn-gateway

Terraform module to create AWS VPN gateway resources ๐Ÿ‡บ๐Ÿ‡ฆ
HCL
111
star
24

terraform-aws-dynamodb-table

Terraform module to create AWS DynamoDB resources ๐Ÿ‡บ๐Ÿ‡ฆ
HCL
100
star
25

terraform-aws-sns

Terraform module to create AWS SNS resources ๐Ÿ‡บ๐Ÿ‡ฆ
HCL
95
star
26

terraform-aws-sqs

Terraform module to create AWS SQS resources ๐Ÿ‡บ๐Ÿ‡ฆ
HCL
92
star
27

terraform-aws-key-pair

Terraform module to create AWS EC2 key pair resources ๐Ÿ‡บ๐Ÿ‡ฆ
HCL
83
star
28

terraform-aws-redshift

Terraform module to create AWS Redshift resources ๐Ÿ‡บ๐Ÿ‡ฆ
HCL
81
star
29

meta

Meta-configurations for repositories, teams, files in terraform-aws-modules organization ๐Ÿ‡บ๐Ÿ‡ฆ
HCL
76
star
30

terraform-aws-solutions

Set of standalone and reusable AWS/DevOps solutions implemented as Terraform modules ๐Ÿ‡บ๐Ÿ‡ฆ
HCL
75
star
31

terraform-aws-step-functions

Terraform module to create AWS Step Functions ๐Ÿ‡บ๐Ÿ‡ฆ
HCL
70
star
32

terraform-aws-dms

Terraform module to create AWS DMS (Database Migration Service) resources ๐Ÿ‡บ๐Ÿ‡ฆ
HCL
62
star
33

terraform-aws-rds-proxy

Terraform module to create AWS RDS Proxy resources ๐Ÿ‡บ๐Ÿ‡ฆ
HCL
56
star
34

terraform-aws-msk-kafka-cluster

Terraform module to create AWS MSK (Managed Streaming for Kafka) resources ๐Ÿ‡บ๐Ÿ‡ฆ
HCL
55
star
35

terraform-aws-datadog-forwarders

Terraform module to create resources on AWS to forward logs/metrics to Datadog ๐Ÿ‡บ๐Ÿ‡ฆ
HCL
53
star
36

terraform-aws-eks-pod-identity

Terraform module to create AWS EKS Pod Identity resources ๐Ÿ‡บ๐Ÿ‡ฆ
HCL
52
star
37

terraform-aws-appsync

Terraform module to create AWS AWS AppSync resources ๐Ÿ‡บ๐Ÿ‡ฆ
HCL
50
star
38

terraform-aws-kms

Terraform module to create AWS KMS resources ๐Ÿ‡บ๐Ÿ‡ฆ
HCL
49
star
39

terraform-aws-ecr

Terraform module to create AWS ECR resources ๐Ÿ‡บ๐Ÿ‡ฆ
HCL
49
star
40

terraform-aws-managed-service-grafana

Terraform module to create AWS Managed Service for Grafana (AMG) resources ๐Ÿ‡บ๐Ÿ‡ฆ
HCL
36
star
41

terraform-aws-batch

Terraform module to create AWS Batch resources ๐Ÿ‡บ๐Ÿ‡ฆ
HCL
35
star
42

terraform-aws-app-runner

Terraform module to create AWS App Runner resources ๐Ÿ‡บ๐Ÿ‡ฆ
HCL
32
star
43

terraform-aws-secrets-manager

Terraform module to create AWS Secrets Manager resources ๐Ÿ‡บ๐Ÿ‡ฆ
HCL
28
star
44

terraform-aws-appconfig

Terraform module to create AWS AppConfig resources ๐Ÿ‡บ๐Ÿ‡ฆ
HCL
27
star
45

terraform-aws-managed-service-prometheus

Terraform module to create AWS Managed Service for Prometheus (AMP) resources ๐Ÿ‡บ๐Ÿ‡ฆ
HCL
26
star
46

terraform-aws-efs

Terraform module to create AWS EFS resources ๐Ÿ‡บ๐Ÿ‡ฆ
HCL
24
star
47

terraform-aws-emr

Terraform module to create AWS EMR resources ๐Ÿ‡บ๐Ÿ‡ฆ
HCL
23
star
48

.github

Meta-GitHub repository for all terraform-aws-modules repositories ๐Ÿ‡บ๐Ÿ‡ฆ
22
star
49

terraform-aws-ssm-parameter

Terraform module to create AWS SSM Parameter resources ๐Ÿ‡บ๐Ÿ‡ฆ
HCL
20
star
50

terraform-aws-s3-object

Terraform module which creates S3 object resources on AWS
HCL
17
star
51

terraform-aws-ebs-optimized

Terraform module to determine if an instance can be flagged for EBS optimization
HCL
17
star
52

terraform-aws-customer-gateway

Terraform module to create AWS Customer Gateway resources ๐Ÿ‡บ๐Ÿ‡ฆ
HCL
17
star
53

terraform-aws-global-accelerator

Terraform module to create AWS Global Accelerator resources ๐Ÿ‡บ๐Ÿ‡ฆ
HCL
16
star
54

terraform-aws-memory-db

Terraform module to create AWS MemoryDB resources ๐Ÿ‡บ๐Ÿ‡ฆ
HCL
16
star
55

terraform-aws-opensearch

Terraform module to create AWS OpenSearch resources ๐Ÿ‡บ๐Ÿ‡ฆ
HCL
15
star
56

terraform-aws-elasticache

Terraform module to create AWS ElastiCache resources ๐Ÿ‡บ๐Ÿ‡ฆ
HCL
12
star
57

terraform-aws-network-firewall

Terraform module to create AWS Network Firewall resources ๐Ÿ‡บ๐Ÿ‡ฆ
HCL
12
star
58

terraform-aws-fsx

Terraform module to create AWS FSx resources ๐Ÿ‡บ๐Ÿ‡ฆ
HCL
4
star
59

atlantis-demo

Demo repository for Atlantis
3
star