Amazon Bedrock AgentCore Gateway のプライベートリソースへの安全なアクセス設定
AWS は、Amazon Bedrock AgentCore Gateway の VPC エグレス機能を強化し、Agent や MCP サーバーがパブリックインターネットを経由せずに内部リソースに安全かつ直接的に接続できる構成方法を詳述している。
キーポイント
VPC 境界内への安全なアクセス実現
Amazon Bedrock AgentCore の VPC 接続機能により、AI エージェントがパブリックインターネットを介さずに内部 API やデータベースに直接アクセスできるようになり、セキュリティリスクと運用負荷が軽減される。
Resource Gateway と ENI の活用
Managed Resource Gateway を使用して VPC 内の各サブネットに Elastic Network Interfaces (ENIs) をプロビジョニングし、AgentCore Gateway からリソース VPC へトラフィックを流すアーキテクチャが解説されている。
多様な実装モードとユースケース
管理型とセルフマネージド型の2つの実装モードに対応し、プライベートな API Gateway、EKS 上の MCP サーバー、および REST API への接続という3つの具体的なシナリオが紹介されている。
影響分析・編集コメントを表示
影響分析
この機能は、AI エージェントを本番環境で安全かつ効率的に運用するための重要なインフラ要件を満たすものであり、特に機密データを扱う企業や厳格なコンプライアンスが求められる業界において、エージェントの導入障壁を下げます。ネットワークの複雑さを抽象化することで、開発者はセキュリティ設定よりもアプリケーションロジックの開発に集中できるようになります。
編集コメント
AI エージェントのセキュリティ要件が高まる中、パブリックアクセスを回避するネイティブな VPC 接続機能は実務において極めて重要です。特に MCP(Model Context Protocol)との連携を強化することで、エージェントエコシステムの信頼性が向上します。
本番環境における AI エージェントは、Amazon Virtual Private Cloud (Amazon VPC) の境界の背後に位置する内部 API、データベース、およびプライベートリソースへのアクセスを必要とすることがよくあります。各エージェントからツールへのパスごとにプライベート接続性を管理することは運用オーバーヘッドを増大させ、デプロイメントを遅らせる要因となります。Amazon Bedrock AgentCore の VPC 接続性 は、ネットワークトラフィックがパブリックインターネットに露出することなく AI エージェントおよび Model Context Protocol (MCP) サーバーをデプロイするために設計されています。この機能は、Amazon Bedrock AgentCore Gateway に対する管理された Amazon VPC エグレスにも適用されるため、AWS 環境内のプライベートネットワーク内のエンドポイントに接続することが可能になります。
本記事では、Amazon VPC の各サブネットごとに 1 つずつ Elastic Network Interfaces (ENIs) を直接プロビジョニングする管理型構成要素である Resource Gateway を使用して、Amazon Bedrock AgentCore Gateway がプライベートエンドポイントにアクセスできるように設定する方法について説明します。また、管理モードとセルフマネージドモードの 2 つの実装モードを探求し、プライベートな Amazon API Gateway エンドポイントへの接続、Amazon Elastic Kubernetes Service (Amazon EKS) 上の MCP サーバーとの統合、およびプライベート REST API へのアクセスという 3 つの実践的なシナリオを順を追って解説します。
主要用語
本記事全体で用いられる以下の用語を確認し、各コンポーネントが AgentCore Gateway の VPC エグレスアーキテクチャにどのように組み込まれるかを理解した上で進めてください。
Resource VPC: プライベートリソースが存在する Amazon VPC です。例えば、プライベートホストされた MCP サーバーや API エンドポイントを含む VPC が該当します。これは AgentCore Gateway が到達する必要がある Amazon VPC です。Resource VPC は、AgentCore Gateway のアカウントと同じ AWS アカウント内にある場合もあれば、異なるアカウント内にある場合もあります。
AgentCore Gateway account: AgentCore Gateway リソースを作成および管理する AWS アカウントです。このアカウントは、Resource VPC と同じアカウントである場合も、異なるアカウントである場合もあります。
リソースゲートウェイ: リソースゲートウェイ は、リソース VPC へのプライベートな入り口として機能します。作成されると、指定された各サブネットごとに 1 つの ENI(Elastic Network Interface)がプロビジョニングされ、それぞれが VPC 内に配置されます。AgentCore Gateway からプライベートリソースへのトラフィックは、これらの ENI を経由して到着します。
リソース設定: VPC リソースのリソース設定 は、ドメイン名または IP アドレスによって識別される、AgentCore Gateway がリソースゲートウェイを介して到達することが許可された特定のリソースを定義します。Amazon VPC 全体へのアクセス権限を与えるのではなく、リソース設定は接続性を単一のエンドポイントに限定します。
サービスネットワークリソースアソシエーション: サービスネットワークリソースアソシエーションは、リソース設定を AgentCore サービスネットワークに接続し、これにより AgentCore Gateway サービスがプライベートエンドポイントを呼び出すことを可能にします。AgentCore は、使用するモードに関わらず、このアソシエーションをユーザーの代わりに作成および管理します。
AgentCore Gateway VPC イグレスはどのように動作するか?
AgentCore Gateway VPC イグレス(外部接続)は、基盤となるネットワークインフラストラクチャに対する制御の度合いや、クロス-VPC 接続のためのアーキテクチャ設計方法に応じて、2 つのモードをサポートしています。
Managed VPC リソース
このモードでは、AgentCore Gateway がすべてを代行して処理します。ターゲット設定の一部として VPC ID、サブネット ID、セキュリティグループを提供するだけで、AgentCore が自動的にアカウント内で VPC リソースゲートウェイを作成・管理します。このモードは、既存のネットワークアーキテクチャと統合され、同一リージョン間またはクロスリージョン接続に VPC ピアリング を使用する場合や、マルチ VPC やハイブリッド環境向けに AWS Transit Gateway を用いたハブ・アンド・スポークモデルを採用している場合にも対応しています。
以下のアーキテクチャ図は、Managed VPC リソースモードを使用して AgentCore Gateway がプライベートな Amazon API Gateway に接続する方法を示しています。

