awswrangler.sts.get_current_identity_name

awswrangler.sts.get_current_identity_name(boto3_session: Optional[boto3.session.Session] = None)str

Get current user/role name.

Parameters

boto3_session (boto3.Session(), optional) – Boto3 Session. The default boto3 session will be used if boto3_session receive None.

Returns

User/role name.

Return type

str

Examples

>>> import awswrangler as wr
>>> name = wr.sts.get_current_identity_name()