Skip to content
Least Privilege Principle

Access key rotation

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.

All terms ยท Open the calculator

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.

Sources

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

Last reviewed 16 Nov 2026.