• HashiCorp Developer

  • HashiCorp Cloud Platform
  • Terraform
  • Packer
  • Consul
  • Vault
  • Boundary
  • Nomad
  • Waypoint
  • Vagrant
HashiCorp Cloud Platform
  • Tutorials
  • Documentation
  • Try Cloud(opens in new tab)
  • Sign up
HashiCorp Cloud Platform Home

Documentation

Skip to main content
  • Documentation
    • What is HCP?
    • HCP Account
      • Overview
        • Create and Manage HVN
        • Peering Connections
        • Routes
        • Security Groups
    • Data Privacy
  • Glossary
  • Changelog

  • Resources

  • Tutorial Library
  • Community Forum
    (opens in new tab)
  • Support
    (opens in new tab)
  • GitHub
    (opens in new tab)
  1. Developer
  2. HashiCorp Cloud Platform
  3. Documentation
  4. HashiCorp Cloud Platform
  5. HashiCorp Virtual Network
  6. HVN for Azure
  7. Peering Connections

»Peering Connections

You can create a peering connection between HashiCorp Cloud Platform (HCP) and your virtual network (VNet) in Azure to link resources between the two services.

Overview

The Consul servers hosted on HCP use peering connections to communicate with the clients hosted in your Azure environment.

You can create peering connections from the HCP interface. You can also use the HCP provider in Terraform. For instructions on how to create peering connections with Terraform, refer to the HCP provider documentation.

You can use peering connections to quickly connect the HVN to your VNet. You can also create HVN peering connections across different Azure regions. However, peering connections may not scale to meet the requirements of complex environments.

Tutorial: For step-by-step guidance on creating peering connections, refer to the Peering an Azure Virtual Network with HashiCorp Cloud Platform tutorial.

Requirements

  • An Azure account ID
  • The ID of the VNet you wish to connect
  • VNets must be configured with RFC1918 IP addresses.

Create Peering Connections

To set up a peering connection, you need to configure the connection request in HCP and then configure a corresponding request in Azure.

Configure the Connection Request in HCP

  1. Sign in to the HCP Portal and select your organization.
  2. From the sidebar, click HashiCorp Virtual Network.
  3. Click on an HVN in the ID column.
  4. From the sidebar, click Peering connections.
  5. Click Create connection.
  6. Complete the requested fields. In the Connection 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. Then, enter your Azure Tenant ID, Azure Subscription ID, Resource group name, and Azure VNet name.
  7. Click Create connection.

The HVN sends a peering connection request to Azure. The peering request expires after seven days. The status of the connection appears as pending until either the connection process is completed or the request expires.

Accept the Connection Request in Azure

HCP generates terminal commands that you can copy and paste into your Azure CLI to configure the corresponding connection request. HCP also provides links to the Azure documentation if you prefer to use the Azure browser interface.

  1. Sign in to the HCP Portal and select your organization.
  2. From the sidebar, click HashiCorp Virtual Network.
  3. Click on an HVN in the ID column.
  4. From the sidebar, click Peering connections.
  5. Click the name of the connection in the ID column.
  6. Under “Peering Instructions,” click the tab for Azure Cloud Shell.
  7. Follow the instructions to run the sequence of commands.

You can also create the second request from the Azure console. For information about creating VNet peering connections, refer to the Azure documentation.

Next Steps

The HVN peering connection does not contain routing information. Once the connection is active, you can add a route for all or part of the VNet CIDR range. For more details, refer to Routes.

On this page

  1. Peering Connections
  2. Overview
  3. Requirements
  4. Create Peering Connections
  5. Next Steps
Give Feedback(opens in new tab)
  • Certifications
  • System Status
  • Terms of Use
  • Security
  • Privacy
  • Trademark Policy
  • Trade Controls
  • Give Feedback(opens in new tab)