DEV Community

Cover image for Terraform Vault Basics
Ibrahim S
Ibrahim S

Posted on

Terraform Vault Basics

Hashicorp is a software company that provides infrastructure management and automation tools.

Its most popular product is the open-source tool Terraform, which allows users to automate the process of creating, changing, and versioning infrastructure.

Hashicorp also provides other tools for infrastructure automation and management, such as Vagrant, Packer, and Vault.

  1. Create a Ec2 machine
  2. Install packages
  3. Install Vault
  4. Start Vault

Install gpg
sudo apt update && sudo apt install gpg

Download the signing key to a new keyring
wget -O- https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg

Verify the key's fingerprint
gpg --no-default-keyring --keyring /usr/share/keyrings/hashicorp-archive-keyring.gpg --fingerprint

Add the HashiCorp repo
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list

sudo apt update

Finally, Install Vault
sudo apt install vault

To start Vault
vault server -dev -dev-listen-address="0.0.0.0:8200"

Open another terminal on your vm machine and export the variables.

Check the Web

http://34.231.241.99:8200

Enter the credentials and copy the root token code

Enabled the search engine

Create a Secret and save

Give to the permission other's click on enable new method

Click approle

Top comments (0)