AWS CDK - how to get the arn of the assumed user directly

Viewed 266

How do I get the arn of the assumed user who is going to deploy the CDK stack in CDK? The format that's in arn:aws:sts::accountID:assumed-role/AWSReservedSSO_AWSAdministratorAccess_xxxxxxxxxxxxxxx/user@email.com

e.g. the arn that appears when i run aws sts get-caller-identity

I tried to retrieve from the cdk library iam.Role.??? construct but none seems to have related to assumed role

1 Answers

I don't believe that's a feature supported by the CDK itself. However, you can import the AWS SDK and retrieve the value from the SDK and use it in your code.

Related