pulumi/tests/integration/provider_secret_config/index.ts
Matt Ellis 4f693af023 Do not pass arguments as secrets to CheckConfig/Configure
Providers from plugins require that configuration value be
strings. This means if we are passing a secret string to a
provider (for example, trying to configure a kubernetes provider based
on some secret kubeconfig) we need to be careful to remove the
"secretness" before actually making the calls into the provider.

Failure to do this resulted in errors saying that the provider
configuration values had to be strings, and of course, the values
logically where, they were just marked as secret strings

Fixes #2741
2019-05-17 16:42:29 -07:00

12 lines
514 B
TypeScript

import * as pulumi from "@pulumi/pulumi";
// Regression test for [pulumi/pulumi#2741], you should be able to create an instance of a first class provider
// with secret configuration values, so long as these values are themselves strings.
class DynamicProvider extends pulumi.ProviderResource {
constructor(name: string, opts?: pulumi.ResourceOptions) {
super("pulumi-nodejs", name, { secretProperty: pulumi.secret("it's a secret to everybody") }, opts);
}
}
const p = new DynamicProvider("p");