Skip to content

Latest commit

 

History

History
41 lines (30 loc) · 2.78 KB

MAIN.md

File metadata and controls

41 lines (30 loc) · 2.78 KB

Vault Cluster Example

This is an example of Terraform code to deploy a Vault cluster in Azure using the vault-cluster module. The Vault cluster uses Consul as a storage backend, so this example also deploys a separate Consul server cluster using the consul-cluster module from the Consul Azure Module.

This example creates a public Vault cluster that is accessible from the public Internet via an Azure Load Balancer.

WARNING: For production use, you should deploy the cluster without a load balancer so that it is only accessible from within your Azure account.

Vault architecture

You will need to create an Azure Managed Image that has Vault and Consul installed, which you can do using the vault-consul-image example.

For more info on how the Vault cluster works, check out the vault-cluster documentation.

Quick start

To deploy a Vault Cluster:

  1. git clone this repo to your computer.
  2. Build a Vault and Consul Azure Image. See the vault-consul-image example documentation for instructions.
  3. Install Terraform.
  4. Open vars.tf, set the environment variables specified at the top of the file, and fill in any other variables that don't have a default, including putting your AMI ID into the ami_id variable.
  5. Run terraform init.
  6. Run terraform plan.
  7. If the plan looks good, run terraform apply.
  8. Run the vault-examples-helper.sh script to print out the IP addresses of the Vault servers and some example commands you can run to interact with the cluster: ../vault-examples-helper/vault-examples-helper.sh.

To see how to connect to the Vault cluster, initialize it, and start reading and writing secrets, head over to the How do you use the Vault cluster? docs.