The HVN route resource allows you to manage an HVN route.
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
}
destination_cidr
(String) The destination CIDR of the HVN route.hvn_link
(String) The self_link
of the HashiCorp Virtual Network (HVN).hvn_route_id
(String) The ID of the HVN route.target_link
(String) A unique URL identifying the target of the HVN route. Examples of the target: aws_network_peering
, aws_transit_gateway_attachment
azure_config
(Block List, Max: 1) The Azure configuration for routing. (see below for nested schema)project_id
(String, Deprecated) The ID of the HCP project where the HVN route is located. Always matches the project ID in hvn_link
. Setting this attribute is deprecated, but it will remain usable in read-only form.timeouts
(Block, Optional) (see below for nested schema)created_at
(String) The time that the HVN route was created.id
(String) The ID of this resource.self_link
(String) A unique URL identifying the HVN route.state
(String) The state of the HVN route.azure_config
Required:
next_hop_type
(String) The type of Azure hop the packet should be sent to. Valid options for Next Hop Type - VIRTUAL_APPLIANCE
or VIRTUAL_NETWORK_GATEWAY
Optional:
next_hop_ip_address
(String) Contains the IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is VIRTUAL_APPLIANCE.timeouts
Optional:
create
(String)default
(String)delete
(String)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