what ip AWS lambda function use?

后端 未结 2 1190
悲&欢浪女
悲&欢浪女 2021-02-05 19:57

I\'m not very good with networking, but here is my issue: I need to connect to MySQL server from AWS lambda function, that is behind firewall, and to \'white\' my AWS lambda i n

2条回答
  •  悲&欢浪女
    2021-02-05 20:13

    The IP addresses in the 172.31.16.0/20 are private, non-routable addresses. Unless your MySQL server and firewall are in the same VPC, your Lambda will only be able to connect through NAT and will use the elastic IP attached to your NAT Gateway. That's the only IP address you need to whitelist.

    Incidentally, for a CIDR of 172.31.16.0/20, you can expect IP addresses from 172.31.16.0 to 172.31.31.255. The 20 is the number of mask bits which gives a range of 4096 values. It maps to a netmask of 255.255.240.0.

提交回复
热议问题