Hi. How can I specify the credentials inside the p...
# general
e
Hi. How can I specify the credentials inside the program. I am gonna using a different env var: https://www.pulumi.com/registry/packages/hcloud/installation-configuration/#configuring-credentials
o
@echoing-activity-32278 if you don't want to use the predefined environment variables or configuration keys, you'll need to create an explicit provider with the auth config: https://www.pulumi.com/registry/packages/hcloud/api-docs/provider/ And pass that provider to all resources you wish to use it with, see: https://www.pulumi.com/docs/intro/concepts/resources/providers/#explicit-provider-configuration
e
Is it possible to configure the DEFAULT provider?
o
Yes, but only via environment variables or config file.
e
Sounds like so. That is where my question coming from .
I am using the python library. If you happen to know, how can I monkey patch and bypass this restriction?
o
I'm not sure, if you were to do that, there's no guarantee it would continue to work - you'd be relying on internals.
Can I ask what problem you'd be solving by doing this? That using either Pulumi config or the HCLOUD_TOKEN env var cannot solve.
e
I’d like to use the environment variable approach. But I dpm
i don’t want to mess up between stg/prod envs. So better name it as HCLOUD_TOKEN_STG and HCLOUD_TOKEN_PROD
o
I see, I can recommend using the Pulumi config approach then! You can set your prod stack to one value, and your staging stack to the other.