UnauthorizedOperation AWS Origin: Platform & cloud OSI layer 7 · Application Last updated 12 Oct 2026

An error occurred (UnauthorizedOperation): You are not authorized to perform this operation. Encoded authorization failure message: ...

The IAM identity is missing an EC2 (or related) permission. The encoded message tells you exactly which action and resource were denied.

Exact message you may see You are not authorized to perform this operationEncoded authorization failure message
Seen on: AWS

Meaning

EC2 hides the details in an encoded string. Decode it with sts decode-authorization-message (that also needs permission) to see the action, resource and which policy (identity, SCP, permission boundary) denied it.

Common causes

  • IAM policy lacks the ec2:* action
  • Explicit Deny in an SCP or permission boundary
  • Condition (region, tag, MFA) not met
  • Using a different role/profile than expected

⚡ Quick fix

  1. Decode the message to see the denied action
  2. Add the action to the role’s policy (least privilege)
  3. Check SCPs/boundaries if the policy looks right

Detailed fix by platform

AWS CLI

  1. aws sts decode-authorization-message --encoded-message "$MSG" --query DecodedMessage --output text | jq .

How to diagnose

  1. Identity — aws sts get-caller-identity
  2. Action — From the decoded message
  3. Deny source — Identity policy, SCP, boundary, condition

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Platform & cloud. Errors that are often confused with or caused by this one (click to open):

AccessDenied — AWS S3: AccessDenied (403) when calling GetObject / PutObject (AWS)AccessDeniedIAM AccessDeniedException — AccessDeniedException: User: arn:aws:iam::... is not authorized to perform: service:Action on resource: ... (AWS)IAM AccessDeniedExcep…Instance reachability check failed — EC2 status check failed: Instance reachability check failed (1/2 checks passed) (AWS)Instance reachability…InsufficientInstanceCapacity — InsufficientInstanceCapacity: We currently do not have sufficient capacity in the Availability Zone you requested (AWS)InsufficientInstanceC…InvalidAMIID.NotFound — InvalidAMIID.NotFound: The image id '[ami-xxxx]' does not exist (AWS)InvalidAMIID.NotFoundInvalidKeyPair.NotFound — InvalidKeyPair.NotFound: The key pair 'x' does not exist (AWS)InvalidKeyPair.NotFou…KMS AccessDenied kms:Decrypt — KMS: not authorized to perform: kms:Decrypt (or the key policy does not allow access) (AWS)KMS AccessDenied kms:…PERMISSION_DENIED — PERMISSION_DENIED: The caller does not have permission (insufficient permissions) (Authentication)PERMISSION_DENIEDUnauthori…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.