role_session_name - AWS SDKs and Tools


Specifies the name to attach to the role session. This name appears in AWS CloudTrail logs for entries associated with this session.


Default value: An optional parameter. If you don't provide this value, a session name is generated automatically if the profile assumes a role.

Valid values: Provided to the RoleSessionName parameter when the AWS CLI calls the AssumeRole operation on your behalf. The value becomes part of the assumed role user Amazon Resource Name (ARN) that you can query, and shows up as part of the CloudTrail log entries for operations invoked by this profile.


Ways to set this value

Location Supported Example
config file Yes
role_session_name = my-role-session-name
credentials file -
Environment variable -
AWS CLI parameter -

Compatibility with AWS SDKS and tools