问题
I have several aws lambda instances accessible publicly, from the internet they all have the same public ip, how can we ensure that each lambda has distinct public IP address? It does not need to be static, it only needs to be different per lambda, and its no problem if same lambda has different IPs (high availability), the only condition is that 2 different lambdas never have the same IP...
回答1:
Look at the answer (and the comments) to this question: Lambda function within VPC doesn't have access to public Internet
You can "assign" an Elastic IP to a lambda function by enabling VPC for it and then making sure the VPC is configured properly to give your lambda internet access (by attaching a NAT Gateway to the VPC subnet's routing table, or by assigning an IP to the lambda's ENI).
来源:https://stackoverflow.com/questions/53203573/how-to-ensure-distinct-public-ip-per-aws-lambda