I am getting an error while building a dynamic Res...
# general
f
I am getting an error while building a dynamic Resource but im not sure what exactly this means:
Error: Secret outputs cannot be captured by a closure.
I am passing in a
config.requireSecret(...)
as a parameter
im creating a dynamic provider to provision webhooks in Stripe and I need to pass in my Stripe API key, but I cannot figure out how to provide it
w
Not sure what language you are using, but this example works using a dynamic provider to which
config.requireSecret()
is passed as an input. https://github.com/MitchellGerdisch/pulumi-work/tree/master/pulumi-auditlog-export
f
@witty-candle-66007 Thank you! I am also use typescript. I'm going to take a look through this and try to figure out what i am doing wrong.
This was helpful and got me in the right direction. I think part of my issue is that
config.requireSecret
has a result of type
Output<string>
(which it is, immediately after calling
requireSecret
) but when it gets passed into my provider implementation, it is no longer a
Output<string>
.. it is a
string
and from your example, i found that I can just stick it right into an interpolated string and it works
So i am wondering if the
Output
was resolved prior to calling my providers implementation
w
Yes - Pulumi will lift Output<T> automatically when it can. Specifically discussed here: https://www.pulumi.com/docs/intro/concepts/inputs-outputs/#lifting And Inputs/Ouputs and Output<T> stuff generically covered here: https://www.pulumi.com/docs/intro/concepts/inputs-outputs/