https://pulumi.com logo
p

prehistoric-nail-50687

01/11/2021, 4:03 PM
How do I convert
pulumi.Output<any>
to
pulumi.Output<string>
when getting an output from a
StackReference
?
Copy code
const infra = new pulumi.StackReference(`infra`);
const dbUser = infra.getOutput("dbUser"); // is of type pulumi.Output<any> but should be pulumi.Output<string>
do I really have to do this?:
Copy code
const dbUser = infra.getOutput("dbUser") as pulumi.Output<string>;
b

boundless-airport-99052

01/11/2021, 7:32 PM
yes, you have 😉
only you can know the real type
p

prehistoric-nail-50687

01/11/2021, 7:58 PM
ok, thanks!