3

Here is my code in index.ts

    import {Key, ServiceAccount} from "@pulumi/google-native/iam/v1";

    const serviceAccountKey = new Key('service-account-key-' + new Date().toISOString(), {
      serviceAccountId: serviceAccount.email
    });

    export const serviceAccountKeyStr = serviceAccountKey.privateKeyData.apply(
    async privateKeyData => {
      console.log("========privateKeyData=========",privateKeyData);
    return privateKeyData;
    }

but the output is

========privateKeyData========= undefined


what's wrong with my code ?

I want to update my google cloud IAM service Account key with Pulumi. but serviceAccountKey.privateKeyData is null. however others params is not null(eg:serviceAccountKey.name & serviceAccountKey.serviceAccountId ...)

so,I really want to know why it is

1 Answers1

0

Finally, I fix this by my colleague. There are some problems in the package above @pulumi/google-native/iam/v1 ,so just use another package @pulumi/gcp. The Example is :https://www.pulumi.com/registry/packages/gcp/api-docs/serviceaccount/key/