- Newest
- Most votes
- Most comments
How about leveraging the AWS STS API (AWS Security Token Service API) to programmatically request temporary credentials. The AssumeRole or GetSessionToken API calls can provide short-term credentials that you can store in your credentials file.
https://docs.aws.amazon.com/STS/latest/APIReference/welcome.html
Hey,
Hope you're keeping well.
If your organization issues short-term credentials via AWS SSO or STS, you can automate renewal using the AWS CLI or SDKs rather than manually copying from the console. For AWS SSO, run aws sso login and then use aws sso get-role-credentials to fetch and write credentials to your ~/.aws/credentials file. For STS-based flows, call sts:GetSessionToken or sts:AssumeRole with the appropriate IAM permissions, then update your local profile from the API response. Wrapping this in a script or scheduled task can refresh credentials before expiry without relying on manual console steps.
Thanks and regards,
Taz
answered 9 months ago

Perfect..!! That's exactly what I was looking for. Thank you.