Created
July 29, 2016 13:44
-
-
Save elblivion/63e93a805a1389c0b32f3dd03c70a354 to your computer and use it in GitHub Desktop.
AWS KMS for Chef data bags
This file contains hidden or 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
$ aws kms encrypt --key-id arn:aws:kms:us-east-1:<my_account>:key/<my_key> --plaintext $(cat ~/.chef/prod-secret) --query CiphertextBlob --output text | base64 -D > secret | |
$ aws kms decrypt --ciphertext-blob fileb://secret --output text --query Plaintext | base64 -D > decoded | |
$ if [[ "$(cat decoded)" == "$(cat ~/.chef/prod-secret)" ]]; then echo "got back original chef secret"; fi | |
got back original chef secret |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Source aws/aws-cli#1100 (comment)