AgentCore Gateway Target を管理された VPC リソース構成で作成すると、AgentCore Gateway がリクエストを開始し、リソースオーナーの VPC 内の Resource Gateway にルーティングします。Resource Gateway は、サブネットにプロビジョニングされ、あなたが設定したセキュリティグループによって制御される ENI を経由してトラフィックを転送します。ENI から、リクエストは execute-api VPC エンドポイント に到達します。管理された VPC リソースモードでは、AgentCore が代わりに Resource Gateway を作成および管理するため、あなたはそれに対して読み取り専用での可視性しか持ちません。
自己管理型 Lattice リソース
このモードでは、AgentCore Gateway でターゲット作成時に参照する前に、VPC Lattice Resource Gateway およびリソース構成を自分で作成して管理します。これにより、ENI あたりの IPv4 アドレス数、サブネットの配置、セキュリティグループルールを含むリソース構成に対する可視性と制御権が得られます。さらに重要なのは、リソース構成自体への可視性が得られる点です。AWS リソースアクセスマネージャー (AWS RAM) を使用して共有する機能(クロスアカウント接続に必須)や、それに関連付けられたアソシエーションを確認できる機能、そして必要に応じてそれらのアソシエーションを取り消す能力が得られます。
以下のアーキテクチャ図は、自己管理型 Lattice リソースモードを使用して AgentCore Gateway がプライベートな REST API エンドポイントに接続する方法を示しています。

