Sign in
Menu
Start free trial

Use this module

module "tgw" {
  source = "registry.compliance.tf/terraform-aws-modules/transit-gateway/aws"

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

  enable_auto_accept_shared_attachments = true

  vpc_attachments = {
    vpc = {
      vpc_id       = "vpc-1234556abcdef"
      subnet_ids   = ["subnet-abcde012", "subnet-bcde012a", "subnet-fghi345a"]
      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 = {
    Terraform   = "true"
    Environment = "dev"
  }
}

The example from the module's README, with this page's source.

Key inputs

Required inputs first, then the inputs the README example sets.

  • namestring, default ""

    Name to be used on all the resources as identifier

  • descriptionstring, default null

    Description of the EC2 Transit Gateway

  • enable_auto_accept_shared_attachmentsbool, default false

    Whether resource attachment requests are automatically accepted

  • vpc_attachmentsany, default {}

    Maps of maps of VPC details to attach to TGW. Type 'any' to disable type validation by Terraform.

  • ram_allow_external_principalsbool, default false

    Indicates whether principals outside your organization can be associated with a resource share.

  • ram_principalslist(string), default []

    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

  • tagsmap(string), default {}

    A map of tags to add to all resources

All 29 inputs