Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS EC2 'You are not authorized to perform this operation. Encoded authorization failure message:'

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

like image 844
jlo-gmail Avatar asked Feb 08 '21 22:02

jlo-gmail


People also ask

Which CLI command can help you to decode the encrypted error message oo authorization status of a request?

To decode an authorization status message you can use the AWS Command Line (CLI).

Why am I receiving the error message you are not authorized to perform this operation when I try to launch an EC2 instance?

The "UnauthorizedOperation" error indicates that permissions attached to the AWS Identity and Access Management (IAM) role or user trying to perform the operation doesn't have the required permissions to launch EC2 instances.

Could not describe instances UnauthorizedOperation You are not authorized to perform this operation?

The UnauthorizedOperation error occurs because either the user or role trying to perform the operation doesn't have permission to describe (or list) EC2 instances. The easy solution is to attach an Inline Policy, similar to the snippet below, giving the user access.


2 Answers

use the following aws cli command from the console or CloudShell:

aws sts decode-authorization-message --encoded-message KDmmJmkLKm...iUtfAa
like image 93
jlo-gmail Avatar answered Oct 18 '22 19:10

jlo-gmail


I use the following command:

aws sts decode-authorization-message --encoded-message 'KDmmJmkLKm...iUtfAa' | sed 's/\\"/"/g' | sed 's/^"//' | sed 's/"$//'
like image 3
Effie Avatar answered Oct 18 '22 19:10

Effie