Reputation: 11
I'm trying to launch an application load balancer from java sdk. I noticed that I can add "Target Group" in "Step 4: Configure Routing" through the console but I don't know how to add a target group through code. There seems to be not function like "withTargetGroup".
I just can't find the right documentation which can show me some functions that I can try.
CreateLoadBalancerRequest request = new CreateLoadBalancerRequest().withTargetGroup(group_name);
Upvotes: 1
Views: 1016
Reputation: 269340
Use createListener()
.withDefaultActions()
It looks like you'll need to setTargetGroupArn
and setType
as forward.
See a similar answer related to Python: How to create and attach a ELB properly in Boto3
Upvotes: 1