简体   繁体   English

AWS - Fargate 任务的私有地址 static IP

[英]AWS - Private static IP address for Fargate task

I have the following situation.我有以下情况。 I have a VPC on AWS.我在 AWS 上有一个 VPC。 In this VPC, I have an ECS Fargate cluster with multiple different tasks running.在此 VPC 中,我有一个运行多个不同任务的 ECS Fargate 集群。 Additionally, I have a Site-to-Site VPN for one of my partners set up in this cluster.此外,我在这个集群中为我的一个合作伙伴设置了一个站点到站点 VPN。

Now, this partner has to send HTTP POST (SOAP in fact) requests to one of my Fargate tasks.现在,该合作伙伴必须向我的 Fargate 任务之一发送 HTTP POST(实际上是 SOAP)请求。 This should be possible only through VPN, so the task can't be public-facing.这应该只能通过 VPN 才能实现,因此该任务不能面向公众。 For some reason which I can't control this partner requires a static IP to which requests have to be sent, so ALB is not an option.出于某种我无法控制的原因,此合作伙伴需要 static IP 必须向其发送请求,因此 ALB 不是一个选项。 So I need a way to assign a private (within VPC) static IP to the Fargate task.所以我需要一种方法来将私有(VPC 内)static IP 分配给 Fargate 任务。

I've tried to achieve it with NLB, but not sure if I can send HTTP requests to NLB since it's L4 vs L7.我试图用 NLB 实现它,但不确定我是否可以向 NLB 发送 HTTP 请求,因为它是 L4 与 L7。 Now my only option seems to be an EC2 instance with NGINX which would simply forward all requests to the task's ALB.现在我唯一的选择似乎是带有 NGINX 的 EC2 实例,它会简单地将所有请求转发到任务的 ALB。 I don't like this option because I have not much experience with NGINX configuration.我不喜欢这个选项,因为我对 NGINX 配置经验不多。

Do you think there are any other options for me to achieve what I need?您认为我还有其他选择可以实现我的需要吗?

Thanks in advance提前致谢

I've tried to achieve it with NLB, but not sure if I can send HTTP requests to NLB since it's L4 vs L7.我试图用 NLB 实现它,但不确定我是否可以向 NLB 发送 HTTP 请求,因为它是 L4 与 L7。

NLB is L3. NLB 是 L3。 But off course you can use it for HTTP or HTTPS .但当然你可以将它用于 HTTP 或 HTTPS The only difference is that you won't be able to setup http-type listener rules, because NLB is for TCP/UDP.唯一的区别是您将无法设置 http 类型的侦听器规则,因为 NLB 用于 TCP/UDP。 But it does not stop you from using it to distribute HTTP/HTTPS traffic among your fargate tasks.但它不会阻止您使用它在您的 fargate 任务之间分配 HTTP/HTTPS 流量。

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

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