https://pulumi.com logo
Title
h

hallowed-printer-89159

11/23/2022, 8:38 PM
Hello folks, Can you help me, Anyone knows how to get the current user email with pulumi gcp
n

narrow-match-14013

11/25/2022, 4:50 PM
Do you mean the email address of the service account? You can do something like this:
const gcsAccount = await gcp.storage.getProjectServiceAccount({});
    gcsAccount.emailAddress
ah sorry thats specific to the storage account.
c

clever-sunset-76585

12/08/2022, 2:05 AM
I don't think there is a direct way. However, you could just exec a command from Pulumi and read the output from stdout. You should be able to do that with any of the language SDKs. For example,
gcloud auth list
(which also supports filters) or check if
core/account
is set using
gcloud config get core/account
. https://cloud.google.com/sdk/gcloud/reference/auth/list