Revoke role sessions

See the temporary credentials a role's token exchanges issued, and end every one that is still live.

Last updated 18 November 2026View as Markdown

Each exchange of an OIDC token for a role creates a session with its own temporary access key, live for at most one hour. Revoking ends them before they expire. Replace role-id with the role's id.

Prerequisites

  • To see the sessions: iam:GetRole on the role.
  • To revoke them: iam:RevokeRoleSessions on the role, and in the console also iam:GetRole to open the role's page. Without iam:RevokeRoleSessions, Revoke all is not shown.
  • In the console, also iam:ListRoles to open Roles (without it the list says you do not have permission to list roles).

See the sessions

  1. Open Identity, then choose Roles, and open the role.
  2. Choose Sessions.

The heading says how many credentials are live. The list shows the 10 newest sessions, each with the token's subject, the session name, its age, and live or expired.

The API answers with the sessions, newest first (limit 1 to 200, default 50), and active, the number of live credentials. Each new exchange removes the role's sessions that expired more than a day ago.

Revoke every live session

  1. On the role's Sessions tab, choose Revoke all.

The page says how many live credentials were revoked. Revoke all appears only while at least one credential is live.

Result

Every live session key of the role is deactivated at once, and temporary S3 credentials those sessions created are deleted. A request with a revoked key is refused with 401 Invalid or inactive access key. Revoking does not change the trust policy: a job that exchanges a new token gets a new session. To stop that too, remove or change the trust policy (see Set a trust policy).

Did this page help you?