Should I have to be typecasting everything from a ...
# general
e
Should I have to be typecasting everything from a StackReference in TS? Here's an example:
Copy code
const otherstack = new StackReference("org/project/stack");

export const network = otherstack.getOutput("network") as unknown as azure.network.VirtualNetwork
export const primaryProvider = otherstack.getOutput("primaryProvider") as unknown as azure.Provider
export const resourceGroup = otherstack.getOutput("resourceGroup") as unknown as azure.core.ResourceGroup
This is the only way I could get the TS to compile, but I'm also having difficulty using these (the provider doesn't work as a provider for creating a new k8s cluster for example) so I have a feeling I'm doing something wrong
b
I don't think you can get the full object, you'd need to get the id of the resource, then do a
.get()
on that
e
so I can't export a Provider from one stack to be used by another?
ok, I see, I'd need the thing to create the Provider with, but create it in the other stack
thanks!