feat(gateway-target): support privateEndpoint (VPC Lattice) on gateway targets

オープン
#2,773 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
aws, json, typescript
領域
api, backend, cloud

調査の方向性

Start with AgentCoreGatewayTargetSchema, the existing PrivateEndpointSchema, and the AgentCoreGateway CDK construct; inspect how target configuration is parsed, deployed, and updated. Check the target type support in the linked AWS Gateway VPC egress documentation and the CfnGatewayTarget.PrivateEndpoint property. Done means supported target types accept and validate both endpoint forms and overrides, deploy without drift, and have the requested docs examples.

索引モデルが issue の本文から書いたものです。

説明

Description

Support privateEndpoint (and privateEndpointOverrides) on Gateway Targets in the project spec, agentcore add gateway-target, and the @aws/agentcore-cdk L3 construct, so targets can reach private resources in a customer VPC through VPC Lattice.

AgentCore Gateway supports this today for target types such as MCP server and OpenAPI targets (see Configure AgentCore Gateway VPC egress for Gateway Targets), using either a gateway-managed VPC Lattice resource (managedVpcResource) or a self-managed one (selfManagedLatticeResource), with optional routingDomain to route through an intermediate component such as a VPC endpoint or internal load balancer. None of this can currently be declared in an AgentCore CLI project, so private targets have to be configured outside the CLI.

Proposed usage:

agentcore add gateway-target --gateway MyGateway --target-configuration '{
  "name": "MyPrivateTarget",
  "targetType": "mcpServer",
  "endpoint": "https://mcp.internal.example.com/mcp",
  "privateEndpoint": {
    "managedVpcResource": {
      "vpcIdentifier": "vpc-xxxx",
      "subnetIds": ["subnet-aaaa", "subnet-bbbb"],
      "endpointIpAddressType": "IPV4",
      "securityGroupIds": ["sg-xxxx"]
    }
  }
}'
agentcore deploy

The same privateEndpoint block would apply to other supported target types, e.g. an OpenAPI target whose servers[0].url points at a private endpoint:

{
  "name": "MyPrivateApi",
  "targetType": "openApiSchema",
  "schemaSource": { "inline": { "path": "openapi/my-api.json" } },
  "outboundAuth": { "type": "API_KEY", "credentialName": "MyApiKey" },
  "privateEndpoint": {
    "managedVpcResource": {
      "vpcIdentifier": "vpc-xxxx",
      "subnetIds": ["subnet-aaaa", "subnet-bbbb"],
      "endpointIpAddressType": "IPV4",
      "securityGroupIds": ["sg-xxxx"],
      "routingDomain": "<optional intermediate domain, e.g. a VPC endpoint DNS name>"
    }
  }
}

or a self-managed Lattice resource:

"privateEndpoint": {
  "selfManagedLatticeResource": { "resourceConfigurationIdentifier": "rcfg-xxxx" }
}

Optional shortcut flags for the common managed case could mirror the JSON, e.g.:

agentcore add gateway-target --gateway MyGateway --name MyPrivateTarget \
  --endpoint https://mcp.internal.example.com/mcp \
  --vpc vpc-xxxx --subnets subnet-aaaa subnet-bbbb --security-groups sg-xxxx \
  [--routing-domain <domain>]

Current behavior (agentcore CLI 1.0.1, @aws/agentcore-cdk 1.0.1, latest on npm):

Error: Invalid value for option '--target-configuration': Unrecognized key: "privateEndpoint"
  • AgentCoreGatewayTargetSchema is .strict() and has no privateEndpoint field. PrivateEndpointSchema / ManagedVpcResourceSchema (including routingDomain) already exist in the CLI, but they are only wired into CustomJwtAuthorizerConfigSchema (inbound auth discovery).
  • @aws/agentcore-cdk AgentCoreGateway never sets privateEndpoint on the targets it creates.

Workaround today: add the target with the CLI, agentcore deploy, then patch it out of band with aws bedrock-agentcore-control update-gateway-target --private-endpoint .... This works end to end (the gateway provisions a managed VPC Lattice resource gateway and tool calls succeed), but:

  • it is drift outside CloudFormation, so a later deploy that updates the target can drop privateEndpoint;
  • the update must resend the full target, and resending the returned metadataConfiguration fails with Header 'x-amzn-bedrock-agentcore-policy-session-id' is restricted and cannot be configured (that header is present when a policy engine is attached), so it has to be stripped first.

Note: AWS::BedrockAgentCore::GatewayTarget now has a PrivateEndpoint property (CfnGatewayTarget.privateEndpoint in aws-cdk-lib 2.269.0), so this can go through the CDK path rather than a post-deploy call.

Acceptance Criteria
  • agentCoreGateways[].targets[] accepts an optional privateEndpoint (exactly one of managedVpcResource / selfManagedLatticeResource, reusing the existing PrivateEndpointSchema) and privateEndpointOverrides, for every target type the service supports with private endpoints.
  • agentcore add gateway-target --target-configuration accepts the field; validation rejects it on target types that don't support it.
  • @aws/agentcore-cdk maps it to CfnGatewayTarget.PrivateEndpoint, and agentcore deploy creates and updates targets with it, with no drift on later deploys.
  • Optional: shortcut flags on agentcore add gateway-target (e.g. --vpc, --subnets, --security-groups, --routing-domain) and TUI support.
  • Docs: examples for a managed private endpoint, a self-managed Lattice resource, and routingDomain.
Additional Context
  • Related: #1362 (closed as completed), which tracked VPC egress for gateway targets when CloudFormation did not yet support it. In 1.0.1, target-level private endpoints are still not configurable.
  • Reference: Configure Amazon Bedrock AgentCore Gateway VPC Egress for Gateway Targets: privateEndpoint examples for MCP server and OpenAPI targets, routingDomain, and private REST APIs in API Gateway.
主要言語
TypeScript
スター
339
フォーク
129
平均マージ
19時間 21分
マージ済み PR(30日)
125

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

aws/agentcore-cli のほかの issue

aws/agentcore-cli の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。