rich-branch-48115
01/03/2023, 2:21 PMk8s.Cluster
object from the first program into the second program that creates several virtual clusters inside the cluster from the first program.
My questions are:
• Is it possible to share the object as it is?
• Is it possible to share my own custom ResourceComponents
?
• To implement that I need to have multiple stacks?billowy-army-68599
Is it possible to share the object as it is?Yes, just export the type. In typescript this would be
export const cluster = k8s.Cluster(...
Is it possible to share my own custom ResourceComponentsYou can easily reshare ComponentResources using whatever abstraction mechanism your chosen language uses
To implement that I need to have multiple stacks?Can you elaborate on this question?
rich-branch-48115
01/03/2023, 2:54 PMResourceComponents
between them do I need to have multiple stacks as well?
I'm trying to avoid calling the same ResourceComponent Type with the same resource name in order to share it.
@billowy-army-68599billowy-army-68599
You mean exporting the object?Yes that works too
cluster = k8s.Cluster
pulumi.export("cluster", cluster)
I meant that if I want to have multiple pulumi programs (let’s say 2) that shares ResourceComponents between them do I need to have multiple stacks as well?Yes, each Pulumi program has
n
stacks. So in this case you’d have perhaps two projects:
• cluster
• app
and each one of those projects would have a stack each, maybe called dev
that shares ResourceComponents between themCan you explain what you mean by “sharing” ? referencing the results of one project from another?
rich-branch-48115
01/03/2023, 4:19 PMbillowy-army-68599
rich-branch-48115
01/04/2023, 9:21 AMmyCustomCluster = cluster_stack.get_output("sharedCluster")
def create_vcluster():
when I'm getting a warningbillowy-army-68599