Determine Identity of IAM user executing the CDK deploy


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.

已提問 2 年前檢視次數 1118 次
1 個回答

From "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

已回答 2 年前

您尚未登入。 登入 去張貼答案。