简体   繁体   中英

Path-based routing to external resource with AWS Application Load-Balancer (ALB)

I have a working domain, xy, which is tied to an EC2 instance on a VPC.

I want a path on that domain, xy/z, to be routed to an external, non-AWS (IPv4*) microservice. Can this be done with ALB?

I have followed Use Path-Based Routing with Your Application Load Balancer to set up target groups, but can't seem to link them to anything past EC2 instances?

(*: Would be great to extend with ports, or even (sub)domains, paths, etc.)

The latest AWS Application Load Balancer (ALB) can do the trick. This works for me

Follow the steps here,

1. Set up the ALB AWS documentation here, Follow steps up until Listeners tab,

https://docs.aws.amazon.com/elasticloadbalancing/latest/application/tutorial-load-balancer-routing.html

2. On the Listeners tab, 2.1. Modify rules in the Listeners ID

在此处输入图像描述

2.2. Add Rule: 在此处输入图像描述

2.3. Point to redirect URL 在此处输入图像描述

This should redirect you to external URL

I also have similar requirement. I want to forward request to external AWS TargetGroup to save ConnectionTime and DNS Resolution time. Both the Account infra are within my company network so it will be possible to forward path based request from one aws ALB to another AWS api. I tried to create rule to forward request, there it is asking to select TG which is listing only TGs belong to current VPC. Not sure how can i point to TG of another AWS account. enter image description here

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