How to have static outbound IP address for API Gateway + Lambda

0

Hi, I am using a third party API for payments for which they need to whitelist our IP but we are on aws serverless that is an API of API gateway invoke the lambda function. so it return diff IPs on invocation. How to have static outbound IP address?

How to provide a static IP to the third party for whitelisting? I searched but found https://medium.com/financial-engines-techblog/aws-lambdas-with-a-static-outgoing-ip-5174a1e70245 or similar for static IP at lambda. but as per my assumption if a lambda returns static IP to API gateway, will the same IP be returned by API gateway to the calling party?

1 個回答
3

In short: The blog post you reference is the way to go forward.

But in a little more detail: There are two components here (at a networking level).

First, there is the connection to API Gateway from the API caller. When called that invokes the Lambda function and the Lambda function can return data to the caller. That traffic is between the caller IP address and the API Gateway IP address.

Second, there is the connection that the Lambda function establishes (outbound) to the third-party API. By default, Lambda functions can connect to external (Internet-hosted) services with no other configuration but as you've pointed out there is no static IP there. To have Lambda appear to come from a static IP address you need to have it connected to a VPC and use NAT Gateway as per the blog post.

profile pictureAWS
專家
已回答 1 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南