No description
  • Go 95.5%
  • Go Template 4%
  • Makefile 0.2%
  • HCL 0.2%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
OpenTofu Core Development Team 24bd99bf75 Apply GitHub workflow changes
2026-09-01 12:34:22 +00:00
.changelog [HVT-10931] Removed vault secrets (#1532) 2026-08-26 10:10:24 -05:00
.github Apply GitHub workflow changes 2026-09-01 12:34:22 +00:00
.release Update slack channel after workspace migration (#1390) 2025-10-13 11:07:45 -07:00
.vscode Initial commit 2021-01-07 10:34:03 -08:00
contributing [HVT-10931] Removed vault secrets (#1532) 2026-08-26 10:10:24 -05:00
design HCPE-1281: add design doc on networking resources (#159) 2021-07-07 15:52:22 -07:00
docs [HVT-10931] Removed vault secrets (#1532) 2026-08-26 10:10:24 -05:00
examples [HVT-10931] Removed vault secrets (#1532) 2026-08-26 10:10:24 -05:00
internal [HVT-10931] Removed vault secrets (#1532) 2026-08-26 10:10:24 -05:00
META.d [COMPLIANCE] Add Copyright and License Headers (#1123) 2024-11-04 14:06:13 -05:00
scripts [COMPLIANCE] Add Copyright and License Headers (#449) 2023-02-21 17:50:02 -05:00
templates [HVT-10931] Removed vault secrets (#1532) 2026-08-26 10:10:24 -05:00
tools [COMPLIANCE] Add Copyright and License Headers (#449) 2023-02-21 17:50:02 -05:00
version Prepare for release (#1531) 2026-08-12 17:16:39 +05:30
.copywrite.hcl Add Copywrite Ignore (#461) 2023-02-21 17:29:48 -05:00
.gitignore Prevent FAILED peerings/attachments from failing deletes (#394) 2022-09-21 11:37:31 -04:00
.tool-versions HCPIE-1846: Handle DEADLINE_EXCEEDED Retries for IAM Groups and Group Members (#1140) 2024-11-18 15:28:31 -05:00
CHANGELOG.md Prepare for release (#1531) 2026-08-12 17:16:39 +05:30
GNUmakefile Prepare for release (#1321) 2025-06-17 13:25:21 -04:00
go.mod Bump google.golang.org/grpc from 1.83.1 to 1.83.2 (#1537) 2026-09-01 17:14:03 +05:30
go.sum Bump google.golang.org/grpc from 1.83.1 to 1.83.2 (#1537) 2026-09-01 17:14:03 +05:30
golangci-config.yml HPR-1173: Channel Restriction Management (#555) 2023-07-31 12:12:01 -04:00
hcp.svg HCPE-797 - Update README and add initial contributing documentation (#62) 2021-02-12 16:33:34 -05:00
LICENSE [COMPLIANCE] Update MPL 2.0 LICENSE (#402) 2022-10-13 14:42:54 -04:00
main.go Remove StatusPage (#1216) 2025-02-14 12:17:33 -08:00
README.md Remove outdated deprecation warning (#659) 2023-10-30 20:53:43 +00:00
terraform-registry-manifest.json Document version requirements 2023-10-19 10:14:45 -07:00

HashiCorp Cloud Platform logo

HashiCorp Cloud Platform (HCP) Terraform Provider

Available in the Terraform Registry.

The HashiCorp Cloud Platform (HCP) Terraform Provider is a plugin for Terraform that allows for the full lifecycle management of HCP resources. This provider is maintained internally by the HashiCorp Cloud Services team.

Requirements

Using the Provider

See the HashiCorp Cloud Platform (HCP) Provider documentation to get started using the provider.

Contributing

See the contributing directory for more developer documentation.

Design

See the design for documents capturing certain key design decisions made for this provider as a platform.

Example

Below is a complex example that creates a HashiCorp Virtual Network (HVN), an HCP Consul cluster within that HVN, and peers the HVN to an AWS VPC.

// Configure the provider
provider "hcp" {}

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

// Create a HashiCorp Virtual Network (HVN).
resource "hcp_hvn" "example" {
  hvn_id         = "hvn"
  cloud_provider = "aws"
  region         = "us-west-2"
  cidr_block     = "172.25.16.0/20"
}

// Create an HCP Consul cluster within the HVN.
resource "hcp_consul_cluster" "example" {
  hvn_id         = hcp_hvn.example.hvn_id
  cluster_id     = "consul-cluster"
  tier           = "development"
}

// If you have not already, create a VPC within your AWS account that will
// contain the workloads you want to connect to your HCP Consul cluster.
// Make sure the CIDR block of the peer VPC does not overlap with the CIDR
// of the HVN.
resource "aws_vpc" "peer" {
  cidr_block = "10.220.0.0/16"
}

// Create an HCP network peering to peer your HVN with your AWS VPC.
resource "hcp_aws_network_peering" "example" {
  peering_id          = "peer-id"
  hvn_id              = hcp_hvn.example.hvn_id
  peer_vpc_id         = aws_vpc.peer.id
  peer_account_id     = aws_vpc.peer.owner_id
  peer_vpc_region     = "us-west-2"
}

// Create an HVN route that targets your HCP network peering and matches your AWS VPC's CIDR block.
resource "hcp_hvn_route" "example" {
  hvn_link         = hcp_hvn.example.self_link
  hvn_route_id     = "peer-route-id"
  destination_cidr = aws_vpc.peer.cidr_block
  target_link      = hcp_aws_network_peering.example.self_link
}

// Accept the VPC peering within your AWS account.
resource "aws_vpc_peering_connection_accepter" "peer" {
  vpc_peering_connection_id = hcp_aws_network_peering.example.provider_peering_id
  auto_accept               = true
}

// Create a Vault cluster within the HVN.
resource "hcp_vault_cluster" "example" {
  cluster_id = "vault-cluster"
  hvn_id     = hcp_hvn.example.hvn_id
}