The HVN resource allows you to manage a HashiCorp Virtual Network in HCP.
We recommend the following when selecting the CIDR block of an HVN:
The CIDR block value must be a private IPv4 CIDR block within the RFC1918 address space (10..., 192.168.., 172.[16-31]..*).
The CIDR block value must be the first IP address of the desired CIDR block. The helper cidrsubnet("172.16.1.1/24", 0, 0)
will specify the first address of the CIDR block in the first argument.
The CIDR block value must end between /16 and /25.
If the CIDR block values for your HCP HVN and your cloud provider’s virtual network overlap you will not be able to establish a connection. The following are default CIDR block values to be aware of: HCP HVN (172.25.16.0/20), AWS VPC (172.31.0.0/16), and Azure VNet (172.29.0.0/24). Avoid creating overlapping networks.
If you’re creating a HVN for use in production it's recommended that you specify a CIDR block value that does not overlap with the other HVNs already created in your organization. You will not be able to connect two HVNs with overlapping CIDR block values.
resource "hcp_hvn" "example" {
hvn_id = "main-hvn"
cloud_provider = "aws"
region = "us-west-2"
cidr_block = "172.25.16.0/20"
}
cloud_provider
(String) The provider where the HVN is located. The provider 'aws' is generally available and 'azure' is in public beta.hvn_id
(String) The ID of the HashiCorp Virtual Network (HVN).region
(String) The region where the HVN is located.cidr_block
(String) The CIDR range of the HVN. If this is not provided, the service will provide a default value.project_id
(String) The ID of the HCP project where the HVN is located.
If not specified, the project specified in the HCP Provider config block will be used, if configured.
If a project is not configured in the HCP Provider config block, the oldest project in the organization will be used.timeouts
(Block, Optional) (see below for nested schema)created_at
(String) The time that the HVN was created.id
(String) The ID of this resource.organization_id
(String) The ID of the HCP organization where the HVN is located.provider_account_id
(String) The provider account ID where the HVN is located.self_link
(String) A unique URL identifying the HVN.state
(String) The state of the HVN.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}
terraform import hcp_hvn.example f709ec73-55d4-46d8-897d-816ebba28778:main-hvn
# Using the provider-default project ID, the import ID is:
# {hvn_id}
terraform import hcp_hvn.example main-hvn