danbarr / terraform-hcp-vault-cluster

Terraform module for an HCP Vault cluster

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HCP Vault Cluster Terraform Module

Terraform module which provisions a simple HCP Vault cluster for demonstration purposes. Only a subset of the available configuration options are exposed.

By default a HashiCorp Virtual Network is also created, unless create_hvn = false the hvn_id of an existing HVN is supplied.

Prerequisites:

  • An HCP organization
  • HCP "Contributor" credentials set as environment variables HCP_CLIENT_ID and HCP_CLIENT_SECRET (see the HCP provider authentication guide). Optionally specify HCP_PROJECT_ID. If not included, the oldest project in the organization will be used.
    • If using a project-level service principal, HCP_PROJECT_ID is required

Requirements

Name Version
terraform >= 1.2
hcp >= 0.57

Providers

Name Version
hcp >= 0.57

Modules

No modules.

Resources

Name Type
hcp_hvn.this resource
hcp_vault_cluster.this resource
hcp_vault_cluster_admin_token.admin resource

Inputs

Name Description Type Default Required
cidr_block CIDR block for the HVN. string "172.25.16.0/20" no
cloud_provider Cloud provider where the HVN and Vault cluster will be located. Only used if create_hvn = true. string "aws" no
create_hvn Whether to create a new HVN or use an existing one. bool true no
hvn_id ID of the HVN. If create_hvn = false, this must be set to an existing HVN ID. If left blank and create_hvn = true, an ID will be generated for you. string "" no
prefix This prefix will be used to generate unique resource names. string n/a yes
public_endpoint Whether the Vault cluster should have a public endpoint. If false, you will need to set up HVN peering to reach the cluster. bool false no
region Region where the HVN and Vault cluster will be located. Only used if create_hvn = true. string "us-east-1" no
vault_cluster_id ID for the Vault cluster. If left blank, an ID will be generated for you. string "" no
vault_tier Sizing tier of the Vault cluster. string "dev" no

Outputs

Name Description
hvn_id ID of the HashiCorp Virtual Network (HVN).
vault_admin_token Admin token for the HCP Vault cluster.
vault_cluster_id ID of the HCP Vault cluster.
vault_private_endpoint_url Private endpoint of the HCP Vault cluster.
vault_public_endpoint_url Public endpoint of the HCP Vault cluster.

About

Terraform module for an HCP Vault cluster

License:MIT License


Languages

Language:HCL 100.0%