Created
November 17, 2017 02:54
-
-
Save emalloy/f752b5e9a6eb7062098e491e5621f9cc to your computer and use it in GitHub Desktop.
kms_encrypt.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
if [ -z ${KMS_KEY_ID} ]; then | |
echo "KMS_KEY_ID unset! Exiting"; | |
exit 1 | |
fi | |
_INPUT=$1 | |
cat $_INPUT \ | |
| aws kms encrypt \ | |
--key-id=${KMS_KEY_ID} \ | |
--plaintext fileb://<(cat -) \ | |
--output text \ | |
--query CiphertextBlob \ | |
| base64 --decode > output.kms.yml |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment