Platform
Lambda static outbound IP
Lambda's own network interfaces cannot hold an Elastic IP. Outside a VPC, functions use a shared AWS address space that changes. A static source address means private subnets, a NAT Gateway in a public subnet, and an Elastic IP on that NAT.
. If a provider has moved a setting, their documentation is the authority.
How to build it
- 1Put the function in private subnets, in more than one Availability Zone. A public subnet does not give a Lambda function a public address or internet access.
- 2Allocate an Elastic IP and attach it to a public NAT Gateway in a public subnet of the same AZ. Repeat per AZ if you want the function to survive a NAT failure. Allowlist every Elastic IP, because either one may be the source.
- 3Route 0.0.0.0/0 in each private subnet to its NAT Gateway. Route the public subnet to an internet gateway. The NAT is useless without that second hop.
- 4Attach AWSLambdaVPCAccessExecutionRole, or an equivalent that can create the Hyperplane network interfaces. Give the function's security group outbound access to the partner's port.
- 5Invoke the function and read the source address the partner saw. Confirm it is the Elastic IP, then whitelist that address and delete any 0.0.0.0/0 rule you used while testing.
What the allowlist trusts
The partner's whitelist admits every function, instance, and job in those private subnets. Hyperplane interfaces are shared and managed by Lambda; you cannot pin one to a single function and call that the identity. VPC flow logs are IP to IP.
A function that is not attached to the VPC still uses the dynamic pool, even in the same account. So does GitHub Actions. The Actions comparison is the list of ways to give a workflow its own stable address.
Sources
Related
The Elastic IP names the subnet, not the function
Use a NAT Gateway when several functions in one VPC can share an allowlist entry. Proofbound is in development for GitHub Actions and Kubernetes, where each workload needs its own identity on the way out.
One email when early access opens.