具有静态 IP 地址的 AWS 负载均衡器 [英] AWS Load Balancer with a static IP address

本文介绍了具有静态 IP 地址的 AWS 负载均衡器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个在 Amazon 云上运行的设置,其中有几个 EC2 实例通过负载均衡器运行.

I have a set-up running on Amazon cloud with a couple of EC2 Instances running through a load balancer.

该站点具有唯一的(静态)IP 或一组 IP 很重要,因为我正在插入仅接受来自已添加到其白名单的 IP 的请求的第 3 方 API.

It is important that the site has a unique(static) IP or set of IPs as I'm plugging in 3rd party APIs which only accept requests made from IPs which have been added to their whitelist.

所以基本上,除非我们可以为这些 3rd 方提供一个静态 IP 或 IP 范围,否则来自站点的请求将始终来自这些 IP,否则我们将无法向他们发出任何呼叫.

So basically unless we can give these 3rd parties a static IP or range of IPs that the requests from the site will always come from then we would be unable to make any calls to them.

有谁知道如何实现这一点,因为我知道弹性 IP 与负载均衡器不兼容?

Anyone knows how to achieve this as I know that Elastic IPs are not compatible with load balancers?

如果我要查找负载均衡器 DNS 名称的 IP(例如 dualstack.awseb-BAMobile-ENV-xxxxxxxxx.eu-west-1.elb.amazonaws.com 解析为 200.200.200.200)该 IP 是静态?

If I were to look up the IP of the load balancer DNS name (e.g. dualstack.awseb-BAMobile-ENV-xxxxxxxxx.eu-west-1.elb.amazonaws.com resolves to 200.200.200.200) would that IP be Static?

非常感谢您的任何帮助/建议.

Any help/advise is greatly appreciated guys.

推荐答案

负载均衡器的 IP 地址不是静态的.在任何情况下,您的传入负载平衡器 IP 都不会用于传出连接.

The ip addresses of your load balancer is not static. In any event, your incoming load balancer IP wouldn't be used for outgoing connections.

您可以为负载均衡器后面的实际实例分配弹性 IP,然后将其用于传出请求.获得5个免费弹性ip,相信有需要的可以申请更多.

You could assign elastic IPs to the actual instances behind the load balancer, which would then be used for outgoing requests. You get 5 free elastic ips, and I believe you can apply for more if you need them.

此外,如果使用 VPC 并且您的实例位于私有子网中,那么它们将只能通过您设置的 NAT 实例访问互联网,您当然可以为 NAT 实例分配一个弹性 IP

Additionally if using a VPC and if your instances are in a private subnet then they will only be able to access the internet via the NAT instance(s) you setup, and you can of course assign an elastic IP to the NAT instances

这篇关于具有静态 IP 地址的 AWS 负载均衡器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