Determine Identity of IAM user executing the CDK deploy

1

I would like to get the identity of the IAM user that is executing the CDK deploy so that I can make that user one of the admins for the KMS Key the CDK app creates.

When using the AWS CLI we can run "$ aws sts get-caller-identity" to determine what IAM user is executing the command. What is the equivalent of doing that in the CDK?

Thank you.

gefragt vor 2 Jahren1005 Aufrufe
1 Antwort
0

From https://docs.aws.amazon.com/cdk/v2/guide/cli.html#cli-environment: "CDK uses credentials from the same sources files as other AWS tools and SDKs, including the AWS Command Line Interface" so that same command will get what you need. Note that you can also specify a role by passing it with -r

AWS
SeanM
beantwortet vor 2 Jahren

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen