https://pulumi.com logo
Title
m

microscopic-animal-41955

09/17/2021, 4:23 PM
Is it possible to take an ASG that was created via an EKS cluster and modify it to be associated with an ALB? Basically what I want to do is manage an ALB outside of Kubernetes, but make sure that all of the nodes are part of the target group, regardless of any scale up/scale down events. I can get the ASG after the cluster has been created, but I can’t modify it
const asgName = onDemandNodeGroup.autoScalingGroupName;

  asgName.apply(name => {
    const asg = aws.autoscaling.Group.get(name, "onDemand-asg");
    asg.targetGroupArns = []; // can't set this, is readonly
  });
b

billowy-army-68599

09/17/2021, 4:31 PM
I think this will do what you need: https://www.pulumi.com/docs/reference/pkg/aws/alb/targetgroupattachment/ you'lll specify the instance ID, which you'll need to grab from the ASG
m

microscopic-animal-41955

09/17/2021, 5:05 PM
oooh thanks!! that makes sense 🙂