简体   繁体   中英

AWS: is it possible to map (ELB/ALB) to ELB?

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

This is not possible.

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

不可以。您不能直接将一个ELB映射到另一个ELB。

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}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM