A new platform for documentation and tutorials is launching soon.
We are migrating HCP documentation into HashiCorp Developer, our new developer experience.
»Transit Gateway Attachments
You can create transit gateway attachments to connect a HashiCorp Virtual Network (HVN) to an AWS transit gateway.
- A transit gateway is an AWS component that acts as a network transit hub in your AWS environment.
- A transit gateway attachment is a component in HCP that connects your HVN to a transit gateway in AWS.
The following procedure describes how to connect clusters in HCP to resources deployed to AWS:
- Connect one or more VPCs in your AWS network to your transit gateway.
- Create a resource share using the AWS Resource Access Manager. The transit gateway and resource share must exist in the same region as the HVN you want to connect to.
- Create a transit gateway attachment in HCP. The platform identifies the shared resource using the Amazon Resource Name (ARN) and the transit gateway ID.
- HCP initiates a request to AWS for access to the resources. You must approve the attachment request in the AWS account before HCP can route traffic through the transit gateway.
- Configure routes to direct traffic between the transit gateway attachment and the transit gateway.
You can create a transit gateway attachment in HCP or you can use the HCP Terraform provider. For instructions on how to create transit gateway attachments with Terraform, refer to the HCP provider documentation.
Tutorial: For step-by-step guidance on using transit gateways to connect your HVN to AWS, refer to the Connect an Amazon Transit Gateway to your HashiCorp Virtual Network tutorial.
Before you create a transit gateway attachment, you need the following information:
- AWS account ID
- AWS transit gateway ID
- ARN of the resource share in AWS
The HCP interface provides links and other onscreen assistance to help you find this information. For additional details on where to find this information, refer to the AWS Documentation.
»Create a Transit Gateway Attachment
The HCP interface provides guided steps to help you transit gateway attachments. You can follow the command line or the web UI workflow.
- Sign in to the HCP Portal and select your organization.
- From the sidebar, click HashiCorp Virtual Network.
- Click on an HVN in the ID column.
- Click Transit gateway attachments and then Create attachment.
- In the Terminal tab, complete the requested fields:
- In the Attachment ID field, enter a name for the peering connection.The name can be up to 36 characters and can only include letters, numbers, and dashes.
- Enter your AWS Account ID.
- Enter your Transit gateway ID.
- Select your VPC region.
- Copy the resource share command and run it in your terminal.
- Enter your Resource share ARN and then click Create attachment.
After you create the attachment, you must create a route to direct traffic to your VPCs. For more information, refer to Routes.