# Access key rotation

Facts read 16 Nov 2026. Page reviewed 16 Nov 2026.

Access key rotation is replacing an IAM user access key with a new one and deleting the old one on a schedule. It limits how long a leaked key stays valid, and AWS advises avoiding long-term keys where roles can be used instead.

## An example, sourced

AWS documentation says an IAM user can have a maximum of two access keys, which allows a second key to be created before the first is deleted, and says to use temporary credentials instead of access keys as a best practice.

## Why it matters here

Rotation shortens exposure but does not narrow what a key can do. Removing the key in favor of a role removes the problem.

## Related pages

- [MFA condition: meaning and an example](/glossary/mfa-condition/)
- [Data perimeter: meaning and an example](/glossary/data-perimeter/)
- [Built-in role: meaning and an example](/glossary/built-in-role/)
- [All of them](/glossary/)

## Sources

- https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html (read 16 Nov 2026)

Last reviewed 16 Nov 2026. Canonical: https://leastprivilegeprinciple.com/glossary/access-key-rotation/
