https://pulumi.com logo
#dotnet
Title
# dotnet
g

great-postman-59271

03/31/2020, 6:30 AM
i've run into troubles doing something which must be completely trivial. Im making an AWS stack where i need to get the AWS Account Number of the current account, so something i could get by GetCallerIdentity. I can see this object exists in the SDK, but somehow i cant find i locally. Maybe i am trying to invoke it in a wrong fashion. So can anyone tell me how to Get Caller Identity correctly? 🙂 Using latest pulumi version
t

tall-librarian-49374

03/31/2020, 7:37 AM
Something like this:
Copy code
var identity = Output.Create(Pulumi.Aws.Invokes.GetCallerIdentity());
var accountNumber = identity.Apply(i => i.AccountId);
g

great-postman-59271

03/31/2020, 7:50 AM
i KNEW it would be something simple, but just had the wrong approach. Thanks for helping out, i got it working using your example! 👍 😄