Anyone know how to cast an Output<string> to...
# getting-started
b
Anyone know how to cast an Output<string> to a string? https://github.com/pulumi/pulumi/issues/7179
g
I am no expert here, but I was making a similar error starting out.
apply
does not return
String
it returns
Output<String>
you can only access the value of
key
within the callback. Usually this is not an issue as any arg can take type
Output<T>
as an input. However, it seems that you are assigning the config value
mySecret
to the name of the PrivateKey which is of type
string
. Is that what you intended to do? https://www.pulumi.com/docs/reference/pkg/tls/privatekey/#inputs
b
Yes that’s exactly it. I can’t change the argument to be an Output<string> in this instance (which is my normal trick) as I don’t have control of the PrivateKey class as it is part of the
@pulumi/tls
library