セルフマネージド Lattice リソースモードでは、AgentCore Gateway ターゲットを設定する前に、リソースゲートウェイとリソース構成を事前に作成する必要があります。CreateGatewayTarget を呼び出す際、AgentCore Gateway ターゲットをプライベートエンドポイントに関連付けるために、リソース構成 ID を渡します。実行時には、リソースゲートウェイがサブネットにプロビジョニングされた ENI(Elastic Network Interface)を経由してリクエストを転送し、これは設定したセキュリティグループによって制御されます。ENI からリクエストは execute-api VPC エンドポイントに到達します。マネージド VPC リソースモードとは異なり、リソースゲートウェイとリソース構成の所有権および管理責任はユーザーにあります。
以下の表を使用して、ご自身のアーキテクチャにどのモードが適しているか判断してください。セットアップを簡素化したい場合はマネージド VPC リソースモードを選択し、リソースゲートウェイのライフサイクル制御、クロスアカウント接続性、および関連付けの可視性を重視する場合はセルフマネージド Lattice リソースモードを選択してください。
次元
AgentCore マネージド VPC リソース
セルフマネージド Lattice リソース
セットアップの複雑さ
シンプルです。VPC ID、サブネット ID、セキュリティグループ ID を提供すれば、AgentCore が残りを管理します。
高度な設定が必要です。Amazon VPC Lattice リソースゲートウェイとリソース構成を自分で作成・管理し、その後、各ターゲットにリソース構成 ID を渡す必要があります。
IPv4 の消費量
各管理されたリソースゲートウェイは、ENI あたり 1 つの IP アドレスを消費します。これは設定できません。
Amazon Bedrock AgentCore と併用する場合、サブネットあたり 1 つの IP アドレスを消費します。また、他の VPC Lattice サービスネットワークにも接続されている場合、リソースゲートウェイ上の ipv4AddressesPerEni 値に基づいて追加の IP アドレスを消費します。
クロスアカウント対応
ネイティブではサポートされていません。クロスアカウント/クロス VPC シナリオには、ハブ・アンド・スポークアーキテクチャ(VPC ピアリングまたは AWS Transit Gateway)を使用してください。
AWS Resource Access Manager (AWS RAM) でサポートされています。VPC ピアリングやトランジットゲートウェイを必要とせず、直接のクロスアカウント接続を可能にします。
既存の ENI の再利用
AgentCore は、アカウント内のターゲット間で、managedVpcResource 設定が Amazon VPC、サブネットセット、セキュリティグループセット、タグ、および IP アドレスタイプで一致する場合、1 つのリソースゲートウェイ(とその ENI)を自動的に再利用します。
複数のリソース構成を、あなたが所有する単一のリソースゲートウェイにアタッチできます。そのリソースゲートウェイに解決されるターゲットは、ENI を共有します
リソースゲートウェイのライフサイクル管理
Amazon Bedrock AgentCore は、あなたの代わりにリソースゲートウェイを作成し、再利用し、削除します。
あなたが所有するのは、リソースゲートウェイとリソース構成の完全なライフサイクルです
ガバナンスと可視性
リソース構成は、Amazon Bedrock AgentCore サービスアカウントで管理され、あなたの Amazon VPC コンソールでは表示されません。基盤となるリソースゲートウェイは、読み取り専用モードであなたのアカウント内に表示されます。
あなたの Amazon VPC Lattice コンソールでは、リソース構成、サービスネットワークの関連付け、および接続されたドメインを完全に可視化できます。接続を監査し、細粒度レベルでアクセスを取り消すことも可能です
料金
リソースゲートウェイを通じて処理されるデータのみに対する GB ごとのデータ処理課金です。
1) サービスネットワークの関連付けに対する時間課金2) GB ごとのデータ処理課金
AgentCore Gateway VPC エグレスの始め方
本記事では、管理された VPC リソースモードに焦点を当てます。自己管理型の Lattice リソース提供について探索したい場合は、コードサンプル を参照してください。始める前に、本記事では Amazon VPC、AWS Command Line Interface (AWS CLI)、Amazon Bedrock AgentCore、および Amazon Bedrock AgentCore Gateway に関する基本的な知識を前提としています。以下の準備が整っていることを確認してください。
- AWS Command Line Interface (AWS CLI)
- AWS クレデンシャル
- 公開認証局 (Public Certificate Authority)
現在、AgentCore Gateway は公的に署名された TLS 証明書のみを信頼しており、プライベート CA によって署名された証明書を信頼しません。そのため、バックエンドへのハンドシェイクが失敗します。エンドポイントがプライベートまたは自己署名証明書で保護されている場合は、GitHub の動作する解決策サンプルを見つけてください。
- AWS Identity and Access Management (IAM) の権限
AgentCore が必要に応じてサービスリンクドロールを代わりに作成できるようにするには、iam:CreateServiceLinkedRole 権限(bedrock-agentcore.amazonaws.com 向け)が IAM プリンシパルに付与されている必要があります。必要な IAM ポリシーについては、Gateway サービスリンクドロール を参照してください。
- セキュリティグループの設定
Resource Gateway のセキュリティグループは、Resource Gateway ENI が Amazon VPC 内のリソースに対して送信できるトラフィックを制御します。CreateGatewayTarget API を呼び出す際にセキュリティグループを指定しない場合、デフォルトのセキュリティグループが使用されます。
- AgentCore Gateway
この手順では、既存の AgentCore Gateway があることを前提としています。まだ作成していない場合は、以下を実行してください:
aws bedrock-agentcore create-gateway \
--name my-gateway \
--role-arn arn:aws:iam:::role/AgentCoreGatewayRole
レスポンスから gatewayId をメモしておいてください。これは後続のステップで AgentCore Gateway Targets を作成する際に必要になります。
- 詳細な例については、GitHub リポジトリを参照してください。
プライベート Amazon API Gateway
このセクションでは、プライベートな Amazon API Gateway へルーティングする AgentCore Gateway ターゲットを作成します。CreateGatewayTarget API を以下のパラメータで呼び出してください。openApiSchema フィールドには、プライベートな Amazon API Gateway のエンドポイント URL (https://{api-id}-{vpce-id}.execute-api.{region}.amazonaws.com/{stage}) を指定します。managedVpcResource ブロックには、VPC ID、サブネット ID、およびセキュリティグループ ID を提供してください。
aws bedrock-agentcore-control create-gateway-target \
--region us-west-2 \
--cli-input-json '{
"gatewayIdentifier": "",
"name": "private-apigw",
"description": "Private API Gateway",
"targetConfiguration": {
"mcp": {
"openApiSchema": {
"inlinePayload": "..."
}
}
},
"credentialProviderConfigurations": [...],
"privateEndpoint": {
"managedVpcResource": {
"vpcIdentifier": "",
"subnetIds": ["", ""],
"endpointIpAddressType": "IPV4",
"securityGroupIds": [""]
}
}
}'
コマンドを実行すると、AgentCore Gateway はサービスリンクロールを使用して VPC 内にリソースゲートウェイをプロビジョニングし、指定した各サブネットごとに 1 つの ENI (Elastic Network Interface) を作成します。
以下のアーキテクチャ図は、ネットワークフローを示しています。

