https://pulumi.com logo
#typescript
Title
# typescript
l

limited-rainbow-51650

02/28/2020, 9:52 AM
I have this as my stack config, set via `pulumi config set --path pulumi:providers.gitlab --secret`:
Copy code
config:
  pulumi:providers:
    gitlab:
      secure: AAABAIAhjQk...
How can I retrieve the
gitlab
secret in Typescript code? I tried the following two ways: •
new pulumi.Config("pulumi").requireSecret("providers.gitlab")
new pulumi.Config("pulumi:providers").requireSecret("gitlab")
Neither of these two work.
m

microscopic-pilot-97530

02/28/2020, 4:59 PM
Copy code
const config = new pulumi.Config("pulumi");
const providers = config.requireSecretObject<{ gitlab: string }>("providers");
providers.apply(p => p.gitlab);
💯 1