Get started with end-to-end deployment configuration
HashiCorp Cloud Platform (HCP) Consul is a fully managed Service Mesh as a Service (SMaaS) version of Consul. While you can deploy a HCP Consul Dedicated server and connect the Consul clients in your cloud environments manually, using Terraform significantly reduces deployment time.
The HCP Portal has a quickstart template that uses Terraform modules to deploy an end-to-end development environment so you can quickly use HCP Consul Dedicated. With this configuration, you can create a development environment and launch HashiCups, an example application consisting of five different microservices, in less than 30 min.
You do not need to be an expert with Terraform to run these end-to-end deployments.
This video provides an overview of the tutorials in this collection.
Prerequisites
To complete tutorials in this collection you will need the following:
- The Terraform v1.0.0+ installed
- Git installed
- An HCP account configured for use with Terraform
Additionally, for HCP Consul Dedicated AWS tutorials, you will need:
- an AWS account with AWS Credentials configured for use with Terraform
HCP Consul Dedicated deployment steps
This section shows the logical steps required to create a new HCP Consul Dedicated cluster and to deploy services in the service mesh.
Tip
Some steps have extra resources, including Terraform resources and tutorials, that explain the step in more detail.
This architectural diagram shows a standard HCP Consul Dedicated cluster peered to a virtual network (for example, an AWS VPC or an Azure VNet). The virtual network has Consul clients and services on the service mesh.
End-to-end scenarios
You can automate all the steps with Terraform. The HCP Portal has a quickstart template that deploys an end-to-end development environment so you can quickly observe HCP Consul Dedicated in action. This Terraform configuration:
- Creates a new HashiCorp virtual network (VNet) and single-node Consul development server
- Connects the HVN with your Azure virtual network (VNet)
- Provisions an Azure virtual machine (VM) instance and installs a Consul client
- Deploys HashiCups, a demo application that uses Consul service mesh
You can generate this quickstart Terraform configuration when you create a new HCP Consul Dedicated cluster. After you select your cloud provider, select the Terraform Automation creation method.
AWS end-to-end scenarios
HCP Consul Dedicated on AWS supports three end-to-end scenarios.
- The Deploy HCP Consul Dedicated with EKS using Terraform tutorial will show you how to deploy a HCP Consul Dedicated cluster and HashiCups, a sample application, on an EKS cluster.
- The Deploy HCP Consul Dedicated with EC2 using Terraform tutorial will show you how to deploy a HCP Consul Dedicated cluster and HashiCups, a sample application, on an EC2 instance.
- The Deploy HCP Consul Dedicated with ECS using Terraform tutorial will show you how to deploy a HCP Consul Dedicated cluster and HashiCups, a sample application, on an ECS cluster.
Azure end-to-end scenarios
HCP Consul Dedicated on Azure supports one end-to-end scenario.
- The Deploy HCP Consul Dedicated with AKS using Terraform tutorial will show you how to deploy a HCP Consul Dedicated cluster and HashiCups, a sample application, on an Azure AKS cluster.
- The Deploy HCP Consul Dedicated with Azure VM using Terraform tutorial will show you how to deploy a HCP Consul Dedicated cluster and HashiCups, a sample application, on an Azure VM instance.
HCP Consul Dedicated environments with existing resources
The end-to-end scenarios are an ideal subset of use-cases where you deploy HCP Consul and your workloads simultaneously with Terraform.
However, when you start to adopt HCP Consul Dedicated, you may want to manage and deploy the various components separately.
- HVN and HCP Consul Dedicated
- Consul clients
- AWS: EKS, EC2, ECS
- Azure: AKS, VM
- Your applications and services
Visit the following tutorials to learn how to configure Consul clients to connect and interact with your existing HCP Consul Dedicated cluster. This will make it easier and faster for you to leverage HCP Consul Dedicated's full feature set.
- Configure EC2 as a Consul Client for HCP Consul
- Connect an Elastic Kubernetes Service Cluster to HCP Consul
- Configure Azure VM as a Consul Client for HCP Consul
- Configure AKS as a Consul Client for HCP Consul
Alternatively, visit the following tutorials to learn how to deploy HCP Consul Dedicated for your existing workloads.
- Create a HCP Consul Dedicated cluster for an existing EKS run time
- Serverless Consul service mesh with ECS and HCP
Deep dive into available modules
The examples in this tutorial collection provide users a way to quickly deploy services in HCP Consul Dedicated and evaluate the platform. These modules are not intended for production use. However, you can use the modules as a foundation and adapt it to your organization and specific use case.
Visit the Terraform Registry page for more information about the modules.
The
aws-hcp-consul
Terraform module helps you peer your HVN with your VPC. In addition, it includes submodules that lets you deploy a Consul client (EKS, EC2, ECS) onto your peered virtual network.The
azurerm-hcp-consul
Terraform module helps you peer your HVN with your VNet. In addition, it includes submodules that lets you deploy a Consul client (AKS, VM) onto your peered virtual network.
Next steps
In this tutorial, you learned the steps required to deploy HCP Consul Dedicated and connect it to your workload. In addition, the tutorial introduced you to Terraform resources that help you interact with HCP and deploy a Consul datacenter on different resources on AWS or Azure.
Complete the following tutorials to create your own end-to-end HCP Consul Dedicated development environment with Terraform.
- Deploy HCP Consul Dedicated with EKS using Terraform
- Deploy HCP Consul Dedicated with EC2 using Terraform
- Deploy HCP Consul Dedicated with ECS using Terraform
- Deploy HCP Consul Dedicated with AKS using Terraform
- Deploy HCP Consul Dedicated with Azure Virtual Machines using Terraform
If you encounter any issues, please contact the HCP team at support.hashicorp.com.