Hi. I have a question about the difference between...
# python
b
Hi. I have a question about the difference between
require
and
require_secret
: I need to run a query against a database to determine what needs to be done in the rest of the pulumi script. I want to store the password for the database connection as a secret (
pulumi config set --secret db_password ...
). I notice that if I set a config value with
--secret
and then retrieve it with
require_secret
, I can't use the returned object to connect to the database, I get a type error:
Copy code
TypeError: <pulumi.output.Output object at 0x10feb3df0> has type Output, but expected one of: bytes, unicode
But if I retrieve the value using just
require
, then it works fine. So I'm a little confused about why I would use
require_secret
instead of
require
. What's the difference? What's going on here?
f
Hi Solomon, you post just ended half a day of work to try to find a solution.
So, either this is a FEATURE and the documentation here is wrong (https://www.pulumi.com/docs/intro/concepts/secrets/), or this is a BUG and the documentation is correct.
b
I think the answer is neither: the documentation seems to be incomplete on this matter.
f