Instance type: t4g.micro
Instance specs:
- vCPUs: 2
- Memory (GiB): 1 GiB
- On-Demand hourly cost: 0.0084
- 1YR Std reserved hourly cost: 0.0053
- Monthly cost: $4.67
-
Set your AWS credentials as environment variables:
AWS_ACCESS_KEY_ID
andAWS_SECRET_ACCESS_KEY
-
If you want to change the instance type set the Terraform variable value in a file named terraform.tfvars
# EC2 Instance Type instance_type = "t4g.micro"
-
Run Terraform:
# Pull necessary plugins $ terraform init $ terraform plan $ terraform apply -auto-approve
-
Run Ansible to provision Vault Server
$ ansible-playbook -i "hosts" provisioning.yml
-
On the server instance, run the following commands:
# Initialize Vault $ vault operator init -stored-shares=1 -recovery-shares=1 \ -recovery-threshold=1 -key-shares=1 -key-threshold=1 > key.txt # Vault should've been initialized and unsealed $ vault status # Log in with initial root token $ vault login $(grep 'Initial Root Token:' key.txt | awk '{print $NF}')
-
Clean up
$ terraform destroy -force $ rm -rf .terraform terraform.tfstate*