Skip to main content


Rotate access keys every 30 days or less


Access keys consist of an access key ID and secret access key, used to sign programmatic requests that you make to AWS. AWS users need their own access keys to make programmatic calls to AWS from the AWS Command Line Interface (AWS CLI), Tools for Windows PowerShell, the AWS SDKs, or direct HTTP calls using the APIs for individual AWS services. Best practices recommend that all access keys be regularly rotated.


Perform the following to rotate access keys:

  1. Log in to the AWS Management Console.
  2. Click Services.
  3. Click Identity and Access Management (IAM).
  4. Click Users.
  5. Select a user.
  6. Click Security Credentials.
  7. As an Administrator, click Make Inactive for keys not rotated in 30 days.
  8. As an IAM User, click Make Inactive or Delete for keys not rotated or used in 30 days.
  9. Click Create Access Key.
  10. Update programmatic call with new Access Key credentials.

Using the AWS CLI:

  1. Create a second access key:

    aws iam create-access-key

  2. Update all applications and tools to use the new access key.

  3. Check if the first access key is still in use:

    aws iam get-access-key-last-used

  4. If the first access key is no longer in use, change the state of the first access key to Inactive:

    aws iam update-access-key

  5. Use the new access key to confirm that applications are working.

  6. Allow all applications and tools time to update, then delete the first access key:

    aws iam delete-access-key