AgentCore Gateway がリクエストを開始し、Resource Owner VPC 内にプロビジョニングされた Resource Gateway にルーティングします。トラフィックはプライベートサブネット内の ENI(ネットワークインターフェース)を通過し、セキュリティグループルールが次のホップに到達するものを制御します。そこからリクエストは execute-api VPC エンドポイントに到達し、Amazon API Gateway の内部エンドポイントへのプライベート接続を提供します。エンドポイント URL 形式 https://{api-id}-{vpce-id}.execute-api.{region}.amazonaws.com/{stage} は、CreateGatewayTarget コールの openApiSchema フィールドで指定したものです。
Amazon EKS 上のプライベート MCP サーバー
このセクションでは、Amazon EKS で実行されているプライベート MCP サーバーにルーティングする AgentCore Gateway ターゲットを作成します。以下のパラメータを使用して CreateGatewayTarget API を呼び出してください。mcpServer ブロックには、内部 MCP サーバーのエンドポイント URL を提供し、managedVpcResource ブロックには VPC ID、サブネット ID、およびセキュリティグループ ID を提供します。
aws bedrock-agentcore-control create-gateway-target \
--region us-west-2 \
--cli-input-json '{
"gatewayIdentifier": "",
"name": "private-apigw",
"description": "Private API Gateway",
"targetConfiguration": {
"mcp": {
"mcpServer": {
"endpoint": "https://internal.example.com/csm/mcp"
}
}
},
"credentialProviderConfigurations": [...],
"privateEndpoint": {
"managedVpcResource": {
"vpcIdentifier": "",
"subnetIds": ["", ""],
"endpointIpAddressType": "IPV4",
"securityGroupIds": [""]
}
}
}'
このコマンドを実行すると、AgentCore は VPC 内にリソースゲートウェイをプロビジョニングし、指定した各サブネットごとに 1 つの ENI(Elastic Network Interface)を作成します。以下のアーキテクチャ図は、エンドツーエンドのトラフィックパスを示しています。

