amazon-web-services

AWS credentials from 'Single Sign On' expire too frequently - how can I get credentials with a longer lifetime?


We automate various maintenance tasks using the AWS API. Frequently calls to AWS services fail with:

The security token included in the request is expired

I know I can visit AWS and get updated credentials:

enter image description here

But is there a way to get credentials with a longer lifetime? In order to properly automate our AWS tasks we need to not need to log in manually and fetch credentials every week or so.


Solution

  • The screenshots above are from AWS Single Sign-On - the keys presented are short lived. If you create an Access Key for an IAM User, then they are permanent credentials:

    An IAM User can have up to two active Access Keys, which is handy for rotating credentials. In addition, the keys can be limited to certain services on AWS (eg, RDS only).