[英]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.我有一个工作域 xy,它与 VPC 上的 EC2 实例相关联。
I want a path on that domain, xy/z, to be routed to an external, non-AWS (IPv4*) microservice.我希望将该域上的路径 xy/z 路由到外部的非 AWS (IPv4*) 微服务。 Can this be done with ALB?
这可以用 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?我已按照将基于路径的路由与您的应用程序负载均衡器一起使用来设置目标组,但似乎无法将它们链接到任何过去的 EC2 实例?
(*: Would be great to extend with ports, or even (sub)domains, paths, etc.) (*:可以很好地扩展端口,甚至(子)域、路径等。)
The latest AWS Application Load Balancer (ALB) can do the trick.最新的 AWS 应用程序负载均衡器 (ALB) 可以解决问题。 This works for me
这对我有用
Follow the steps here,按照这里的步骤,
1. Set up the ALB AWS documentation here, Follow steps up until Listeners tab, 1. 在此处设置 ALB AWS 文档,按照步骤直到 Listeners 选项卡,
https://docs.aws.amazon.com/elasticloadbalancing/latest/application/tutorial-load-balancer-routing.html https://docs.aws.amazon.com/elasticloadbalancing/latest/application/tutorial-load-balancer-routing.html
2. On the Listeners tab, 2.1. 2. 在监听器选项卡上, 2.1。 Modify rules in the Listeners ID
修改 Listeners ID 中的规则
2.3. 2.3. Point to redirect URL
指向重定向 URL
This should redirect you to external URL这应该将您重定向到外部 URL
I also have similar requirement.我也有类似的要求。 I want to forward request to external AWS TargetGroup to save ConnectionTime and DNS Resolution time.
我想将请求转发到外部 AWS TargetGroup 以节省 ConnectionTime 和 DNS 解析时间。 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.
两个帐户基础设施都在我的公司网络内,因此可以将基于路径的请求从一个 aws ALB 转发到另一个 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.
我试图创建转发请求的规则,它要求选择 TG,它只列出属于当前 VPC 的 TG。 Not sure how can i point to TG of another AWS account.
不知道如何指向另一个 AWS 账户的 TG。 enter image description here
在此处输入图像描述
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.