HCP Consul enables you to quickly deploy Consul servers in AWS. As a fully managed service, HCP Consul allows you to leverage Consul for service discovery or service mesh features while offloading the operational burden to the Site Reliability Engineering (SRE) experts at HashiCorp.
In this tutorial, you will deploy HCP Consul in a development environment. With the HCP portal guided quickstart, you will set up a HashiCorp Virtual Network (HVN) and HCP Consul with all default values. This will enable you quickly get hands-on with Consul, including accessing the UI with a public IP.
You will need an HCP account. Previous experience with Consul is not required to get hands-on with a development deployment.
»Deploy HCP Consul
To get started, use the Guided quickstart button on the Overview page in the HCP portal. Note, if you have an existing HCP Consul cluster or HVN the Guided quickstart button will not appear.
After selecting Guided quickstart, you will be presented with configuration options you can set for your deployment.
For this tutorial, you can select any supported region, but will need to deploy HCP Consul with a publicly accessible IP. This will allow you to quickly access the Consul UI and API.
Turn on the Allow public connections from outside your selected network option.
Click the Deploy setup button to begin the deployment. While HCP Consul initializes, you will be directed to the Consul resource page. Note, this process can take up to 10 minutes. Once you see that the deployment is listed as Running on the Cluster tab, HCP Consul is fully deployed.
The public configuration quickstart is only for development, but it is the quickest way to get hands on experience with HCP Consul. The quickstart deploys the HVN with the default CIDR block values, and the Consul cluster with all the defaults.
By default, the quickstart deploys an extra-small (XS) Consul cluster. About 50 service instances can be supported by this cluster size.
To learn more about production tier sizing, see this HCP Consul production deployment guide
»Access the Consul UI
Once HCP Consul is deployed, you can access the Consul UI by clicking Public from the list of Cluster URLs on the HCP Consul cluster overview page.
This will copy the public IP address to your clipboard. You can now paste this IP address into your browser to access the Consul UI.
Since HCP Consul is secure by default, you will need an ACL token to view any data in the UI. To generate a token that can be used to log into the UI, click the Generate token button on the Consul overview tab, and then copy the token from the pop-up.
Paste the token into the Consul UI by selecting the login option in the top right corner. You can now interact with your HCP Consul servers. The Consul UI allows you to view nodes and services, manage data in the key value store, and manage service mesh authorization for service-to-service communication with intentions.
»Manually Create HCP Consul deployments
The HCP portal quickstart is a guided process that walks you through the set up of your HCP Consul servers and required networking components. If you wish to create an HCP Consul deployment manually, you must follow the same deployment workflow as the quickstart guide.
Specifically you must:
- Create an HVN that an HCP Consul cluster can be deployed to
- Deploy HCP Consul to the HVN
After completing the deployment, you will have a fully operational Consul control plane ready for use. However, you will still need to deploy Consul clients and configure peer networks to make use of Consul's service discovery and service mesh features.
If you'd like to keep learning about Consul's features, and for step-by-step examples of how to perform common Consul tasks, complete one of the Get Started with Consul tutorials.
- Register a Service with Consul Service Discovery
- Secure Applications with Service Sidecar Proxies
- Explore the Consul UI
If you encounter any issues, please contact the HCP team at support.hashicorp.com.