HC-vault-on-aws-FORK/files/vault_credentials_template.sh

12 lines
595 B
Bash
Raw Normal View History

#!/bin/bash
# This grabs the encrypted credentials file and decrypts it.
2020-04-15 20:45:57 +00:00
aws --profile ${AWS_PROFILE} --region ${AWS_REGION} s3 cp s3://${AWS_S3_BUCKET}/vault_creds_encrypted ./temp/vault_creds_encrypted
aws --profile ${AWS_PROFILE} --region ${AWS_REGION} kms decrypt --key-id ${AWS_KMS_KEY_ID} --ciphertext-blob fileb://temp/vault_creds_encrypted --output text --query Plaintext | base64 --decode > ./temp/vault_creds_decrypted
2020-04-16 03:26:52 +00:00
2020-04-18 18:00:12 +00:00
echo ""
2020-04-16 03:26:52 +00:00
echo "Vault crednetials decrypted. Find them at ./temp/vault_creds_decrypted"
echo "----"
2020-04-18 18:00:12 +00:00
echo "Load Balancer DNS Name: ${LOAD_BALANCER_DNS_NAME}"
echo ""