If a resource component requires 2 AWS providers h...
# general
g
If a resource component requires 2 AWS providers how can I reference that in the component's code? I know that
ResourceOptions
has a
providers
argument
Copy code
opts = ResourceOptions(providers={"prov-name": provider_resource})
Is this the correct way to reference the provider?
Copy code
opts.providers["prov-name"]
I wonder what error I get if the
providers
dict does not contain the required provider - I assume it's general
KeyError
right?
b
I would pass them in either as two separate parameters or a dictionary / array. Then reference them like:
Copy code
opts = ResourceOptions(provider=provider_array[0])
g
Yes two separate parameters was my first go to. I got puzzled by the
providers
being an
dictionary / array
- which mixes 2 completely different structures when it comes to access to the items. I'll make the provider/s an explicit parameter