Explicitly set output --json for aws call

This commit is contained in:
Quinn Stevens
2020-07-31 20:30:20 +01:00
parent e58d8cbc8d
commit 93c89530ff

View File

@@ -24,7 +24,7 @@ extra737(){
if [[ $LIST_OF_CUSTOMER_KMS_KEYS ]];then
for key in $LIST_OF_CUSTOMER_KMS_KEYS; do
CHECK_ROTATION=$($AWSCLI kms get-key-rotation-status --key-id $key $PROFILE_OPT --region $regx --output text)
CHECK_STATUS=$($AWSCLI kms describe-key --key-id $key $PROFILE_OPT --region $regx | jq -r '.KeyMetadata.KeyState')
CHECK_STATUS=$($AWSCLI kms describe-key --key-id $key $PROFILE_OPT --region $regx --output json | jq -r '.KeyMetadata.KeyState')
if [[ $CHECK_STATUS == "PendingDeletion" ]]; then
textInfo "$regx: KMS key $key is pending deletion and cannot be rotated" "$regx"
elif [[ $CHECK_ROTATION == "False" ]]; then