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
11 lines
514 B
TypeScript
11 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");
|