https://pulumi.com logo
#typescript
Title
# typescript
w

wooden-room-54680

06/30/2019, 8:47 PM
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

white-balloon-205

06/30/2019, 11:52 PM
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

wooden-room-54680

07/01/2019, 7:20 PM
That answered it! Thanks, I missed that section when reading it.