What's the best practice for working with `Compone...
# typescript
w
What's the best practice for working with
ComponentResourceOptions.providers
? I see pulumi has an internal function
convertToProvidersMap
to convert from
Record<string, ProviderResource> | ProviderResource[]
to map, but it's not exported. I need to pass the provider to a kubernetes resource inside a component.
w
Resources inherit provider defaults from their parents. So if you set
parent: this
on the kubernetes resource inside the component, it will inherit the corresponding
provider
set on its parent component. Note that since components can have multiple relevant providers (because they may create resources of several types), they are provided as
providers: { “kubernetes”: kubeProvider }
. Ideally - the documentation here would address this: https://pulumi.io/reference/programming-model/#providers. If there is anything critical you don’t see there - let us know.
w
That answered it! Thanks, I missed that section when reading it.