This message was deleted.
# aws
s
This message was deleted.
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.