Transit Gateway Peering Attachment Accepter Accepter Terraform Module
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
Name | Version |
---|---|
terraform | >= 1.0.0 |
aws | >= 4.5.0 |
Providers
Name | Version |
---|---|
aws | >= 4.5.0 |
Modules
No modules.
Resources
Name | Type |
---|---|
aws_ec2_transit_gateway_peering_attachment_accepter.this | resource |
aws_ec2_transit_gateway_peering_attachment.this | data source |
Inputs
Name | Description | Type | Default | Required |
---|---|---|---|---|
custom_tags | 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. | map(string) | {} | no |
name | The name of the transit gateway peering attachment. If not set, a default name will be used. | string | null | no |
transit_gateway_attachment_id | The transit gateway peering attachment ID to accept. If none is set, the module will attempt to look this up. | string | null | no |
transit_gateway_id | 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 | string | n/a | yes |
Outputs
Name | Description |
---|---|
ids | The transit gateway peering attachment identifier. |
peer_account_ids | The identifers for the peer account. |
peer_transit_gateway_ids | The identifier of the peer transit gateway. |
transit_gateway_ids | The identifer of the transit gateway for the accepter resources. |
Sample Usage
- Terraform
- Terragrunt
# ------------------------------------------------------------------------------------------------------
# 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.27.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
}
# ------------------------------------------------------------------------------------------------------
# DEPLOY GRUNTWORK'S TRANSIT-GATEWAY-PEERING-ATTACHMENT-ACCEPTER MODULE
# ------------------------------------------------------------------------------------------------------
terraform {
source = "git::git@github.com:gruntwork-io/terraform-aws-vpc.git//modules/transit-gateway-peering-attachment-accepter?ref=v0.27.0"
}
inputs = {
# ----------------------------------------------------------------------------------------------------
# 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
- Inputs
- Outputs
Required
transit_gateway_id
stringTransit 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_tags
map(string)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.
{}
name
stringThe 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
The transit gateway peering attachment identifier.
The identifers for the peer account.
The identifier of the peer transit gateway.
The identifer of the transit gateway for the accepter resources.