pulumi / providertest

Incubating facilities for testing Pulumi providers
Apache License 2.0
5 stars 0 forks source link

Support secrets in config #84

Open blampe opened 4 months ago

blampe commented 4 months ago
    test := providertest.NewProviderTest(
                ...
        providertest.WithConfig("password", os.Getenv("PASSWORD")),
    )

If "password" is marked as a secret in config, e.g.

config:
  password:
    type: string
    secret: true

the test will fail with

error: validating stack config: Stack 'p-it-bryces-wor-yaml-b7f19499' with configuration key 'password' must be encrypted as it's secret

This is a good thing, since we don't want to accidentally leak any credentials! But we should probably expose a WithSecret option to allow passing encrypted config.