Keys / AWS

AWS_SECRET_ACCESS_KEY

The secret half of an IAM access key. Your app signs AWS requests with it and AWS_ACCESS_KEY_ID.

Expires
never
API
create, list, deactivate and delete, with IAM permissions

Get it

Create one on console.aws.amazon.com/iam. The steps aren't recorded yet.

Set it

AWS_SECRET_ACCESS_KEY=...

The AWS CLI and the SDKs for Python (boto3), JavaScript, Go and Java read it, with AWS_ACCESS_KEY_ID, when you don't pass credentials. Or keep it out of .env with keypin: keypin run -- npm run dev

Replace it

  1. Create a second access key for the same IAM user. A user can have two.
  2. Deploy the new AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY everywhere that uses the old pair.
  3. Check the old key's Last used date, then deactivate it instead of deleting it. If something breaks, reactivate it and update that app.
  4. Once everything works with the new key, delete the old one. keypin rotate creates the new key, saves both values and publishes them, with an admin IAM user that may create, update and delete access keys. Check that nothing still uses the old key before you approve its revocation: keypin deactivates it, then deletes it right away.
Sources, checked 2026-11-16