Home icon

Reducing cross-AZ latency with the AWS Lambda metadata endpoint

Compute Blog



AWS Lambda now exposes Availability Zone metadata through a metadata endpoint, enabling functions to discover their AZ ID and route to same-AZ resources to reduce cross-AZ latency and data transfer costs.

  • Lambda metadata endpoint provides AZ ID (e.g., use1-az1) via authenticated HTTP request to reduce cross-AZ latency
  • Available at no additional cost across all commercial AWS Regions, compatible with SnapStart, provisioned concurrency, and VPC functions
  • Retrieve AZ ID using Powertools for AWS Lambda (Python, TypeScript, Java, .NET) or call endpoint directly with environment variables
  • Route same-AZ reads to ElastiCache, RDS, Aurora, MemoryDB, EKS, and ECS resources while maintaining fallback paths
  • AZ IDs (use1-az1) provide cross-account consistency unlike AZ names (us-east-1a) which vary per account
  • Cache metadata at initialization, not per invocation, and refresh after SnapStart restore when AZ may change

Functions can now optimize latency-sensitive workloads by preferring same-AZ endpoints and implementing AZ-aware resilience patterns like targeted fault injection.



Go to article

The AWS News Feed is currently looking for gold sponsors. If you want to support the AWS community and reach a large audience of AWS professionals, consider sponsoring the AWS News Feed.

Related articles

Sep 28
2026
Improving Lambda function latency with scalable network bandwidth
Oct 7
2026
Cross-account canary routing with Amazon VPC Lattice and Amazon API Gateway
Mar 19
2026
AWS Lambda now supports Availability Zone metadata
Sep 4
2026
AWS MCP Server adds a serverless capability for AWS Lambda functions

The AWS News Feed is currently looking for silver sponsors. If you want to support the AWS community and reach a large audience of AWS professionals, consider sponsoring the AWS News Feed.