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

elegant-carpet-8859

03/30/2021, 10:18 PM
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

billowy-army-68599

03/30/2021, 10:20 PM
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

elegant-carpet-8859

03/30/2021, 10:24 PM
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!