hcp_hvn_route (Resource)

The HVN route resource allows you to manage an HVN route.

Example Usage

provider "aws" {
  region = "us-west-2"
}

resource "hcp_hvn" "main" {
  hvn_id         = "main-hvn"
  cloud_provider = "aws"
  region         = "us-west-2"
  cidr_block     = "172.25.16.0/20"
}

// Creating a peering and a route for it.
resource "aws_vpc" "peer" {
  cidr_block = "192.168.0.0/20"
}

resource "hcp_aws_network_peering" "example" {
  peering_id      = "peer-example"
  hvn_id          = hcp_hvn.main.hvn_id
  peer_vpc_id     = aws_vpc.peer.id
  peer_account_id = aws_vpc.peer.owner_id
  peer_vpc_region = "us-west-2"
}

resource "aws_vpc_peering_connection_accepter" "peer" {
  vpc_peering_connection_id = hcp_aws_network_peering.example.provider_peering_id
  auto_accept               = true
}

resource "hcp_hvn_route" "example-peering-route" {
  hvn_link         = hcp_hvn.main.self_link
  hvn_route_id     = "peering-route"
  destination_cidr = aws_vpc.peer.cidr_block
  target_link      = hcp_aws_network_peering.example.self_link
}

Schema

Required

Optional

Read-Only

Nested Schema for azure_config

Required:

Optional:

Nested Schema for timeouts

Optional:

Import

Import is supported using the following syntax:

# Using an explicit project ID, the import ID is:
# {project_id}:{hvn_id}:{hvn_route_id}
terraform import hcp_hvn_route.example f709ec73-55d4-46d8-897d-816ebba28778:main-hvn:example-hvn-route
# Using the provider-default project ID, the import ID is:
# {hvn_id}:{hvn_route_id}
terraform import hcp_hvn_route.example main-hvn:example-hvn-route