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
전문가
답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