limited-rainbow-51650
01/09/2020, 2:49 PMpulumi.ComponentResource
subclass, how can I define the opts
so I have the same VSCode IntelliSense as for the default Pulumi libs. Example could be handy. 😉busy-umbrella-36067
01/09/2020, 2:53 PMlimited-rainbow-51650
01/09/2020, 2:58 PMClusterOptions
interface?busy-umbrella-36067
01/09/2020, 3:10 PMclever-sunset-76585
01/09/2020, 4:31 PMCompomentResourceOptions
is used to pass some resource options to the Pulumi engine. I think Ringo is talking about components args with custom properties that are specific to the component only. If that's the case you can define a custom interface (similar to ClusterOptions
from your example above) and have that as an argument of your constructor in addition to also accepting ComponentResourceOptions
as a param as well. The latter will allow you to set things like provider
, parent
, dependsOn
etc.rhythmic-finland-36256
01/13/2020, 10:02 AMComponentResource
that internally creates resources with those standard providers. I ended up putting them in the args as for some cases (e.g. cert-manager) I need both, azure and kubernetes providers and I want to have them defined explicitly, not using the ambient (default) ones. Is this the intended way or should I have some special ComponentResourceOptions
that support more than one provider? For now I’m always passing providers explicitly but this might not be the case if I build some reusable library and people want to leverage their default providers.clever-sunset-76585
01/14/2020, 2:48 AMComponentResourceOptions
as one of the params of your component’s constructor and pass it there.
Here’s an example:
export class MyComponent extends pulumi.ComponentResource {
constructor(args: MyComponentArgs, opts: pulumi.ComponentResourceOptions) {
}
}
then you can use it as:
new MyComponent({}, {
providers:{
"azure": azureProvider,
"kubernetes": k8sProvider
}
});
Is this what you are asking about?rhythmic-finland-36256
01/14/2020, 8:42 AMproviders
besides the single provider
field. Does passing them as ComponentResourceOptions
to a ComponentResource
then automatically use them in all child resources without explicitly passing them to e.g. a kubernetes.Deployment
?busy-umbrella-36067
01/14/2020, 3:23 PMclever-sunset-76585
01/14/2020, 4:27 PMrhythmic-finland-36256
01/14/2020, 8:03 PMComponentResourceOptions
providers list. Everything I wanted to know was already well documented. That docs really rock 💪