I'm running into difficulties with async functions...
# general
e
I'm running into difficulties with async functions in typescript with Pulumi CLI
Copy code
19 async function getServiceAccountAuth() {
 20   const secret = await aws.secretsmanager.getSecretVersion({
 21     secretId: "some-secret-name",
 22   });
 23   const secretString = secret.secretString
 24   console.log("SECRETSTRING: "+secretString);
 25
 26   let username: string = JSON.parse(secretString)["username"];
 27   let password: string = JSON.parse(secretString)["password"];
 28
 29   console.log("username: " + username);
 30
 31   return "Basic " + new Buffer(username + ":" + password).toString("base64");
 32 }
When I run that function I get this:
Copy code
error: Plan apply failed: Program run without the `pulumi` CLI; this may not be what you want (enable PULUMI_TEST_MODE to disable this error)
What am I doing wrong?
w
Are you still seeing this? I am surprised it is possible to hit this error with the code you shared.
e
I want able to get things fully working so I ended up installing the aws-sdk to work with the secrets, and then create my custom resource as a callback with the already retrieved secret value.