Skip to main content
VPC Modules 0.28.0Last updated in version 0.27.0

Transit Gateway Peering Attachment Accepter Accepter Terraform Module

View Source Release Notes

This Terraform Module creates Transit Gateway peering resources for the accepter side of the connection. This allows for connectivity between multiple regions or multiple AWS accounts. Transit Gateway peering is a one-to-one relationship between two transit gateways. If you need to peer multiple transit gateways, you will need to create multiple transit gateway peering attachments.

See VPC Core Concepts for more information on the core networking components and topologies.

What is a Transit Gateway Peering Attachment Accepter?

A transit gateway peering attachment accepter is a way to connect two transit gateways to each other. Much like the VPC attachment, this can be thought of as a network cable. By attaching them, you 'plug' the two transit gateways together. This allows you to route traffic between the two transit gateways. Unlike VPC attachments, peering attachments have two components to the attachment a requester and an accepter. This is important because each attachment must be accepted prior to the attachment being completed. This is a security measure to ensure a malicious attachment from a random account does not gain network access to your environment. The accepter is the side of the peering attachment that accepts the request from the requester.

For usage examples, check out the examples folder.

Requirements

NameVersion
terraform>= 1.0.0
aws>= 4.5.0

Providers

NameVersion
aws>= 4.5.0

Modules

No modules.

Resources

NameType
aws_ec2_transit_gateway_peering_attachment_accepter.thisresource
aws_ec2_transit_gateway_peering_attachment.thisdata source

Inputs

NameDescriptionTypeDefaultRequired
custom_tagsA map of tags to apply to all resources when applicable. The key is the tag name and the value is the tag value. Note that the tag 'Name' is automatically added by this module but may be optionally overwritten by this variable.map(string){}no
nameThe name of the transit gateway peering attachment. If not set, a default name will be used.stringnullno
transit_gateway_attachment_idThe transit gateway peering attachment ID to accept. If none is set, the module will attempt to look this up.stringnullno
transit_gateway_idTransit gateway ID of which to accept the peering attachments from. This will be the accepter side transit gateway (your side) of the peering attachmentstringn/ayes

Outputs

NameDescription
idsThe transit gateway peering attachment identifier.
peer_account_idsThe identifers for the peer account.
peer_transit_gateway_idsThe identifier of the peer transit gateway.
transit_gateway_idsThe identifer of the transit gateway for the accepter resources.

Sample Usage

main.tf

# ------------------------------------------------------------------------------------------------------
# DEPLOY GRUNTWORK'S TRANSIT-GATEWAY-PEERING-ATTACHMENT-ACCEPTER MODULE
# ------------------------------------------------------------------------------------------------------

module "transit_gateway_peering_attachment_accepter" {

source = "git::git@github.com:gruntwork-io/terraform-aws-vpc.git//modules/transit-gateway-peering-attachment-accepter?ref=v0.28.0"

# ----------------------------------------------------------------------------------------------------
# REQUIRED VARIABLES
# ----------------------------------------------------------------------------------------------------

# Transit gateway ID of which to accept the peering attachments from. This
# will be the accepter side transit gateway (your side) of the peering
# attachment
transit_gateway_id = <string>

# ----------------------------------------------------------------------------------------------------
# OPTIONAL VARIABLES
# ----------------------------------------------------------------------------------------------------

# A map of tags to apply to all resources when applicable. The key is the tag
# name and the value is the tag value. Note that the tag 'Name' is
# automatically added by this module but may be optionally overwritten by this
# variable.
custom_tags = {}

# The name of the transit gateway peering attachment. If not set, a default
# name will be used.
name = null

# The transit gateway peering attachment ID to accept. If none is set, the
# module will attempt to look this up.
transit_gateway_attachment_id = null

}


Reference

Required

transit_gateway_idstringrequired

Transit gateway ID of which to accept the peering attachments from. This will be the accepter side transit gateway (your side) of the peering attachment

Optional

custom_tagsmap(string)optional

A map of tags to apply to all resources when applicable. The key is the tag name and the value is the tag value. Note that the tag 'Name' is automatically added by this module but may be optionally overwritten by this variable.

{}
namestringoptional

The name of the transit gateway peering attachment. If not set, a default name will be used.

null

The transit gateway peering attachment ID to accept. If none is set, the module will attempt to look this up.

null