AWS bedrock-agentcore documentation change
Summary
Updated documentation for adding gateway targets in AgentCore, replacing references from 'AgentCore starter toolkit' to 'AgentCore CLI', adding new CLI command examples with `agentcore add gateway-target`, and including interactive terminal UI instructions with screenshots for Lambda, API Gateway, OpenAPI, Smithy, and MCP server targets.
Security assessment
The changes are primarily documentation updates for command syntax and user interface workflows. There is no mention of security vulnerabilities, patches, or incident responses. The changes include updates to outbound authorization configuration (e.g., API keys, OAuth) but these are part of existing feature documentation, not new security features or fixes.
Diff
diff --git a/bedrock-agentcore/latest/devguide/gateway-add-target-api-target-config.md b/bedrock-agentcore/latest/devguide/gateway-add-target-api-target-config.md index 444591ef8..b1261e1d2 100644 --- a//bedrock-agentcore/latest/devguide/gateway-add-target-api-target-config.md +++ b//bedrock-agentcore/latest/devguide/gateway-add-target-api-target-config.md @@ -30 +30 @@ Select a topic to see examples of adding a target type: -If you use the AgentCore starter toolkit (either the CLI or the Python SDK), you can add a Lambda target to your gateway by specifying the `--target_type` as `lambda` and omitting all optional arguments. The default Lambda function and accompanying tool schema can be found in the [AgentCore starter toolkit github](https://github.com/aws/bedrock-agentcore-starter-toolkit/blob/main/src/bedrock_agentcore_starter_toolkit/operations/gateway/constants.py). +You can add a Lambda target to your gateway using the AgentCore CLI by specifying the `--type` as `lambda-function-arn` and providing the Lambda ARN and a tool schema file. @@ -47 +47 @@ Select one of the following methods: -AgentCore starter toolkit (CLI) +AgentCore CLI @@ -50 +50 @@ AgentCore starter toolkit (CLI) -###### Add a default Lambda function as a target +To add a Lambda function as a target, run `agentcore add gateway-target` with the `--type lambda-function-arn` option. Provide the Lambda ARN and a JSON file containing the tool schema: @@ -52 +51,0 @@ AgentCore starter toolkit (CLI) -To add the default Lambda function as a target to your gateway in the AgentCore starter toolkit CLI, run the `create_mcp_gateway_target` command and specify the `--target_type` argument as `lambda`. The following example shows the minimum arguments you can provide: @@ -53,0 +53,7 @@ To add the default Lambda function as a target to your gateway in the AgentCore + agentcore add gateway-target \ + --name MyLambdaTarget \ + --type lambda-function-arn \ + --lambda-arn arn:aws:lambda:us-east-1:123456789012:function:MyFunction \ + --tool-schema-file tools.json \ + --gateway MyGateway + agentcore deploy @@ -55,5 +61 @@ To add the default Lambda function as a target to your gateway in the AgentCore - agentcore create_mcp_gateway_target \ - --gateway-arn arn:aws:bedrock-agentcore:us-east-1:123456789012:gateway/my-gateway \ - --gateway-url https://gateway-id.gateway.bedrock-agentcore.us-west-2.amazonaws.com/mcp \ - --role-arn arn:aws:iam::123456789012:role/AgentCoreGatewayExecutionRole \ - --target-type lambda +AgentCore Python SDK @@ -61 +62,0 @@ To add the default Lambda function as a target to your gateway in the AgentCore -AgentCore starter toolkit (Python) @@ -63,2 +64 @@ AgentCore starter toolkit (Python) - -With the AgentCore starter toolkit, you can easily create a Lambda target with default configurations.s +With the AgentCore CLI, you can easily create a Lambda target with default configurations. @@ -174,0 +175,9 @@ The following Python code shows how to add a Lambda target using the AWS Python +Interactive + + +In the AgentCore CLI interactive terminal UI, run `agentcore`, select **add** , choose **Gateway Target** , and then select **Lambda function** : + + + +The wizard then prompts you for the target name, Lambda function ARN, tool schema file, and outbound authorization configuration. + @@ -189,0 +199,14 @@ Select one of the following methods: +AgentCore CLI + + +To add an API Gateway REST API stage as a target, run `agentcore add gateway-target` with the `--type api-gateway` option: + + + agentcore add gateway-target \ + --name MyAPIGatewayTarget \ + --type api-gateway \ + --rest-api-id your-rest-api-id \ + --stage your-stage \ + --gateway MyGateway + agentcore deploy + @@ -281,5 +304 @@ The following code shows uses the AWS Python SDK (Boto3): -## Add an OpenAPI target - -Select one of the following methods: - -AgentCore starter toolkit +Interactive @@ -288 +307 @@ AgentCore starter toolkit -###### Example with S3 definition and API key outbound authorization +In the AgentCore CLI interactive terminal UI, run `agentcore`, select **add** , choose **Gateway Target** , and then select **API Gateway REST API** : @@ -290 +309 @@ AgentCore starter toolkit -The following example demonstrates adding an OpenAPI schema target to a gateway. The schema has been uploaded to an S3 location whose URI is referenced in the `target_payload`. Outbound authorization for the target is through an API key. + @@ -291,0 +311 @@ The following example demonstrates adding an OpenAPI schema target to a gateway. +The wizard then prompts you for the target name, REST API ID, stage, and outbound authorization configuration. @@ -293,5 +313 @@ The following example demonstrates adding an OpenAPI schema target to a gateway. - # Import dependencies - from bedrock_agentcore_starter_toolkit.operations.gateway.client import GatewayClient - - # Initialize the client - gateway_client = GatewayClient(region_name="us-west-2") +## Add an OpenAPI target @@ -299,15 +315 @@ The following example demonstrates adding an OpenAPI schema target to a gateway. - # Create an OpenAPI target with API Key authentication - open_api_target = gateway_client.create_mcp_gateway_target( - gateway="your-gateway-id", - target_type="openApiSchema", - target_payload={ - "s3": { - "uri": "s3://your-bucket/path/to/open-api-spec.json" - } - }, - credentials={ - "api_key": "your-api-key", - "credential_location": "HEADER", - "credential_parameter_name": "X-API-Key" - } - ) +Select one of the following methods: @@ -315 +317 @@ The following example demonstrates adding an OpenAPI schema target to a gateway. -###### Example with S3 definition and OAuth outbound authorization +AgentCore CLI @@ -317 +318,0 @@ The following example demonstrates adding an OpenAPI schema target to a gateway. -The following example demonstrates adding an OpenAPI schema target to a gateway. The schema has been uploaded to an S3 location whose URI is referenced in the `target_payload`. Outbound authorization for the target is through an OAuth. @@ -318,0 +320 @@ The following example demonstrates adding an OpenAPI schema target to a gateway. +To add an OpenAPI schema target, run `agentcore add gateway-target` with the `--type open-api-schema` option and provide the path to your OpenAPI specification file: @@ -320,2 +321,0 @@ The following example demonstrates adding an OpenAPI schema target to a gateway. - # Import dependencies - from bedrock_agentcore_starter_toolkit.operations.gateway.client import GatewayClient @@ -323,28 +323,7 @@ The following example demonstrates adding an OpenAPI schema target to a gateway. - # Initialize the client - gateway_client = GatewayClient(region_name="us-west-2") - - # Create an OpenAPI target with OAuth authentication - open_api_with_oauth_target = gateway_client.create_mcp_gateway_target( - gateway="your-gateway-id", - target_type="openApiSchema", - target_payload={ - "s3": { - "uri": "s3://your-bucket/path/to/open-api-spec.json" - } - }, - credentials={ - "oauth2_provider_config": { - "customOauth2ProviderConfig": { - "oauthDiscovery": { - "authorizationServerMetadata": { - "issuer": "https://example.auth0.com", - "authorizationEndpoint": "https://example.auth0.com/authorize", - "tokenEndpoint": "https://example.auth0.com/oauth/token" - } - }, - "clientId": "your-client-id", - "clientSecret": "your-client-secret" - } - } - } - ) + agentcore add gateway-target \ + --name MyOpenAPITarget \ + --type open-api-schema \ + --schema path/to/openapi-spec.json \ + --outbound-auth none|api-key|oauth \ + --gateway MyGateway + agentcore deploy @@ -391 +370 @@ The following Python code shows how to add an OpenAPI target using the AWS Pytho -## Add a Smithy target +Interactive @@ -393 +371,0 @@ The following Python code shows how to add an OpenAPI target using the AWS Pytho -Select one of the following methods: @@ -395 +373 @@ Select one of the following methods: -AgentCore starter toolkit +In the AgentCore CLI interactive terminal UI, run `agentcore`, select **add** , choose **Gateway Target** , and then select **OpenAPI Schema** : @@ -396,0 +375 @@ AgentCore starter toolkit + @@ -398 +377 @@ AgentCore starter toolkit -The AgentCore starter toolkit lets you create a Smithy target with a default model definition in DynamoDB if you omit the `targetConfiguration` field. The following example shows the creation of the default Smithy model definition and also a custom one uploaded to S3. +The wizard then prompts you for the target name, path to the OpenAPI specification file, and outbound authorization configuration. @@ -399,0 +379 @@ The AgentCore starter toolkit lets you create a Smithy target with a default mod +## Add a Smithy target @@ -401 +381 @@ The AgentCore starter toolkit lets you create a Smithy target with a default mod - from bedrock_agentcore_starter_toolkit.operations.gateway.client import GatewayClient +Select one of the following methods: @@ -403,2 +383 @@ The AgentCore starter toolkit lets you create a Smithy target with a default mod - # Initialize the Gateway client - gateway_client = GatewayClient(region_name="us-west-2") +AgentCore CLI @@ -406,5 +384,0 @@ The AgentCore starter toolkit lets you create a Smithy target with a default mod - # Create a Smithy model target for a built-in AWS service (this default configuration uses a DynamoDB Smithy model) - smithy_target = gateway_client.create_mcp_gateway_target( - gateway=gateway, - target_type="smithyModel" - ) @@ -412,10 +386,9 @@ The AgentCore starter toolkit lets you create a Smithy target with a default mod - # Or create a Smithy model target with a custom model - custom_smithy_target = gateway_client.create_mcp_gateway_target( - gateway=gateway, - target_type="smithyModel", - target_payload={ - "s3": { - "uri": "s3://your-bucket/path/to/smithy-model.json" - } - } - ) +To add a Smithy model target, run `agentcore add gateway-target` with the `--type smithy-model` option and provide the path to your Smithy model file: + + + agentcore add gateway-target \ + --name MySmithyTarget \ + --type smithy-model \ + --schema path/to/smithy-model.json \ + --gateway MyGateway + agentcore deploy @@ -454,0 +428,9 @@ The following Python code shows how to add a Smithy model target using the AWS P +Interactive + + +In the AgentCore CLI interactive terminal UI, run `agentcore`, select **add** , choose **Gateway Target** , and then select **Smithy Model** : +