Building a serverless A2A gateway for agent discovery, routing, and access control
AWS•How-to••by Reilly Manton, Scott Wainner and Wesley Petry•AWS Artificial Intelligence Blog
In this post, you will learn how to build a serverless A2A gateway on AWS that hosts multiple agents behind a single domain using path-based routing (/agents/{agentId}). Standard A2A clients work without modification.
A reference serverless gateway on API Gateway, Lambda, Cognito and DynamoDB that fronts multiple A2A agents on one domain with path-based routing, scope-based access and rate limits.
Who it is for
Cloud architects running multiple AI agents across teams or clouds who need one place to register, discover and control access to them.
Key points
Deployed with Terraform; the sample includes Weather and Calculator example agents.
Access is granted per OAuth scope in a DynamoDB Permissions table; rate limits are per user and per agent.
Uses a REST API for SSE streaming; private VPC mode needs NAT or egress for Cognito token exchange.
The gateway does not inspect content; backend agents must handle prompt injection defenses themselves.
AI:Both route and govern A2A agent traffic through a gateway; the item is a self-built serverless reference while Azure API Management is a managed gateway with A2A support.
AI:Both front A2A agents behind a gateway for discovery and governance; the item builds its own serverless gateway while Azure API Management offers a managed one.
Related posts
AWS•How-to••by Amit Chaudhary•AWS Artificial Intelligence Blog
AI:A reference architecture shows a LangChain orchestrator on ECS calling a Strands agent on Bedrock AgentCore over A2A, with OAuth in both directions and no shared SDK or secrets.
AI:Eon replaced per-tool credentials and local MCP servers across AWS, GCP and Azure with one authenticated AgentCore MCP Gateway that agents and developers share.
AI:AWS Professional Services describes a four-agent Strands pattern on Bedrock AgentCore that generates IaC for MCP-connected migrations, which AWS says cut IaC work from 3-4 weeks per application to minutes.