Export to ~/.aws/credentials
If you need to export your new temporary credentials to your ~/.aws/credentials file you can use Granted’s --export flag.
To export session credentials to the ~/.aws/credentials file, run the following command (replacing role-a with the name of the profile you’d like to assume):
assume role-a --exportWill add the role into your AWS credentials file under the profile name you have assumed in the following format:
[<profile_name>]AWS_ACCESS_KEY_ID=<access key>AWS_REGION=<region>AWS_SECRET_ACCESS_KEY=<secret>AWS_SESSION_TOKEN=<token>