This message was deleted.
# general
s
This message was deleted.
b
you don't need the
get
property at the end there, I think
b
ya, tried without
get
which gives me of
Output
, this can't be passed to the
provider
property because
provider
is not
Input
type
b
You’re going to want your stack output to be the information you need to build the provider instead of the provider object
b
Sorry I don't fully understand your suggestions, I am using K8S Cluster Provider in the project A, therefore I want to reuse it in project B just like passing variables. Are you saying I must create a
provider
thing to achieve that?
Hi @bored-oyster-3147 Thanks for pointing this out, well actually this is how I implement it in my first version. If that's the only way to do so, then I must get information below to construct a
K8s.Provider
object, which totally makes sense as this is how I use it in project A anyway. 1. endpoint 2. masteAuth 3. cluster name Since the
StackReference
provide access to output value, I was thinking of accessing the
ClusterProvider
object directly instead of constructing it the same way I did in project A. Are you saying that it is not possible to directly reference an output from StackReference?
b
I’m saying look at the ProviderArgs class. It accepts Input<T> values which means you can use Outputs to construct it. So instead of outputting the Provider itself in Project A, output the values that you need to construct it and then instantiate a new instance of the Provider in project B.
b
I see, that's exactly what I mentioned above. Although I know could definitely work for sure, doing so would have to create redundant object across different stack(which is not a big deal tho). I was trying to directly use the output of project A in project B as if they are in a single project. But if you are indicating there is no way to do that, I am happy to use my first implementation then. Thank you
b
The Provider object is not a resource that is represented in cloud so personally I see no problem with creating it twice. It’s more of an ephemeral object than anything
👍 1
But in the event that it was a cloud represented object, I still would prefer the route of outputting an ID and doing one of the Get methods
b
make sense
thank you so much