I couldn't find how to get the user name (the name...
# general
a
I couldn't find how to get the user name (the name of the entity who executed the
pulumi up
command, namely the CLI identity..) I found
GetCallerIdentity.InvokeAsync().GetAwaiter().GetResult().UserId
, but couldn't find the actual user's name. I want to add a transformation that adds a
by
tag with the executor name. Any idea how to do so in C# and AWS?
s
does anything show up with the
Arn
property? sometimes the caller is an assumed role instead of an AWS user so wondering if that's why
UserId
is blank
a
UserId
isn't blank - it's a 21-alphanumeric-chars (all upper letters)
s
oh i see. perhaps you can extract the username from the
Arn
assuming that has the user's Arn? If not you'll need to do a lookup of the AWS User using the UserId and get the name that way. Pulumi's
GetUser
function unfortunately only takes a Username, not the canonical UserId, so you might need to use a non-Pulumi AWS SDK to do this
a
I see. Ok,
Arn
it is, then 🙂 thanks!
p 1