AgentCore Gateway は、内部エンドポイントに対して HTTPS リクエストを送信します。Amazon Route 53 プライベートホストドメインゾーンは、そのドメインを内部の<a href="https://docs.aws.amazon.com/elasticloadbalancing/latest/network/introduction.html#:~:text=Classic%20Load%20Balancers.-,Network%20Load%20Balancer%20components,listeners%20to%20your%20load%20balancer." target="_blank" rel="noopener noreferre
原文を表示
AI agents in production environments often need to reach internal APIs, databases, and private resources that sit behind Amazon Virtual Private Cloud (Amazon VPC) boundaries. Managing private connectivity for each agent-to-tool path adds operational overhead and slows deployment. Amazon Bedrock AgentCore VPC connectivity is designed to deploy AI agents and Model Context Protocol (MCP) servers without requiring the network traffic to be exposed to the public internet. This capability extends to managed Amazon VPC egress for Amazon Bedrock AgentCore Gateway, so you can connect to endpoints inside private networks across your AWS environment.
In this post, you will configure Amazon Bedrock AgentCore Gateway to access private endpoints usingResource Gateway, a managed construct that provisions Elastic Network Interfaces (ENIs) directly inside your Amazon VPC, one per subnet. You will explore two implementation modes (managed and self-managed) and walk through three practical scenarios: connecting to a private Amazon API Gateway endpoint, integrating with a MCP server on Amazon Elastic Kubernetes Service (Amazon EKS), and accessing a private REST API.
Key terms
The following terms are used throughout this post. Review them before proceeding to understand how each component fits into the AgentCore Gateway VPC egress architecture.
Resource VPC: The Amazon VPC where your private resource lives. For example, the VPC containing your privately hosted MCP server or API endpoint. This is the Amazon VPC that AgentCore Gateway needs to reach. Resource VPC can either be in the same AWS account as the AgentCore Gateway account or in a different account.
AgentCore Gateway account: The AWS account where you create and manage your AgentCore Gateway resources. This account may or may not be the same account as the Resource VPC.
Resource Gateway: Resource gateway acts as the private entry point into your Resource VPC. When created, it provisions one ENI per subnet that you specify, each sitting inside your VPC. Traffic from AgentCore Gateway to your private resource arrives through these ENIs.
Resource Configuration: Resource configuration for VPC resources defines the specific resource AgentCore Gateway is allowed to reach through the Resource Gateway, identified by a domain name, or IP address. Rather than granting access to your entire Amazon VPC, a Resource Configuration scopes connectivity to a single endpoint.
Service Network Resource Association: A service network resource association connects a resource configuration to the AgentCore service network, which allows AgentCore Gateway service to invoke your private endpoint. AgentCore creates and manages this association on your behalf, regardless of which mode you use.
How does AgentCore Gateway VPC egress work?
AgentCore Gateway VPC egress supports two modes depending on how much control you want over the underlying networking infrastructure and how you want to architect for cross-VPC connectivity.
Managed VPC resource
In this mode, AgentCore Gateway handles everything on your behalf. You provide your VPC ID, subnet IDs, and security groups as part of your target configuration, and AgentCore automatically creates and manages the VPC Resource Gateway in your account. This mode integrates with existing network architectures, whether you useVPC peering for same-Region or cross-Region connectivity or a hub-and-spoke model with AWS Transit Gateway for multi-VPC and hybrid environments.
The following architecture shows how AgentCore Gateway connects to private Amazon API Gateway using managed VPC resource mode.

