Skip to main content

How does networking work in AWS serverless applications?

Understand public service endpoints, Lambda VPC attachment, subnets, security groups, NAT, VPC endpoints, DNS, egress, and private dependencies.

How does networking work in AWS serverless applications?

AWS serverless networking is the set of paths that connect clients, managed service endpoints, functions, containers, and private resources. A Lambda function is not placed in your VPC by default; attaching it to selected subnets and security groups is primarily how it reaches private VPC resources, and that choice changes its route to public endpoints and the controls your team must operate.

How this topic fits

Architecture

Connect managed services into clear request, event, data, networking, and failure paths before selecting implementation details.

Draw every ingress and egress path

For each request, record the source, DNS name, endpoint, protocol, port, identity, encryption, network boundary, and destination. Include callbacks, third-party APIs, package retrieval, telemetry, secrets, and control-plane calls, not only the primary business request.

Managed services often expose regional public endpoints protected by TLS and IAM. Public endpoint does not mean public data access, but requirements may still call for private routing through VPC endpoints or explicit egress controls.

Attach Lambda to a VPC for a specific private dependency

VPC attachment lets a function reach resources such as private database endpoints through selected subnets and security groups. It does not make the function itself directly reachable from the VPC; invocation still occurs through Lambda service integrations.

Choose subnets for routes and availability-zone coverage rather than labeling them private without examining route tables. Security groups should allow only the required destination and port, and the destination should allow the function's security group where supported.

Provide deliberate access to AWS and internet endpoints

A VPC-attached function needs a valid route to services it calls. NAT can provide internet and public AWS endpoint egress from private subnets, while gateway or interface VPC endpoints can provide private routes to supported AWS services.

Compare endpoint availability, DNS behavior, policy controls, data transfer, hourly and processing cost, IPv4 address needs, and failure dependencies. Adding a VPC without the required egress path is a common cause of timeouts.

Operate DNS, connections, capacity, and failure

Reuse connections where safe, bound connect and read timeouts, and retry only transient failures with backoff. Observe DNS errors, connection exhaustion, NAT or endpoint metrics, rejected flows, dependency latency, and subnet address capacity.

Test the loss or throttling of each network dependency. Private routing can improve control, but every NAT gateway, endpoint, resolver, firewall, and cross-Region link becomes part of availability and cost.

Go deeper with AWS

Read the primary AWS documentation behind the service definitions and architecture guidance in this guide.

Explore serverless products

Questions about this topic

Browse all serverless concepts

Explore compute, APIs, events, workflows, data, security, reliability, operations, delivery, and AI from one connected AWS serverless learning path.

What is serverless?

Learn what serverless computing means, how it works on AWS, what the cloud provider manages, and which trade-offs still belong to your team.

Read the guide

What is AWS Lambda?

Understand how AWS Lambda runs code, how functions are invoked, where permissions and state live, and when Lambda is a good compute choice.

Read the guide

What is serverless architecture?

Learn how managed compute, APIs, events, queues, workflows, data, identity, and observability fit together in a serverless architecture on AWS.

Read the guide

AWS serverless security

A practical guide to identity, least privilege, event validation, secrets, data protection, dependencies, and incident visibility in AWS serverless systems.

Read the guide

What is agentic AI?

Learn what makes an AI system agentic, how models, tools, memory, orchestration, identity, and evaluation fit together, and where serverless patterns help on AWS.

Read the guide

What is cloud computing?

Understand how on-demand infrastructure and managed services change the way teams provision, scale, pay for, and operate software systems.

Read the guide

What is event-driven architecture?

Learn how producers, routers, and consumers communicate through events, and how to design schemas, delivery, retries, and ownership deliberately.

Read the guide

What is a serverless API?

Understand the request path, authentication, routing, compute, data, throttling, observability, and failure controls behind a serverless API on AWS.

Read the guide

What are serverless workflows?

Learn when explicit workflow state improves retries, branching, parallel work, human approval, visibility, and recovery in distributed applications.

Read the guide

What is Amazon API Gateway?

Learn how API Gateway creates, publishes, secures, monitors, and operates HTTP, REST, and WebSocket APIs for AWS and external backends.

Read the guide

What is Amazon EventBridge?

Understand EventBridge event buses, rules, pipes, schemas, targets, schedules, permissions, delivery, and recovery in event-driven AWS systems.

Read the guide

Make the next serverless decision explicit.

Explore focused products for repeatable work, or bring the architecture decision that needs context and experienced review.