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
- Create a second access key for the same IAM user. A user can have two.
- Deploy the new
AWS_ACCESS_KEY_IDandAWS_SECRET_ACCESS_KEYeverywhere that uses the old pair. - Check the old key's Last used date, then deactivate it instead of deleting it. If something breaks, reactivate it and update that app.
- Once everything works with the new key, delete the old one.
keypin rotatecreates 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
- IAM: Manage access keys for IAM users
- IAM: Update access keys
- IAM: Programmatic access with AWS security credentials
- IAM API: CreateAccessKey
- IAM API: UpdateAccessKey
- AWS CLI: Environment variables
- AWS SDKs and Tools: AWS access keys
- botocore: reads AWS_SECRET_ACCESS_KEY
- aws-sdk-js-v3: reads AWS_SECRET_ACCESS_KEY
- aws-sdk-go-v2: reads AWS_SECRET_ACCESS_KEY
- aws-sdk-java-v2: reads AWS_SECRET_ACCESS_KEY