When you create an AgentCore Gateway Target with a managed VPC resource configuration, AgentCore Gateway initiates the request and routes it to the Resource Gateway inside your Resource Owner VPC. The Resource Gateway forwards traffic through an ENI provisioned in your subnet, governed by the security groups you configure. From the ENI, the request reaches the execute-api VPC endpoint. In managed VPC Resource mode, AgentCore creates and manages the Resource Gateway on your behalf, you only have read-only visibility into it.
Self-managed Lattice resource
In this mode, you create and manage the VPC Lattice Resource Gateway and Resource configuration before referencing it during target creation on AgentCore Gateway. This gives you visibility and control over the Resource configuration, including the number of IPv4 addresses per ENI, subnet placement, and security group rules. More importantly, it gives you visibility into the resource configuration itself, with the ability to view it, share it using AWS Resource Access Manager (AWS RAM) (required for cross-account connectivity), see associations tied to it, and retain the ability to revoke those associations when you choose.
The following architecture shows how AgentCore Gateway connects to private Rest API endpoints using self-managed lattice resource mode.

In self-managed lattice resource mode, you pre-create the Resource Gateway and Resource Configuration before configuring your AgentCore Gateway Target. When you call CreateGatewayTarget, you pass the Resource Configuration ID to associate AgentCore Gateway target with your private endpoint. At invocation time, Resource Gateway forwards the request through an ENI provisioned in your subnet, governed by the security groups you configure. From the ENI, the request reaches the execute-api VPC endpoint. Unlike managed VPC Resource mode, you own and manage the Resource Gateway and Resource Configuration.
Use the following table to determine which mode fits your architecture. Choose managed VPC resource mode for streamlined setup, or self-managed Lattice resource mode for control over Resource Gateway lifecycle, cross-account connectivity, and visibility into associations.
Dimension
AgentCore Managed VPC Resource
Self-Managed Lattice Resource
Setup complexity
Straightforward; provide VPC ID, subnet IDs, and security group IDs. AgentCore manages the rest
Advanced; you create and manage the Amazon VPC Lattice Resource Gateway and Resource Configurations yourself, then pass the resource configuration ID to each target
IPv4 consumption
Each managed resource gateway consumes 1 IP address per ENI. This is not configurable
When used with Amazon Bedrock AgentCore, it consumes one IP address per subnet. If also attached to other VPC Lattice service networks, it consumes additional IPs based on the ipv4AddressesPerEni value on the resource gateway
Cross-account
Not natively supported use hub-and-spoke architectures (VPC peeringor AWS Transit Gateway ) for cross-account / cross-VPC scenarios.
Supported with AWS Resource Access Manage (AWS RAM). Enables direct cross-account connectivity without requiring VPC peering or Transit Gateways.
Reusing existing ENIs
AgentCore automatically reuses one Resource Gateway (and its ENIs) across targets in the account whose managedVpcResource config matches on Amazon VPC, subnet set, security-group set, tags, and IP address type
You attach multiple Resource Configurations to a single Resource Gateway you own; target whose resourceConfigurationIdentifier resolves to that Resource Gateway shares its ENIs
Resource Gateway Lifecycle management
Amazon Bedrock AgentCore creates, reuses, and deletes Resource Gateways on your behalf
You own the full lifecycle of resource gateways and resource configurations
Governance and visibility
Resource Configurations are managed in the Amazon Bedrock AgentCore service account and aren’t visible in your Amazon VPC console. The underlying Resource Gateway is visible in your account in read-only mode
Full visibility into Resource Configurations, Service Network associations, and connected domains in your Amazon VPC Lattice console. You can audit connections and revoke access at a granular level
Pricing
Per-GB data processing charges only (for data processed through the Resource Gateway)
1) Hourly charge for Service Network association2) Per-GB data processing charges
Get started with AgentCore Gateway VPC egress
In this post, you focus on the managed VPC resource mode. If you want to explore the self-managed lattice resource offering, follow the code samples. Before getting started, this post assumes basic familiarity with Amazon VPC, AWS Command Line Interface (AWS CLI), Amazon Bedrock AgentCore, and Amazon Bedrock AgentCore Gateway. Make sure that you have the following in place.
- AWS Command Line Interface (AWS CLI)
- AWS Credentials
- Public Certificate Authority
Currently AgentCore Gateway’s trusts publicly signed TLS certificates; it doesn’t trust certificates signed by a private CA, so the handshake to your backend fails. If your endpoint is protected by a private or self-signed certificate, find the working solution sample on GitHub.
- AWS Identity and Access Management (IAM) permissions
Your IAM principal needs the iam:CreateServiceLinkedRole permission for bedrock-agentcore.amazonaws.com, so that AgentCore can create the service-linked role on your behalf if it does not already exist. For the required IAM policy, see Gateway service-linked role.
- Set up security groups
The Resource Gateway security group controls what traffic the Resource Gateway ENIs can send outbound to resources inside your Amazon VPC. If you don’t provide the security group while invoking CreateGatewayTargetAPI, then the default security group is used.
- AgentCore Gateway
This walkthrough assumes that you have an existing AgentCore Gateway. If you haven’t created one yet, run:
aws bedrock-agentcore create-gateway \
--name my-gateway \
--role-arn arn:aws:iam:::role/AgentCoreGatewayRoleNote the gatewayId from the response. You need it when creating AgentCore Gateway Targets in the steps that follow.
- For in-depth examples, see the GitHub repository .
Private Amazon API Gateway
In this section, you create an AgentCore Gateway target that routes to a private Amazon API Gateway. Call the CreateGatewayTargetAPI with the following parameters. In the openApiSchema field, provide your private Amazon API Gateway endpoint URL (https://{api-id}-{vpce-id}.execute-api.{region}.amazonaws.com/{stage}). In the managedVpcResource block, provide your VPC ID, subnet IDs, and security group ID.
aws bedrock-agentcore-control create-gateway-target \
--region us-west-2 \
--cli-input-json '{
"gatewayIdentifier": "",
"name": "private-apigw",
"description": "Private API Gateway",
"targetConfiguration": {
"mcp": {
"openApiSchema": {
"inlinePayload": "..."
}
}
},
"credentialProviderConfigurations": [...],
"privateEndpoint": {
"managedVpcResource": {
"vpcIdentifier": "",
"subnetIds": ["", ""],
"endpointIpAddressType": "IPV4",
"securityGroupIds": [""]
}
}
}'
After you run the command, AgentCore Gateway uses its service-linked role to provision a Resource Gateway in your VPC, creating one ENI per subnet you specified.
The following architecture diagram shows the network flow.

