简体   繁体   English

在 AWS 上使用 Application Load Balancer 在哪里处理微服务的授权和路由?

[英]Where to handle authorization and routing for microservices with Application Load Balancer on AWS?

I currently have an ALB that forwards all http/s requests to a target group.我目前有一个 ALB,它将所有 http/s 请求转发到目标组。 Inside the target group I have 3 EC2 instances each running the same NodeJS application.在目标组中,我有 3 个 EC2 实例,每个实例都运行相同的 NodeJS 应用程序。

If I want to break up my application into microservices with a "gateway service" that handles authorization of all incoming client requests and performs routing to the other microservices, how can I achieve this using ALB?如果我想使用处理所有传入客户端请求的授权并执行到其他微服务的路由的“网关服务”将我的应用程序分解为微服务,我如何使用 ALB 实现此目的?

My initial thought is to implement the following:我最初的想法是实现以下内容:

Inte.net -> ALB -> Target group with gateway microservices (auth happens here) -> ALB -> Target group with other microservices Inte.net -> ALB -> 具有网关微服务的目标组(此处进行身份验证)-> ALB -> 具有其他微服务的目标组

Is this kind of architecture possible / recommended?这种架构可能/推荐吗?

One solution is to:一种解决方案是:

  • use private AWS API gateway,使用私有 AWS API 网关,
  • create VPC interface endpoint linked to it创建链接到它的 VPC 接口端点
  • use IP address as a target group and使用 IP 地址作为目标组和
  • pass traffic through the gateway to micro services通过网关将流量传递到微服务

Authorization can be done in the gateway by using Authorizers (Cognito or Lambda)可以使用授权器(Cognito 或 Lambda)在网关中完成授权

See https://aws.amazon.com/premiumsupport/knowledge-center/invoke-private-api-gateway/ for details.有关详细信息,请参阅https://aws.amazon.com/premiumsupport/knowledge-center/invoke-private-api-gateway/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何为 AWS Application Load Balancer 使用基于路径的路由 - How to have path based routing for AWS Application Load Balancer AWS 应用程序负载均衡器 (ALB) 基于主体的路由 - AWS Application Load Balancer (ALB) Body Based Routing 我应该在哪里存储我的 object 在 AWS 运行 Ec2 实例与应用程序负载均衡器 - where should I store my object in AWS Running Ec2 Instance With Application Load balancer AWS 负载均衡器和 BlueHost - AWS Load Balancer & BlueHost AWS Application Load Balancer SSL 终止与 Apache Docker - AWS Application Load Balancer SSL Termination with Apache Docker CloudFormation 中应用程序负载均衡器的 AWS::WAFv2::WebACLAssociation ResourceArn - AWS::WAFv2::WebACLAssociation ResourceArn for Application Load Balancer in CloudFormation 如何将配置文件添加到 AWS 应用程序负载均衡器? - How to add a configuration file to a AWS application load balancer? AWS Application Load Balancer + EC2 - 443 侦听器未按预期工作 - AWS Application Load Balancer + EC2 - 443 listener not working as expected 网络负载均衡器前面的应用程序负载均衡器 - Application Load Balancer in front of Network Load Balancer 节点负载均衡器和基于路径的路由 - node load balancer and path based routing
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM