See https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-data-retrieval.html
curl http://169.254.169.254/latest/meta-data/iam/security-credentials/$EC2_MACHINE_NAME
{
"Code" : "Success",
"LastUpdated" : "2020-11-04T19:38:27Z",
"Type" : "AWS-HMAC",
"AccessKeyId" : "<redacted>",
"SecretAccessKey" : "<redacted>",
"Token" : "<redacted>",
"Expiration" : "2020-11-05T02:02:26Z"
}