Search code examples
amazon-web-servicesaws-api-gatewaynlb

API Gateway with Static Elastic IP


Hi We have an aws API gateway configured with lambda and now want to integrate with a vendor wherein vendor want us to provide him with a Static IP against the API Gateway that we have. As per my knowledge API gateway serves request through Dynamic Elastic IP which are listed here

Is there a way to achieve this other than putting a forward proxy or NLB.


Solution

  • You cannot get a static IP if you are using a public API Gateway endpoint (Regional or Edge-optimized). The IPs allocated for APIs in any AWS region can be changed at any time and are a very wide range.

    However, if you were to use a private API Gateway endpoint, you could use the below set up -

    Client --> NLB(public static IP) --> VPC endpoint for API Gateway --> Private API
    

    The execute-api VPC endpoint have a fixed IP address allocated from the VPC CIDR range. Having a NLB as a front-end(with a public static IP), you can add these IP addresses as targets in your NLB config.