I am attempting to create an EC2 instance and get the following error message. How do I decode it ?
Launch Failed
You are not authorized to perform this operation. Encoded authorization failure message: KDmmJmkLKmQhatEqYt...MN3iUtfAa
I am attempting to create an EC2 instance and get the following error message. How do I decode it ?
Launch Failed
You are not authorized to perform this operation. Encoded authorization failure message: KDmmJmkLKmQhatEqYt...MN3iUtfAa
use the following aws cli command from the console or CloudShell:
aws sts decode-authorization-message --encoded-message KDmmJmkLKm...iUtfAa
I use the following command:
aws sts decode-authorization-message --encoded-message 'KDmmJmkLKm...iUtfAa' | sed 's/\\"/"/g' | sed 's/^"//' | sed 's/"$//'
For better flattening and more readable format try
msg='encoded message'
aws sts decode-authorization-message --encoded-message "$msg" --output text | sed 's/,/\n\r/g' | sed 's/{//g' | sed 's/}//g' | sed 's/"//g'
To add on, you can further decode your message into a proper JSON format using the following:
aws sts decode-authorization-message --encoded-message KDmm..sA | jq -r .DecodedMessage | jq
I had the same issue. I was learning to create EC2 instances with Terraform but kept getting the same error message as yours.
I created a new access key
, and secret key
. Updated the main.tf
file and boom
the instance was running.