/terraform-aws-hcp

Terraform Module for Configuring AWS Components for HashiCorp Cloud Platform

Primary LanguageHCLMozilla Public License 2.0MPL-2.0

Terraform Module for AWS and HashiCorp Cloud Platform

This module configures the following components for HCP:

  • HashiCorp Virtual Network (HVN)
  • Routing tables and peering connection between an AWS VPC and HVN
  • (Optional) HashiCorp Cloud Platform (HCP) Consul cluster (development tier)
  • (Optional) Security groups rules to allow HCP Consul on AWS
  • (Optional) HashiCorp Cloud Platform (HCP) Vault cluster (development tier)

Prerequisites

You must have access to HashiCorp Cloud Platform (HCP). Create an HCP service principal before using the HCP Provider for Terraform.

Requirements

Name Version
terraform >=1.0
aws >= 4.14
hcp >= 0.29

Providers

Name Version
aws 4.14.0
hcp 0.29.0

Modules

No modules.

Resources

Name Type
aws_route.hvn resource
aws_security_group_rule.hcp_consul resource
aws_vpc_peering_connection_accepter.hvn resource
hcp_aws_network_peering.peer resource
hcp_consul_cluster.consul resource
hcp_hvn.hvn resource
hcp_hvn_route.hvn resource
hcp_vault_cluster.vault resource
aws_region.current data source

Inputs

Name Description Type Default Required
hcp_consul_datacenter Datacenter for HCP Consul cluster. If undefined, uses hcp_consul_name. string null no
hcp_consul_name Name for HCP Consul cluster. If left as an empty string, a cluster will not be created. string "" no
hcp_consul_public_endpoint Enable public endpoint for HCP Consul cluster. bool false no
hcp_consul_security_group_ids Security Group IDs to allow HCP Consul. list(string) [] no
hcp_consul_tier Tier for HCP Consul cluster. Must be development, standard, or plus. string "development" no
hcp_consul_version Minimum Consul version. Defaults to HCP recommendation. string null no
hcp_vault_name Name for HCP Vault cluster. If left as an empty string, a cluster will not be created. string "" no
hcp_vault_public_endpoint Enable public endpoint for HCP Vault cluster. bool false no
hcp_vault_tier Tier for HCP Vault cluster. See pricing information string "dev" no
hcp_vault_version Minimum Vault version. Defaults to HCP recommendation. string null no
hvn_cidr_block CIDR Block of HashiCorp Virtual Network. Cannot overlap with vpc_cidr_block. string n/a yes
hvn_name Name of HashiCorp Virtual Network. string n/a yes
hvn_peer Peer HVN to VPC. bool true no
hvn_region AWS region for HashiCorp Virtual Network. string n/a yes
number_of_route_table_ids Number of routing table ids. Works around GH-4149. number 0 no
route_table_ids List of routing table IDs to route to HVN peering connection. list(string) [] no
tags Map of tags for resources map(string) {} no
vpc_cidr_block CIDR Block of VPC. Cannot overlap with hvn_cidr_block. string "" no
vpc_id ID of VPC. string "" no
vpc_owner_id Owner ID of VPC. string "" no

Outputs

Name Description
hcp_consul_datacenter Datacenter of HCP Consul Cluster.
hcp_consul_id ID of HCP Consul.
hcp_consul_private_endpoint Private endpoint of HCP Consul.
hcp_consul_public_endpoint Public endpoint of HCP Consul.
hcp_vault_datacenter Namespce used in HCP Vault.
hcp_vault_id ID of HCP Vault.
hcp_vault_private_endpoint Private endpoint of HCP Vault.
hcp_vault_public_endpoint Public endpoint of HCP Vault.
hvn_id ID of HashiCorp Virtual Network.