https://pulumi.com logo
#general
Title
# general
h

high-grass-3103

05/15/2023, 8:32 AM
ResourceError: Do not supply 'providers' option to a CustomResource. Did you mean 'provider' instead?
No, I actually meant
providers
, why would you have a problem with it? I have a component that creates resources from different providers, one of them is a non-default kubernetes provider. I don't want to create AWS resources with the kubernetes provider, nor Kubernetes resources with AWS provider... Isn't that what
providers
is for?
export interface ComponentResourceOptions extends ResourceOptions {
/**
* An optional set of providers to use for child resources. Either keyed by package name (e.g.
* "aws"), or just provided as an array. In the latter case, the package name will be retrieved
* from the provider itself.
*
* Note: only a list should be used. Mapping keys are not respected.
*/
providers?: Record<string, ProviderResource> | ProviderResource[];
r

red-match-15116

05/15/2023, 5:06 PM
sounds like from the error that you're passing all of the providers through to the underlying resources, but only one would apply (k8s resource wouldn't use both k8s and aws providers)
h

high-grass-3103

05/16/2023, 8:26 AM
I only have one explicit provider, there's no way that I know of to explicitly pass a default provider. Any way, I just pass providers to the component and they should magically apply to the resources?
r

red-match-15116

05/16/2023, 4:52 PM
Any way, I just pass providers to the component and they should magically apply to the resources?
you could have multiple explicit aws providers for different regions because you have a cross-region component. it's not always clear how to map providers to resources so that has to be done by the user writing the component.
h

high-grass-3103

05/17/2023, 6:19 AM
So which part is this referring to?
* Note: only a list should be used. Mapping keys are not respected.
As a component implementer, I'd find it easier to use a map
6 Views