hallowed-printer-89159
11/23/2022, 5:07 PM// Create a Key to allow SSH connection
const sshKeyPrivate = new tls.PrivateKey("bastion", {
algorithm: "RSA",
})
export const privateKey = sshKeyPrivate.privateKeyPem;
const privateKeyInterP = pulumi.interpolate `${privateKey}`;
fs.writeFileSync("key.pem", privateKeyInterP);
and this is the error on the key.pem
Calling [toString] on an [Output<T>] is not supported.
To get the value of an Output<T> as an Output<string> consider either:
1: o.apply(v => `prefix${v}suffix`)
2: pulumi.interpolate `prefix${v}suffix`
See <https://pulumi.io/help/outputs> for more details.
This function may throw in a future version of @pulumi/pulumi.
billowy-army-68599
11/23/2022, 5:13 PMpulumi.interpolate
like that, you can’t assign an output value to a string value. Try this
privateKey.apply((pem) => {
fs.writeFileSync("key.pem", pem);
})
hallowed-printer-89159
11/23/2022, 5:27 PM