Yes - `get_caller_identity` is the answer to how t...
# general
w
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
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
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
you are right, assigning
get_caller_identity().account_id
to a variable and just using that works. thank you!