Fixie AWS Lambda
Fixie provides AWS Lambda functions with a fixed set of static IP addresses for outbound requests. Fixie is language- and framework-agnostic and works with all Lambda runtimes including Node.js, Python, Ruby, Java, and Go.
Without Fixie, your Lambda functions make requests from an unpredictable and constantly changing set of IP addresses. Because Lambda IPs are dynamic, it can be difficult to integrate with services that whitelist a fixed IP range, including certain APIs, databases, and services behind corporate firewalls.
Fixie acts as a proxy for outbound traffic, tunneling your requests through a known IP address. Each Fixie customer is assigned a set of static IP addresses that remain constant regardless of Lambda executions, scaling, or region deployments.
Why Fixie vs AWS NAT Gateway?
The traditional AWS solution for static IPs requires setting up a VPC with a NAT Gateway and Elastic IP. This approach comes with several challenges:
- Complex setup: Requires configuring VPCs, subnets, route tables, and NAT Gateways
- Ongoing costs: NAT Gateways incur hourly charges plus data processing fees that scale with usage
- Manual management: Requires maintaining infrastructure and handling high availability across availability zones
Fixie provides a simpler alternative:
- No infrastructure: Just add an environment variable to your Lambda function
- Built-in redundancy: High availability included without additional configuration
- Free tier available: Get started at no cost and scale as needed
For teams that need static IPs without the operational overhead of managing VPC infrastructure, Fixie provides an affordable, maintenance-free solution.
Getting started
Here is a a complete, working example application that demonstrates Fixie integration with AWS Lambda
To get started, create a Fixie account, and create a new Proxy Application. Fixie provides both HTTP/S proxy and SOCKS5 proxy. For database connections (MySQL, PostgreSQL, etc.), we recommend using a SOCKS5 proxy. For API requests, use the HTTP/HTTPS proxy.
After the proxy is created, go to Proxy’s Details page where you’ll see a couple of important values:
- Proxy URL: Your Fixie HTTP/S or SOCKS proxy URL that includes your username, password and proxy server load-balancer to use.
- Outbound IPs: Your pair of Fixie IP-addresses. These will never change, so feel free to allow-list them with firewalls or services
Configure your Lambda function
Next, update your Lambda function to use your Fixie proxy server. We have documentation for many popular Lambda runtimes:
You also need to make sure Fixie credentials are accessible by your Lambda function. We recommend against hardcoding the values in the source code and instead adding the Proxy URL or HOST string as environment variables. We recommend the following naming conventions for environment variables so it's easier to follow along with our documentation:
FIXIE_URLfor your Fixie HTTP/S proxyFIXIE_SOCKS_HOSTfor your Fixie SOCKS proxy
Setting Environment Variables
In the AWS Lambda console:
- Navigate to your Lambda function
- Go to Configuration → Environment variables
- Click Edit and add your variable: Key:
FIXIE_URL(orFIXIE_SOCKS_HOST), Value: Your proxy URL from the Fixie dashboard (e.g.,http://fixie:your-token@your-subdomain.usefixie.com:80)
Feel free to create different Fixie proxies for different environments (for example, development and production) to keep credentials and logs separate.
Example: Node.js / JavaScript
See our JavaScript documentation for detailed integration, or check out the complete AWS Lambda Example App.
const axios = require('axios');
const { URL } = require('url');
exports.handler = async (event) => {
// Parse the FIXIE_URL
const fixieUrl = new URL(process.env.FIXIE_URL);
const proxyHost = fixieUrl.hostname;
const proxyPort = parseInt(fixieUrl.port) || 80;
// Make request through Fixie proxy
const response = await axios.get('https://api.example.com/data', {
proxy: {
protocol: 'http',
host: proxyHost,
port: proxyPort,
auth: {
username: fixieUrl.username,
password: fixieUrl.password
}
},
timeout: 10000
});
return {
statusCode: 200,
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(response.data)
};
};
Another way to integrate your application with Fixie is by using a SOCKS5 proxy type and adding the fixie-wrench binary to your project. This is particularly useful for database connections or when your HTTP client library doesn't support proxies natively.
Local Development and Testing
For a complete local testing example, see our AWS Lambda Example App which includes full instructions for testing with SAM CLI before deploying to AWS. While our examples use AWS SAM for automated deployments and local testing, the Lambda handler code with Fixie is framework-agnostic.
To use Fixie locally, replicate the FIXIE_URL and/or FIXIE_SOCKS_HOST environment variables in your local environment like so:
# Add FIXIE_URL to your env.json
{
"MyFunction": {
"FIXIE_URL": "http://fixie:your-token@your-subdomain.usefixie.com:80"
}
}
# Invoke the function directly
sam local invoke MyFunction --env-vars env.json
# Or start a local API Gateway
sam local start-api --env-vars env.json
Using Other Deployment Frameworks
If you're using Infrastructure as Code (IaC) tools instead of the AWS Console, you can configure your Fixie environment variables directly in your deployment configuration files. Here's how to configure Fixie with popular deployment frameworks:
AWS SAM
Add environment variables in your template.yaml file (typically in your project root):
Resources:
MyFunction:
Type: AWS::Serverless::Function
Properties:
# ... other properties
Environment:
Variables:
FIXIE_URL: !Ref FixieUrl
Parameters:
FixieUrl:
Type: String
Description: Your Fixie proxy URL
Serverless Framework
Add environment variables in your serverless.yml file (project root):
provider:
name: aws
runtime: nodejs18.x
environment:
FIXIE_URL: ${env:FIXIE_URL}
functions:
myFunction:
handler: handler.main
Then create a .env file locally (don't commit this to git):
FIXIE_URL=http://fixie:your-token@your-subdomain.usefixie.com:80
Keep sensitive configuration values, like credentials, out of source control. Exclude
.envfiles with:echo .env >> .gitignore.
Changing plans
Use the Fixie dashboard to change your plan. To change the plan, click Change Plan button and select an appropriate plan.
NOTE: Changing the plan won't affect your outbound IP address
Deleting a proxy
To remove a proxy, go to the Fixie dashboard and select Delete for the desired proxy.
Having issues? Please reach out to our team here.