Inside an Amazon EC2 instance with an IAM role:
$ aws sts get-caller-identity
{
"Account": "999999999999",
"UserId": "AROA4AD2EEIE4XYIBOEYP:i-abcdefg12345678",
"Arn": "arn:aws:sts::999999999999:assumed-role/my-instance-iam-role/i-abcdefg12345678"
}
The IAM role session name is the instance ID.
Is there a way to update this session name on the fly? For example temporarily change the assumed role session name
arn:aws:sts::999999999999:assumed-role/my-instance-iam-role/i-abcdefg12345678/specialSession
Or even
arn:aws:sts::999999999999:assumed-role/my-instance-iam-role/specialSession
(no instance id)