https://pulumi.com logo
#getting-started
Title
# getting-started
b

brash-airline-37413

06/01/2021, 4:53 AM
Anyone know how to cast an Output<string> to a string? https://github.com/pulumi/pulumi/issues/7179
g

gray-hamburger-90102

06/01/2021, 2:05 PM
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

brash-airline-37413

06/01/2021, 11:20 PM
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
3 Views