Static IP guide
Making API requests with a static IP from a Node app on AWS Lambda
The AWS-native way to give Lambda a static IP is a VPC with a NAT Gateway and Elastic IP — infrastructure, hourly cost, and data processing fees, all to fix an address. A Fixie HTTP/S proxy replaces that with a single FIXIE_URL environment variable on the function, and axios calls exit from two permanent IPs.
Recommended setup
Use Fixie HTTP/S proxy for HTTP and HTTPS requests to an API, webhook provider, or service that allowlists outbound IP addresses. Store the proxy value in FIXIE_URL, then configure Node.js to route outbound traffic through Fixie before connecting to API allowlisting.
Set up Fixie on AWS Lambda
Create a Fixie HTTP/S proxy in the Fixie dashboard. Copy the proxy value into AWS Lambda environment variables as FIXIE_URL, and copy the outbound IPs into the destination allowlist.
Set an AWS Lambda environment variable
aws lambda update-function-configuration \
--function-name YOUR_FUNCTION \
--environment "Variables={FIXIE_URL=...}"Implementation
The example below shows the core application-side change. Keep credentials in environment variables and avoid committing proxy, database, or API secrets.
Make an HTTP request through FIXIE_URL
const axios = require('axios');
const fixieUrl = new URL(process.env.FIXIE_URL);
axios.get('https://api.example.com/data', {
proxy: {
protocol: 'http',
host: fixieUrl.hostname,
// URL drops default ports, so fall back to 80 for Fixie's standard proxy port.
port: Number(fixieUrl.port) || 80,
auth: {
username: fixieUrl.username,
password: fixieUrl.password,
},
},
}).then((response) => {
console.log(response.status);
});Good to know
- Parse FIXIE_URL and build the axios config outside the handler so warm invocations reuse it.
- The function needs no VPC attachment at all — that is the point; it keeps cold starts fast and networking simple.
- Fixie publishes a complete Lambda example app on GitHub (usefixie/aws-lambda-example-app) covering SAM and Serverless Framework configuration.
Allowlist and test the static IPs
- Open the Fixie dashboard and copy the outbound IP addresses for this proxy.
- Add both IPs to the API provider.
- Deploy the updated Node.js app on AWS Lambda.
- Run a small connection test before sending production traffic.
Related guides
- Connecting to Postgres with a static IP from a Node app on AWS Lambda
- Making API requests with a static IP from a Node app on Heroku
- Making API requests with a static IP from a Python app on AWS Lambda
- Connecting to Amazon Redshift with a static IP from a Node app on AWS Lambda
- Making API requests with a static IP from a Node app on Vercel
- Making API requests with a static IP from a Java app on AWS Lambda