https://pulumi.com logo
#general
Title
# general
w

white-balloon-205

11/28/2019, 12:52 PM
Yes -
get_caller_identity
is the answer to how to dynamically get the AWS account id. @broad-finland-69602 what question do you have on how to integrate that? You should just be able to call the function.
b

broad-finland-69602

11/28/2019, 1:25 PM
calling the function returns an AwaitableGetCallerIdentityResult. the question is to how to either parse that into a
string
or a pulumi Output would also be usable I guess. am I missing something asyncio related? maybe an example would help
"arn:aws:kms:eu-west-1:123456789:key/some-uuid-here"
<- for example getting my account in in there instead of 123456789
w

white-balloon-205

11/28/2019, 5:04 PM
This function returns its result synchronously - do you can just access the outputs directly on the result of the call. (The result is also an awaitables for backward compatibility - but you should not have to rely on that for new code).
b

broad-finland-69602

11/29/2019, 9:04 AM
you are right, assigning
get_caller_identity().account_id
to a variable and just using that works. thank you!