DEV Community

Cover image for Stop guessing why AWS says AccessDenied: authorization IDs explained
Sascha Mirow-Stanitzok
Sascha Mirow-Stanitzok

Posted on Originally published at sascha-ms.de

Stop guessing why AWS says AccessDenied: authorization IDs explained

It is late afternoon, the deploy went through, and the first real request to your Lambda function fails with a single line in the log: "is not authorized to perform". What follows is usually a guessing game. Is the role missing a statement? Does a service control policy block the call? Is it the permissions boundary, or the policy on the queue itself? In larger AWS organizations, this question tends to bounce between the developer and the platform team for a while.

That is the situation IAM Access Troubleshooter addresses. AWS announced it on November 17, 2026, and I tested it with a small Serverless example. The full walkthrough with all code is in my article Debug AccessDenied errors with IAM Access Troubleshooter. Here I want to give you the core idea and the parts that changed how I handle these errors.

The key: an authorization ID in the error message

For supported APIs, an AccessDenied message now carries an extra piece of information: an authorization ID, plus a direct link into the IAM console. With this ID you can retrieve the complete evaluation of the denied request through two new APIs:

  • GetRequestAuthorizationDetails returns every evaluated pair of action and resource, each with a result such as ALLOW, IMPLICIT_DENY or EXPLICIT_DENY, broken down into individual checks.
  • GetRequestAuthorizationPolicy shows the content of one involved policy exactly as it was when the request was denied, even if someone has changed it since.

The checks are what make this useful. They walk from the organization level (SCPs, RCPs) through resource policies and permissions boundaries down to the session. An implicit deny in the PRINCIPAL check almost always means your role simply lacks an allow. An explicit deny in SERVICE_CONTROL_POLICY tells you right away that no change to your role will help and that you need to talk to whoever manages the organization.

What I would do right now

The most important practical detail is time: AWS keeps the details for at least 24 hours. If an alarm fires at night and someone looks at it the next afternoon, that window is tight. So my main takeaway is to log the ID as a separate structured field the moment the error happens. A simplified version of the idea:

const match = /authorization id:\s*([A-Za-z0-9_-]{8,})/i.exec(err.message);
console.error(JSON.stringify({
  level: "ERROR",
  type: "AccessDenied",
  operation: "sqs:SendMessage",
  authorizationId: match?.[1],
}));
throw err;
Enter fullscreen mode Exit fullscreen mode

With that field in place, a saved CloudWatch Logs Insights query lists all recent denials with their IDs, and you can go straight to the console link or the CLI. The original article contains the complete helper module (which also parses the console link and recognizes different error names across services), the handler, tests and a small TypeScript script that pages through the details and prints only the denied checks with their policies.

Limits worth knowing

A few things tempered my enthusiasm a bit:

  • Service coverage: At launch, nine services return an authorization ID for at least some APIs, including SQS, Step Functions, KMS and STS. Lambda, DynamoDB and S3 are not on the list yet.
  • No guarantee: The ID can be missing for very large evaluations, for unsupported APIs and for requests a service makes on your behalf.
  • Regional APIs: You have to query the Region where the error occurred. Asking the wrong Region returns "not found", and asking too early can fail too, because the details are recorded asynchronously.
  • Sensitive permissions: iam:GetRequestAuthorizationDetails and iam:GetRequestAuthorizationPolicy expose policy content and context values. Grant them only to roles that actually debug.

Still, I consider this one of the most useful AWS additions this fall, precisely because AccessDenied is such an everyday error. Adding the structured logging costs a few lines now and pays off as soon as more services are supported.

What the full article covers

  • A complete Serverless Framework v4 example (a fictional bike rental with SQS) that provokes and then fixes a real AccessDenied
  • How to read the details in the console and with the AWS CLI, including the relevant JSON fields
  • A TypeScript script with retries and pagination that explains which check denied the call
  • Common mistakes, security considerations and a short FAQ

Read it here: Debug AccessDenied errors with IAM Access Troubleshooter

📖 This is the condensed version. The full article on sascha-ms.de goes deeper – with all code samples, diagrams and a short knowledge check.


👉 Next step: Not sure which AWS service fits your use case? My AWS service finder asks a few questions and points you to the right one.

📬 Stay updated: New articles on serverless, AI and leading tech teams via RSS, browser push or the weekly newsletter (in German).

Originally published on sascha-ms.de. More articles on serverless, AI in everyday development and leading tech teams: sascha-ms.de/en

Top comments (0)