Is there a way to implement static ip on Netlify Functions?

answered
#1

In order to make request to Line Pay, I am searching a way to whitelist ip with Netlify Functions. However, the ip seems to change once an hour. Heroku also uses dynamic ip, but can be solved by using Fixie to route request through static ip. I would like to know if there is a way to implement it with Netlify Functions.

#2

Hi @poweiharn , welcome to the community!

It’s not possible to get a static IP for serverless functions with any host that I’m aware of. that’s a bit antithetical to how you’re supposed to think of them, since they you aren’t supposed to worry about where they are hosted, or anything to do with the server they are running on. I’m not familiar with Line Pay, but I do not that lots of other payment processes will allow you to make payments from dynamic IP’s. Sorry I don’t have a great solution for you, but if your only option is to get a static IP then maybe a cheap droplet from digital ocean would be a better fit for the backend.

2 Likes
#3

This is not possible with Netlify functions.

You would need to setup your own VPC with a static IP and your own backing lambda function. See https://medium.com/@matthewleak/aws-lambda-functions-with-a-static-ip-89a3ada0b471 for more info.

I’m not familiar with Fixie but perhaps this is possible to use Fixie to point to your function endpoint :thinking:

1 Like