Static IP guide

Making API requests with a static IP from a Go app on AWS Lambda

Go Lambda functions get Fixie support from the standard library alone: parse FIXIE_URL in an init function and share one http.Client across invocations. Allowlisted partners see two unchanging IPs while the function scales from zero to thousands of concurrent executions.

RuntimeGo
PlatformAWS Lambda
DestinationAPI allowlisting
Fixie productFixie HTTP/S proxy

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 Go 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

package main

import (
  "net/http"
  "net/url"
  "os"
)

func main() {
  fixieURL, err := url.Parse(os.Getenv("FIXIE_URL"))
  if err != nil {
    panic(err)
  }

  client := &http.Client{
    Transport: &http.Transport{Proxy: http.ProxyURL(fixieURL)},
  }

  _, err = client.Get("https://api.example.com/data")
  if err != nil {
    panic(err)
  }
}

Good to know

  • Alternatively set HTTPS_PROXY on the function to the Fixie URL — Go's default transport applies it with no code, though it then proxies all outbound HTTP including AWS SDK calls.
  • init()-time parsing runs once per execution environment, which is the setup cost model you want on Lambda.

Allowlist and test the static IPs

  1. Open the Fixie dashboard and copy the outbound IP addresses for this proxy.
  2. Add both IPs to the API provider.
  3. Deploy the updated Go app on AWS Lambda.
  4. Run a small connection test before sending production traffic.

Related guides

Related docs