Getting Current IAM Role
To get the current IAM role, use the get-caller-identity command:
aws sts get-caller-identityThis returns a response like the following:
{
"UserId": "user-id",
"Account": "aws-account-id",
"Arn": "sts-role-arn"
}