I'm setting up AWS Code Deploy for an on-premise machine. I'm following this guide and am using STS temporary credentials.
I can successfully retrieve credentals via:
aws sts assume-role --role-arn arn:aws:iam::<acct#>:role/<role-name> --role-session-name <session-name>
They are returned in the following format:
{
"Credentials": {
"AccessKeyId": "*****",
"SecretAccessKey": "*****",
"SessionToken": "*****",
"Expiration": "2021-03-05T00:55:32Z"
},
"AssumedRoleUser": {
"AssumedRoleId": "*****",
"Arn": "*****"
}
}
I need to reformat into an AWS credentials file that looks like this:
[default]
aws_access_key_id=*****
aws_secret_access_key=*****
aws_session_token=*****
How can I reformat the json object into the credentials file?