Introduction
For years, a Lambda function calling S3, DynamoDB or Secrets Manager simply sent its traffic to a public endpoint. For regulated teams in finance, healthcare and government, the first review question was always: “Does any of this traffic touch the public internet?”
Today you can build a serverless application where every hop stays on private IP addresses inside AWS. That includes the client calling your function, the function calling managed services, and managed orchestrators calling your private APIs. The building blocks are generally available across the main serverless services. The latest addition is PrivateLink support for AWS Lambda MicroVMs, announced in August 2026.
A simple way to picture it: Your company and a bank branch are in the same office building. The public-endpoint way is to leave through the front door, walk down the public street and enter the bank from outside. Your ID still protects you, but you are on the street and nothing stops you walking to a different bank. The private-path way is an internal corridor straight to the branch. You never step outside, and the corridor only leads to approved places. This post is about building those corridors for serverless.
Why Private Paths Matter
- Smaller exposure. If a VPC needs a NAT gateway just so a function can reach S3, compromised code can use that same path to send data anywhere on the internet.
- A provable data perimeter. Security teams want to show that sensitive data can only be reached by approved identities, from approved networks, into approved resources.
- Compliance and cost. Many policies require private connectivity, and replacing NAT gateways with VPC endpoints often simplifies the network and lowers cost.
The Three Directions of Serverless Traffic
| Direction | Example | How to keep it private |
|---|---|---|
| Out from serverless to AWS services | A function reads S3, fetches a secret, calls Bedrock | Lambda VPC attachment plus gateway and interface VPC endpoints |
| Into serverless | An app or on-premises system invokes a function or API | Lambda interface endpoint (PrivateLink), private API Gateway APIs, MicroVMs endpoints |
| AWS services calling your private APIs | Step Functions calls an API on an internal load balancer | VPC Lattice resource gateways and resource configurations |
Part 1: From Lambda to AWS Services
When you attach a function to your subnets, Lambda creates shared, service-managed Hyperplane network interfaces in them. From then on, the function can reach only what your VPC can reach. With no NAT gateway, it has no route to the internet, which is what we want, as long as we give it private routes to the services it needs.
OrdersFunction to private subnets with no NAT gateway. You add an S3 endpoint but forget an external payment API. The S3 call works. The payment call returns no error; it just waits until “Task timed out after 30 seconds”. In a private VPC, a missing path usually looks like a timeout, not an error.Gateway endpoints and interface endpoints
There are two kinds of VPC endpoint, and the difference confuses many people.
A gateway endpoint is a signpost in your route table. It exists only for S3 and DynamoDB and is free. Adding one gives the route table a new line that says “anything going to S3, take the private road”:
Destination Target 10.0.0.0/16 local pl-78a54011 (S3 list) vpce-0a1b2c3d4e5f (S3 gateway endpoint)
An interface endpoint is a private phone extension on your floor. It places network interfaces with private IPs in your subnets. With private DNS enabled, the normal service name now resolves to those private IPs. Your code does not change:
Before: secretsmanager.ap-south-1.amazonaws.com -> 13.235.x.x (public) After: secretsmanager.ap-south-1.amazonaws.com -> 10.0.1.25, 10.0.2.31
| Dimension | Gateway endpoint | Interface endpoint |
|---|---|---|
| Services | S3 and DynamoDB only | Most AWS services |
| How it works | Route table entry | Private IPs in your subnets |
| Reachable from on premises | No | Yes, over Direct Connect or VPN |
| Cost | Free | Hourly per AZ plus per GB |
A typical serverless VPC needs gateway endpoints for S3 and DynamoDB, plus interface endpoints for Secrets Manager or Parameter Store, KMS, SQS, SNS, EventBridge, STS, and Lambda itself if functions call other functions. Deploy each interface endpoint in at least two Availability Zones and allow port 443 only from the function security group.
Part 2: Invoking Serverless Privately
Lambda has supported PrivateLink since 2020, and added IPv6 and dual-stack endpoints in April 2025. Create an interface endpoint for the Lambda service and clients in your VPC, or on premises over Direct Connect or VPN, can invoke functions with no internet gateway or NAT. For HTTPS clients, a private REST API in API Gateway is reachable only through an execute-api endpoint, and its resource policy decides which endpoints or accounts may call it.
lambda.ap-south-1.amazonaws.com at a Route 53 Resolver inbound endpoint. The core system now resolves Lambda to 10.20.1.40 and sends the call over Direct Connect, using the normal SDK and hostname.Lambda MicroVMs. Since August 2026, MicroVMs also support PrivateLink. A VPC endpoint lets you call the MicroVM APIs, such as creating images or launching MicroVMs, and connect privately to each MicroVM’s HTTP endpoint. AWS aims this at regulated workloads that need strict network isolation. It follows the same endpoint pattern as the Lambda API.
Part 3: AWS Services Calling Your Private APIs
EventBridge API destinations and Step Functions HTTP tasks used to reach only public endpoints. To call an API on an internal load balancer or on premises, teams put a “proxy” Lambda function inside the VPC. Since December 2024, PrivateLink and VPC Lattice provide two building blocks that remove the proxy:
- Resource gateway: the entry point into the VPC that owns the resource.
- Resource configuration: names one resource (a domain, an IP address, or an AWS resource such as an RDS database), says how it can be reached, and can be shared with other accounts using AWS RAM.
Worked example: a private fraud API in another account
The Fraud team (account B) runs a scoring API on an internal load balancer at fraud.internal.example.com, port 443. The Orders team (account A) has a Step Functions workflow that must call it. Before, account A needed VPC peering and a proxy function. Now it takes four steps:
- Account B creates a resource gateway in the load balancer’s VPC.
- Account B creates a resource configuration for
fraud.internal.example.comon port 443 only. - Account B shares that resource configuration with account A through AWS RAM.
- Account A creates an EventBridge connection marked as private, selects the shared resource configuration, and stores the API key. The Step Functions HTTP task then calls
https://fraud.internal.example.com/v1/scoreusing that connection.
Account A can reach that one API and nothing else in account B. The Fraud team sees the access in CloudTrail and can remove it by ending the RAM share. The proxy function is gone. The same approach works for on-premises APIs: point the resource configuration at the on-premises IP address reached over Direct Connect.
Putting It Together: Follow One Request
Here is one order moving through a fully private design. Note that no step needs a public IP or a NAT gateway.
| Step | What happens | Private path used |
|---|---|---|
| 1 | Internal web app calls the private orders API | execute-api interface endpoint (10.1.3.15) |
| 2 | API Gateway checks its resource policy and invokes OrdersFunction | Inside AWS |
| 3 | Function reads DynamoDB and saves the invoice to S3 | Gateway endpoints |
| 4 | Function fetches a password from Secrets Manager and decrypts with KMS | Interface endpoints (10.0.1.25) |
| 5 | Function publishes OrderPlaced to EventBridge, which starts a workflow | EventBridge interface endpoint |
| 6 | Workflow calls the fraud API in account B and an on-premises inventory system | Resource configurations via VPC Lattice |
A good test in a non-production account: remove the internet gateway from every VPC. If orders still complete, your design is truly private.
Security: Two Guards, Two Directions
Private networking alone is not enough. Combine it with two kinds of policy:
- Endpoint policy, the guard at your exit. It checks where you are going. For example, allow S3 access only to buckets in your organisation (condition
aws:ResourceOrgID). - Resource policy, the guard at the destination. It checks where you came from. For example, a bucket policy that denies any request not arriving through your endpoint (condition
aws:SourceVpce), with an exception for your deployment role so CI/CD still works.
| Scenario | Exit guard (endpoint policy) | Destination guard (bucket policy) | Result |
|---|---|---|---|
| Function saves an invoice to our bucket | Our organisation: allowed | Came via our endpoint: allowed | Succeeds |
| Malicious code copies data to an attacker’s bucket | Not our organisation: denied | Not reached | Blocked at exit |
| Attacker uses stolen credentials from a laptop | Not involved | Not via our endpoint: denied | Blocked at destination |
Without the endpoint policy, the second attack succeeds. Without the bucket policy, the third one does. Apply the same conditions across all accounts with service control policies and resource control policies, and use Lambda condition keys such as lambda:VpcIds so functions can only be deployed into approved networks.
DNS: Where Most Rollouts Break
Private DNS on an interface endpoint only works inside the VPC where the endpoint lives.
kms.ap-south-1.amazonaws.com that points to the shared endpoint, associated with all 20 VPCs. On-premises clients need a Route 53 Resolver inbound endpoint for the same reason.Cost in One Example
Gateway endpoints are free. Interface endpoints and NAT gateways charge per hour and per GB. Suppose your functions send 10 TB a month to S3 through NAT. At an illustrative $0.045 per GB, that is about $450 a month just for NAT processing. An S3 gateway endpoint brings it to zero. But if you send only 2 GB a month to Secrets Manager, an interface endpoint will cost more than it saves; you add it for security, not savings. Check current prices for your Region.
Troubleshooting Guide
| What you see | Likely cause |
|---|---|
| “Task timed out” | No network path: missing endpoint, wrong route table, or DNS still returns a public IP |
| “Connect timeout on endpoint URL” | Security group or network ACL blocks port 443 |
| “AccessDenied ... no VPC endpoint policy allows” | Endpoint policy is too strict |
| “AccessDenied ... explicit deny in a resource-based policy” | Resource policy condition such as aws:SourceVpce does not match |
VPC Flow Logs show whether traffic reaches endpoints or still heads to a NAT gateway, and CloudTrail records the endpoint ID on each API call, which is useful evidence for auditors.
Migration Checklist
- List every service and external API each function calls, using X-Ray, CloudTrail and NAT flow logs.
- Add S3 and DynamoDB gateway endpoints everywhere. They are free.
- Add interface endpoints, centrally if you run many accounts, in at least two AZs with private DNS.
- Replace proxy functions with EventBridge connections and Step Functions HTTP tasks backed by resource configurations.
- Move internal callers to the Lambda endpoint or private API Gateway APIs, and add MicroVMs endpoints if you use them.
- Remove the NAT route in a test environment, run integration tests and watch for timeouts.
- Lock it in with endpoint policies, resource policies and organisation-wide guardrails.
Conclusion
Every direction of serverless traffic now has a generally available, private option: VPC endpoints for calls out of Lambda, PrivateLink and private APIs for calls in, and VPC Lattice resource configurations for EventBridge and Step Functions calling your private systems. The shift is from “public endpoints protected by credentials” to “private paths protected by credentials, networks and policies together”. Start with the free gateway endpoints, remove your proxy functions, close the NAT path, and turn the result into guardrails.
References
- AWS What’s New: AWS Lambda MicroVMs now supports AWS PrivateLink (25 August 2026)
- AWS What’s New: AWS Lambda now supports inbound IPv6 connectivity over AWS PrivateLink (17 April 2025)
- AWS What’s New: Access to VPC resources over AWS PrivateLink; EventBridge and Step Functions integration with private APIs (1 December 2024)
- AWS Compute Blog: Simplifying private API integrations with Amazon EventBridge and AWS Step Functions
- Amazon EventBridge User Guide: Connecting to private APIs in EventBridge

