sparse-intern-71089
09/25/2019, 8:44 AMrhythmic-finland-36256
09/25/2019, 10:12 AMrhythmic-finland-36256
09/25/2019, 12:24 PMprovider
in my pulumi program passing the configuration (as you would do it with a kubernetes
provider - using the connection string in my case) and then instantiating several resources like User
, Grant
that use this provider. Is there a way to do this like we do it with the third param of the resource constructor (ComponentResourceOptions
)? For the dynamic resource provider it looks a bit more like a 1-to-1 mapping between resource and provider. Are there samples for such a setup or is my case already getting more complicated that I should consider building it as a binary provider or use a simpler concept if going the dynamic way?calm-table-93204
09/25/2019, 1:10 PMrhythmic-finland-36256
09/25/2019, 1:18 PMgray-nest-70702
09/25/2019, 2:18 PMrhythmic-finland-36256
09/25/2019, 2:26 PMrhythmic-finland-36256
09/25/2019, 2:28 PMResource
. (see super(myprovider, ...)
.gray-nest-70702
09/25/2019, 2:29 PMfuture-barista-68134
09/25/2019, 2:31 PMShould I instantiate the provider from my script with the credentials and pass it into my resources?Use environment variables if possible, otherwise you could save the credentials as pulumi config and pass them into the props when creating each custom resource.
Is there always a 1-to-1 relation between resource and provider when working with dynamicproviders?I believe this is the case, yes. You might be able to get away using case statements checking on the resource type but wouldn't be elegant.
rhythmic-finland-36256
09/25/2019, 2:31 PMconst mssqlProvider = new MssqlProvider(connstr);
const user = new MssqlUser(username, { ... }, {provider: mssqlProvider};
const grant = new MssqlGrant(grantname, { username: user.name, ... }, {provider: mssqlProvider};
So I want to specify the connectionString once and reuse it as I do with a kubernetesProvider
too.rhythmic-finland-36256
09/25/2019, 2:33 PMCustomResourceOptions
already allow specifying a provider, but this somehow conflicts with the one passed as first argument?! super(myprovider, name, { myStringOutput: undefined, myNumberOutput: undefined, ...props }, opts);
rhythmic-finland-36256
09/25/2019, 2:37 PMazure.sql.SqlServer
I created one step before (which in turn relies on a random generated password).future-barista-68134
09/25/2019, 3:39 PMfuture-barista-68134
09/25/2019, 3:47 PMrhythmic-finland-36256
09/25/2019, 3:48 PMrhythmic-finland-36256
09/25/2019, 3:49 PMprovider
field but this doesn’t seem to be used in the dynamic case.future-barista-68134
09/25/2019, 3:55 PMfuture-barista-68134
09/25/2019, 3:57 PMSo this seems okay if you think of a dynamic provider to be used only once, so it may reference some program-global variable for getting its config.You'd be able to create multiple resources, using the same auth this way, yeah