AgentCore Gateway initiates the request and routes it to the Resource Gateway provisioned inside Resource Owner VPC. Traffic passes through the ENI inside your private subnet, where your security group rules govern what reaches the next hop. From there, the request reaches the execute-api VPC endpoint, which provides private connectivity to your Amazon API Gateway internal endpoint. The endpoint URL format https://{api-id}-{vpce-id}.execute-api.{region}.amazonaws.com/{stage} is what you provided in the openApiSchema field of your CreateGatewayTarget call.
Private MCP server on Amazon EKS
In this section, you create an AgentCore Gateway target that routes to a private MCP server running on Amazon EKS. Call the CreateGatewayTarget API with the following parameters. In the mcpServer block, provide your internal MCP server endpoint URL. In the managedVpcResource block, provide your VPC ID, subnet IDs, and security group ID.
aws bedrock-agentcore-control create-gateway-target \
--region us-west-2 \
--cli-input-json '{
"gatewayIdentifier": "",
"name": "private-apigw",
"description": "Private API Gateway",
"targetConfiguration": {
"mcp": {
"mcpServer": {
"endpoint": "https://internal.example.com/csm/mcp"
}
}
},
"credentialProviderConfigurations": [...],
"privateEndpoint": {
"managedVpcResource": {
"vpcIdentifier": "",
"subnetIds": ["", ""],
"endpointIpAddressType": "IPV4",
"securityGroupIds": [""]
}
}
}'
After you run this command, AgentCore provisions a Resource Gateway in your VPC, creating one ENI per subnet you specified. The following architecture diagram shows the end-to-end traffic path.

AgentCore Gateway sends an HTTPS request to your internal endpoint. The Amazon Route 53 private hosted zone resolves that domain to the internal <a href="https://docs.aws.amazon.com/elasticloadbalancing/latest/network/introduction.html#:~:text=Classic%20Load%20Balancers.-,Network%20Load%20Balancer%20components,listeners%20to%20your%20load%20balancer." target="_blank" rel="noopener noreferre
関連記事
今日のまとめ
AI日報で今日の重要ニュースをまとめ読み