Skip to content
Least Privilege Principle

Temporary credentials

Temporary credentials are short-lived keys issued by AWS Security Token Service that expire on their own, and they are the basis of IAM roles and federation. Because they expire, nobody has to revoke or rotate them. AWS says they can be requested again as long as the caller still has permission.

All terms ยท Open the calculator

An example, sourced

AWS documentation says temporary credentials can last from a few minutes to several hours, are generated dynamically when requested, and let you avoid embedding long-term AWS credentials in an application.

Why it matters here

A stolen temporary credential stops working at expiry. Replacing long-term keys with them cuts the time a leaked secret is useful.

Sources

  1. https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp.html, read 16 Nov 2026

Last reviewed 16 Nov 2026.