3
votes

ELB: Elastic Load Balancer ALB: Application Load Balancer

I am trying to map elb/alb on aws to another elb (ex: http://my-elb-domain.com),

elb/alb -> elb

in alb: I didn't find a way to register elb as targets. in elb: only maps to instances

3
Why do you wish to do this? There might be alternatives.John Rotenstein

3 Answers

6
votes

This is not possible.

Both the Classic Load Balancer and Target Groups for the Application Load Balancer only accept Amazon EC2 instances as targets.

3
votes

Explanation

We have found a roundabout way to accomplish this via the AWS CLI, and are currently using it in production to route traffic. Note that the solution below ends up routing to the same instances behind an ELB, but not through the ELB itself. Here's how it works:

  1. When created an elastic beanstalk environment comes with an automatically generated autoscaling group
  2. An auto-scaling group can be attached to up to 10 target groups via the CLI
  3. That target group can be the direct target of an ALB

Visual Flow

Traffic -> ALB -> Target Group -> Autoscaling Group -> Same Instances ELB Points To

Setup Instructions

  1. Create an Elastic Beanstalk application
  2. Get the name of the Autoscaling group generated for the Elastic Beanstalk app
  3. Create a target group (with no targets), save the ARN for the target group.
  4. Create your ALB, setting its target to the target group create in step #3
  5. Attach the target group to your Autoscaling group via the AWS CLI

    aws autoscaling attach-load-balancer-target-groups --auto-scaling-group-name {AutoScalingGroupName} --target-group-arns {TargetGroupARN}

2
votes

No. You can't map one ELB to another ELB directly.