AivexaNewsSearch
AI news for builders and product teamsChecked every hour

Connect Amazon Bedrock AgentCore Gateway to private APIs in a hub-and-spoke network with centralized inspection

Collected Nov 18, 2026

AWS published a reference architecture for running Amazon Bedrock AgentCore Gateway against internal REST APIs and Model Context Protocol (MCP) servers in enterprises where a central network team owns all subnets and a central firewall must inspect traffic moving between VPCs in both directions. The pattern was built and tested in us-east-1 (US East, N. Virginia) in a lab with three member accounts and a management account under AWS Organizations. CloudFormation templates, test scripts, test evidence and reference material such as the address plan, validation checks, troubleshooting notes and quotas are in a companion repository. AWS frames the pattern as a guideline to adapt to your own account layout.

The core problem is placement. AgentCore Gateway reaches private targets through an Amazon VPC Lattice resource gateway, which is the VPC Lattice entry point into a VPC: elastic network interfaces in subnets you choose, whose addresses backends see as the connection source. A resource configuration names one backend behind that resource gateway (an internal load balancer or VPC endpoint DNS name plus port) and can be shared across accounts with AWS RAM. Gateway targets have two private endpoint modes. In managed mode AgentCore creates the resource gateway in the Gateway account. In self-managed mode you create it and hand the target a resource configuration. Neither default fits when you need both network-team ownership and a mandatory firewall hop, so the pattern uses self-managed mode with one change: the network account owns the resource gateway and places it in its own subnets.

The solution puts the resource gateway in a dedicated VPC in the network account, with subnets that are not shared and contain no backends or central endpoints. Those subnets route to an AWS Transit Gateway, so traffic to and from the tool VPCs passes the inspection VPC. One resource configuration per backend is shared with the AgentCore account through AWS RAM. AWS notes that when you create a target, AgentCore associates the shared resource configuration with its own VPC Lattice service network, and VPC Lattice delivers connections to the resource gateway interfaces in the network account; that hop is AWS-operated, and from there the customer's routes and firewall apply.

The end-to-end flow: an agent in a shared subnet with no internet route calls the Gateway URL, resolved by private DNS on the Gateway interface endpoint inside the agent VPC. AWS WAF evaluates the request if attached. The Gateway checks its resource policy and the inbound JWT, selects the target and tool, obtains an outbound OAuth token for the tool account, and sends the request over VPC Lattice to the resource gateway. The resource gateway subnets route to the transit gateway, through the inspection VPC, to the tool account's internal ALB or execute-api endpoint. The ALB or API Gateway validates the token and forwards to the backend, and the response returns the same path.

Six configuration decisions anchor the pattern. First, a dedicated resource gateway VPC in the network account, one per trust zone, with egress 443 restricted to application ranges and a route for internal ranges (10.0.0.0/8 in the lab) to the transit gateway. Used only with AgentCore, the resource gateway consumes one IP address per subnet, so small subnets suffice. Two settings cannot be changed after creation, Ipv4AddressesPerEni and ResourceConfigDnsResolution, so they must be chosen up front, and Availability Zone IDs must be ones VPC Lattice and the relevant AgentCore features support.

Second, one resource configuration per load balancer (or one pointing at the network account's execute-api interface endpoint for private API Gateway REST APIs), shared through AWS RAM. Names must not begin with rcfg-, which VPC Lattice reserves. AgentCore sends the target URL host name as TLS SNI and validates the ALB certificate against it, so the certificate's subject alternative name must match; that host name does not need to resolve in DNS. Each private API's resource policy must permit the endpoint via aws:SourceVpce.

Third, firewall rules pass only the needed flows: resource gateway subnets to the tool VPC on 443, and ALB subnets to the identity provider host on 443 so the ALB can fetch signing keys (the JWKS). The lab used AWS Network Firewall with strict rule order and default actions dropping and alerting on established flows. Omitting the JWKS rule produced HTTP 500 at the ALB and an MCP invocation failure for the agent. A proof test added a drop rule for the reply direction ahead of the pass rule; tool calls then hung until timeout and the firewall logged the drops, and removing the rule restored calls.

Fourth, the tool account keeps its own identity provider (Amazon Cognito in the lab) and creates an app client for the Gateway. On an internal ALB the default listener action is a fixed response and every forwarding rule carries a jwt-validation action pinning client_id to the Gateway's app client and requiring a scope such as tools/invoke. In tests, requests with no token, another identity provider's token, or a different app client's token were all rejected with HTTP 401 before the backend ran; the agent only saw a generic internal error, so ALB access logs are the diagnostic. For private REST APIs an API key is not caller authentication, so an authorizer plus an endpoint policy limiting the endpoint to approved accounts is required.

Fifth, Gateway targets reference the shared resource configuration and an OAuth credential provider holding the tool account's client ID, secret and discovery URL, using the client credentials grant. Targets with private endpoints cannot use NO_AUTH for inbound authorization without an interceptor function. If the ALB certificate comes from a private CA, the CA certificate goes into a Secrets Manager secret that the Gateway execution role can read. New operations on an existing target need no new target: update the OpenAPI spec with UpdateGatewayTarget or call SynchronizeGatewayTargets for an MCP server.

Prerequisites include an AWS Organizations setup with RAM sharing enabled, AWS CLI 2.37.7 or later or Boto3 1.43.106 or later for the certificateConfigurations parameter, specific vpc-lattice permissions for the role creating targets, a check of service control policies if VPC Lattice is not in use, and a central inspection firewall attached to the transit gateway in appliance mode.

The design carries explicit limits. Traffic is TLS end to end, so the firewall sees flow metadata and SNI rather than payloads; request content lives in Gateway, WAF and ALB logs. The agent-to-interface-endpoint leg, the Gateway-to-resource-gateway leg, and token requests to identity providers bypass the firewall. With the client credentials grant every call reaches the tool as the Gateway's identity, so tracing a call to a caller relies on inbound JWT claims in Gateway logs. If the firewall applies source NAT, the tool security group must allow the firewall's addresses, leaving the firewall rule and token validation as the controls.

This suggests the pattern is aimed at regulated or tightly governed estates where network centralization is non-negotiable. The trade-off is inspection depth: because payload visibility is sacrificed for end-to-end TLS, teams leaning on the firewall for application-layer security should pair it with AWS WAF rules on the Gateway, which inspects only the first 16 KB of a body by default, adjustable to 64 KB.

Why it matters: platform and security teams running agents against internal systems can now centralize the Gateway's private connectivity under network-team ownership without adopting managed mode or exposing backends. Developers gain a concrete account-by-account build order and verified failure modes, though they take on authorizer configuration, credential-provider management and log-based traceability. My inference is that the extra hops and the shared responsibility split will slow initial setup, but make multi-account agent rollouts far easier to audit and scale.

Read at AWS Machine Learning Blog

Based on reporting from the original publisher. Visit the source for full context and later updates.

Publisher excerpt

Many enterprises run a centralized network model: one account owns every VPC and a central firewall inspects all traffic. This post shows a tested pattern for connecting Amazon Bedrock AgentCore Gateway to private APIs and MCP servers in that model, with the VPC Lattice resource gateway in the network account so every hop crosses the firewall.