1
0
mirror of https://github.com/dcarrillo/prezto.git synced 2024-12-22 17:28:01 +00:00

[aws] Add aws_kms_decrypt and aws_ssm_session functions

This commit is contained in:
daniel.carrillo 2019-10-24 14:56:20 +02:00
parent 91292526a0
commit b44893d9eb

View File

@ -71,3 +71,24 @@ function aws_ami {
aws ec2 describe-images --profile $profile --output ${_aws_output} \
--owner self --query 'Images[*].{id:ImageId,name:Name,virt:VirtualizationType,st:State}'
}
function aws_kms_decrypt {
local profile=$(_get_aws_profile)
if [[ -z $1 ]]; then
echo "String is missing"
return 1
fi
aws kms decrypt --ciphertext-blob fileb://<(base64 -d <<<$1) --output text --query Plaintext | base64 -d
}
function aws_ssm_session {
local profile=$(_get_aws_profile)
if [[ -z $1 ]]; then
echo "Target is missing"
return 1
fi
aws ssm start-session --target $1
}