Hey everyone! Sorry if it's double posting, but th...
# aws
f
Hey everyone! Sorry if it's double posting, but though it'd be more appropriate to ask here. Is it possible to create an EKS managed node group via
eks.ManagedNodeGroup
from
@pulumi/eks
in a separate project from where the cluster was created (via
eks.Cluster
from
@pulumi/eks
)? From what it looks like in the API docs and the code itself, ManagedNodeGroup requires a direct cluster object, and its various properties, as well as it uses the same cluster for the
parent
property. I have tried a magnitude of things to simulate this behaviour via
StackReference
kubeconfig and providers, but to no avail. I am at my wit's end quite frankly. references: https://github.com/pulumi/pulumi-eks/blob/master/nodejs/eks/nodegroup.ts#L842 https://www.pulumi.com/docs/guides/crosswalk/aws/eks/
p
It’s probably going to be hard to pass a
Cluster
object via a
StackReference
. Maybe there’s another way? I’m not sure what your goal is, but supposing you wanted to make the
ManagedNodeGroup
optional, you could create a ComponentResource with an
eks.Cluster
object a required argument, and publish it as a module. Then, in your main program, create it based on a conditional:
Copy code
if ( args.createManagedNodeGroup ) {
  new MyManagedNodeGroup('name', {cluster: cluster, ...}, {opts});
}
Then you have something reusable.