@aws-cdk/aws-bedrock-agentcore-alpha 2.234.0-alpha.0 → 2.235.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/.jsii +298 -203
  2. package/.jsii.tabl.json.gz +0 -0
  3. package/README.md +33 -0
  4. package/lib/gateway/gateway-base.d.ts +8 -0
  5. package/lib/gateway/gateway-base.js +10 -2
  6. package/lib/gateway/gateway.d.ts +21 -1
  7. package/lib/gateway/gateway.js +83 -10
  8. package/lib/gateway/inbound-auth/authorizer.js +3 -3
  9. package/lib/gateway/outbound-auth/api-key.js +1 -1
  10. package/lib/gateway/outbound-auth/credential-provider.js +1 -1
  11. package/lib/gateway/protocol.js +2 -2
  12. package/lib/gateway/targets/schema/api-schema.js +4 -4
  13. package/lib/gateway/targets/schema/tool-schema.js +4 -4
  14. package/lib/gateway/targets/target-base.d.ts +6 -0
  15. package/lib/gateway/targets/target-base.js +8 -2
  16. package/lib/gateway/targets/target-configuration.js +5 -5
  17. package/lib/gateway/targets/target.d.ts +2 -0
  18. package/lib/gateway/targets/target.js +4 -2
  19. package/lib/memory/memory-strategy.js +1 -1
  20. package/lib/memory/memory.d.ts +21 -0
  21. package/lib/memory/memory.js +24 -3
  22. package/lib/memory/strategies/managed-strategy.d.ts +3 -0
  23. package/lib/memory/strategies/managed-strategy.js +5 -2
  24. package/lib/memory/strategies/self-managed-strategy.d.ts +3 -0
  25. package/lib/memory/strategies/self-managed-strategy.js +5 -2
  26. package/lib/network/network-configuration.js +4 -4
  27. package/lib/runtime/runtime-artifact.js +1 -1
  28. package/lib/runtime/runtime-authorizer-configuration.js +1 -1
  29. package/lib/runtime/runtime-base.d.ts +11 -0
  30. package/lib/runtime/runtime-base.js +13 -2
  31. package/lib/runtime/runtime-endpoint-base.js +1 -1
  32. package/lib/runtime/runtime-endpoint.js +1 -1
  33. package/lib/runtime/runtime.js +1 -1
  34. package/lib/tools/browser.d.ts +7 -0
  35. package/lib/tools/browser.js +10 -3
  36. package/lib/tools/code-interpreter.d.ts +9 -0
  37. package/lib/tools/code-interpreter.js +12 -3
  38. package/package.json +42 -11
package/.jsii CHANGED
@@ -8,8 +8,8 @@
8
8
  "url": "https://aws.amazon.com"
9
9
  },
10
10
  "dependencies": {
11
- "@aws-cdk/aws-bedrock-alpha": "2.234.0-alpha.0",
12
- "aws-cdk-lib": "^2.234.0",
11
+ "@aws-cdk/aws-bedrock-alpha": "2.235.0-alpha.0",
12
+ "aws-cdk-lib": "^2.235.0",
13
13
  "constructs": "^10.0.0"
14
14
  },
15
15
  "dependencyClosure": {
@@ -8524,7 +8524,7 @@
8524
8524
  },
8525
8525
  "name": "@aws-cdk/aws-bedrock-agentcore-alpha",
8526
8526
  "readme": {
8527
- "markdown": "# Amazon Bedrock AgentCore Construct Library\n\n<!--BEGIN STABILITY BANNER-->\n\n---\n\n![cdk-constructs: Experimental](https://img.shields.io/badge/cdk--constructs-experimental-important.svg?style=for-the-badge)\n\n> The APIs of higher level constructs in this module are experimental and under active development.\n> They are subject to non-backward compatible changes or removal in any future version. These are\n> not subject to the [Semantic Versioning](https://semver.org/) model and breaking changes will be\n> announced in the release notes. This means that while you may use them, you may need to update\n> your source code when upgrading to a newer version of this package.\n\n---\n\n<!--END STABILITY BANNER-->\n\n| **Language** | **Package** |\n| :--------------------------------------------------------------------------------------------- | --------------------------------------- |\n| ![Typescript Logo](https://docs.aws.amazon.com/cdk/api/latest/img/typescript32.png) TypeScript | `@aws-cdk/aws-bedrock-agentcore-alpha` |\n\n[Amazon Bedrock AgentCore](https://aws.amazon.com/bedrock/agentcore/) enables you to deploy and operate highly capable AI agents securely, at scale. It offers infrastructure purpose-built for dynamic agent workloads, powerful tools to enhance agents, and essential controls for real-world deployment. AgentCore services can be used together or independently and work with any framework including CrewAI, LangGraph, LlamaIndex, and Strands Agents, as well as any foundation model in or outside of Amazon Bedrock, giving you ultimate flexibility. AgentCore eliminates the undifferentiated heavy lifting of building specialized agent infrastructure, so you can accelerate agents to production.\n\nThis construct library facilitates the deployment of Bedrock AgentCore primitives, enabling you to create sophisticated AI applications that can interact with your systems and data sources.\n\n> **Note:** Users need to ensure their CDK deployment role has the `iam:CreateServiceLinkedRole` permission for AgentCore service-linked roles.\n\n## Table of contents\n\n- [AgentCore Runtime](#agentcore-runtime)\n - [Runtime Versioning](#runtime-versioning)\n - [Runtime Endpoints](#runtime-endpoints)\n - [AgentCore Runtime Properties](#agentcore-runtime-properties)\n - [Runtime Endpoint Properties](#runtime-endpoint-properties)\n - [Creating a Runtime](#creating-a-runtime)\n - [Option 1: Use an existing image in ECR](#option-1-use-an-existing-image-in-ecr)\n - [Managing Endpoints and Versions](#managing-endpoints-and-versions)\n - [Option 2: Use a local asset](#option-2-use-a-local-asset)\n- [Browser Custom tool](#browser)\n - [Browser properties](#browser-properties)\n - [Browser Network modes](#browser-network-modes)\n - [Basic Browser Creation](#basic-browser-creation)\n - [Browser IAM permissions](#browser-iam-permissions)\n- [Code Interpreter Custom tool](#code-interpreter)\n - [Code Interpreter properties](#code-interpreter-properties)\n - [Code Interpreter Network Modes](#code-interpreter-network-modes)\n - [Basic Code Interpreter Creation](#basic-code-interpreter-creation)\n - [Code Interpreter IAM permissions](#code-interpreter-iam-permissions)\n- [Gateway](#gateway)\n - [Gateway Properties](#gateway-properties)\n - [Basic Gateway Creation](#basic-gateway-creation)\n - [Protocol configuration](#protocol-configuration)\n - [Inbound authorization](#inbound-authorization)\n - [Gateway with KMS Encryption](#gateway-with-kms-encryption)\n - [Gateway with Custom Execution Role](#gateway-with-custom-execution-role)\n - [Gateway IAM Permissions](#gateway-iam-permissions)\n- [Gateway Target](#gateway-target)\n - [Gateway Target Properties](#gateway-target-properties)\n - [Targets types](#targets-types)\n - [Outbound auth](#outbound-auth)\n - [Api schema](#api-schema-for-openapi-and-smithy-target)\n - [Basic Gateway Target Creation](#basic-gateway-target-creation)\n - [Using addTarget methods (Recommended)](#using-addtarget-methods-recommended)\n - [Using static factory methods](#using-static-factory-methods)\n - [Lambda Target with Tool Schema](#tools-schema-for-lambda-target)\n - [Smithy Model Target with OAuth](#api-schema-for-openapi-and-smithy-target)\n - [Gateway Target IAM Permissions](#gateway-target-iam-permissions)\n- [Memory](#memory)\n - [Memory properties](#memory-properties)\n - [Basic Memory Creation](#basic-memory-creation)\n - [LTM Memory Extraction Stategies](#ltm-memory-extraction-stategies)\n - [Memory Strategy Methods](#memory-strategy-methods)\n- [Amazon Bedrock AgentCore Construct Library](#amazon-bedrock-agentcore-construct-library)\n - [Table of contents](#table-of-contents)\n - [AgentCore Runtime](#agentcore-runtime)\n - [Runtime Endpoints](#runtime-endpoints)\n - [AgentCore Runtime Properties](#agentcore-runtime-properties)\n - [Runtime Endpoint Properties](#runtime-endpoint-properties)\n - [Creating a Runtime](#creating-a-runtime)\n - [Option 1: Use an existing image in ECR](#option-1-use-an-existing-image-in-ecr)\n - [Option 2: Use a local asset](#option-2-use-a-local-asset)\n - [Option 3: Use direct code deployment](#option-3-use-direct-code-deployment)\n - [Granting Permissions to Invoke Bedrock Models or Inference Profiles](#granting-permissions-to-invoke-bedrock-models-or-inference-profiles)\n - [Runtime Versioning](#runtime-versioning)\n - [Managing Endpoints and Versions](#managing-endpoints-and-versions)\n - [Step 1: Initial Deployment](#step-1-initial-deployment)\n - [Step 2: Creating Custom Endpoints](#step-2-creating-custom-endpoints)\n - [Step 3: Runtime Update Deployment](#step-3-runtime-update-deployment)\n - [Step 4: Testing with Staging Endpoints](#step-4-testing-with-staging-endpoints)\n - [Step 5: Promoting to Production](#step-5-promoting-to-production)\n - [Creating Standalone Runtime Endpoints](#creating-standalone-runtime-endpoints)\n - [Example: Creating an endpoint for an existing runtime](#example-creating-an-endpoint-for-an-existing-runtime)\n - [Runtime Authentication Configuration](#runtime-authentication-configuration)\n - [IAM Authentication (Default)](#iam-authentication-default)\n - [Cognito Authentication](#cognito-authentication)\n - [JWT Authentication](#jwt-authentication)\n - [OAuth Authentication](#oauth-authentication)\n - [Using a Custom IAM Role](#using-a-custom-iam-role)\n - [Runtime Network Configuration](#runtime-network-configuration)\n - [Public Network Mode (Default)](#public-network-mode-default)\n - [VPC Network Mode](#vpc-network-mode)\n - [Managing Security Groups with VPC Configuration](#managing-security-groups-with-vpc-configuration)\n - [Browser](#browser)\n - [Browser Network modes](#browser-network-modes)\n - [Browser Properties](#browser-properties)\n - [Basic Browser Creation](#basic-browser-creation)\n - [Browser with Tags](#browser-with-tags)\n - [Browser with VPC](#browser-with-vpc)\n - [Browser with Recording Configuration](#browser-with-recording-configuration)\n - [Browser with Custom Execution Role](#browser-with-custom-execution-role)\n - [Browser with S3 Recording and Permissions](#browser-with-s3-recording-and-permissions)\n - [Browser IAM Permissions](#browser-iam-permissions)\n - [Code Interpreter](#code-interpreter)\n - [Code Interpreter Network Modes](#code-interpreter-network-modes)\n - [Code Interpreter Properties](#code-interpreter-properties)\n - [Basic Code Interpreter Creation](#basic-code-interpreter-creation)\n - [Code Interpreter with VPC](#code-interpreter-with-vpc)\n - [Code Interpreter with Sandbox Network Mode](#code-interpreter-with-sandbox-network-mode)\n - [Code Interpreter with Custom Execution Role](#code-interpreter-with-custom-execution-role)\n - [Code Interpreter IAM Permissions](#code-interpreter-iam-permissions)\n - [Code interpreter with tags](#code-interpreter-with-tags)\n - [Memory](#memory)\n - [Memory Properties](#memory-properties)\n - [Basic Memory Creation](#basic-memory-creation)\n - [LTM Memory Extraction Stategies](#ltm-memory-extraction-stategies)\n - [Memory with Built-in Strategies](#memory-with-built-in-strategies)\n - [Memory with custom Strategies](#memory-with-custom-strategies)\n - [Memory with Custom Execution Role](#memory-with-custom-execution-role)\n - [Memory with self-managed Strategies](#memory-with-self-managed-strategies)\n - [Memory Strategy Methods](#memory-strategy-methods)\n\n## AgentCore Runtime\n\nThe AgentCore Runtime construct enables you to deploy containerized agents on Amazon Bedrock AgentCore.\nThis L2 construct simplifies runtime creation just pass your ECR repository name\nand the construct handles all the configuration with sensible defaults.\n\n### Runtime Endpoints\n\nEndpoints provide a stable way to invoke specific versions of your agent runtime, enabling controlled deployments across different environments.\nWhen you create an agent runtime, Amazon Bedrock AgentCore automatically creates a \"DEFAULT\" endpoint which always points to the latest version\nof runtime.\n\nYou can create additional endpoints in two ways:\n\n1. **Using Runtime.addEndpoint()** - Convenient method when creating endpoints alongside the runtime.\n2. **Using RuntimeEndpoint** - Flexible approach for existing runtimes.\n\nFor example, you might keep a \"production\" endpoint on a stable version while testing newer versions\nthrough a \"staging\" endpoint. This separation allows you to test changes thoroughly before promoting them\nto production by simply updating the endpoint to point to the newer version.\n\n### AgentCore Runtime Properties\n\n| Name | Type | Required | Description |\n|------|------|----------|-------------|\n| `runtimeName` | `string` | Yes | The name of the agent runtime. Valid characters are a-z, A-Z, 0-9, _ (underscore). Must start with a letter and can be up to 48 characters long |\n| `agentRuntimeArtifact` | `AgentRuntimeArtifact` | Yes | The artifact configuration for the agent runtime containing the container configuration with ECR URI |\n| `executionRole` | `iam.IRole` | No | The IAM role that provides permissions for the agent runtime. If not provided, a role will be created automatically |\n| `networkConfiguration` | `NetworkConfiguration` | No | Network configuration for the agent runtime. Defaults to `RuntimeNetworkConfiguration.usingPublicNetwork()` |\n| `description` | `string` | No | Optional description for the agent runtime |\n| `protocolConfiguration` | `ProtocolType` | No | Protocol configuration for the agent runtime. Defaults to `ProtocolType.HTTP` |\n| `authorizerConfiguration` | `RuntimeAuthorizerConfiguration` | No | Authorizer configuration for the agent runtime. Use `RuntimeAuthorizerConfiguration` static methods to create configurations for IAM, Cognito, JWT, or OAuth authentication |\n| `environmentVariables` | `{ [key: string]: string }` | No | Environment variables for the agent runtime. Maximum 50 environment variables |\n| `tags` | `{ [key: string]: string }` | No | Tags for the agent runtime. A list of key:value pairs of tags to apply to this Runtime resource |\n| `lifecycleConfiguration` | LifecycleConfiguration | No | The life cycle configuration for the AgentCore Runtime. Defaults to 900 seconds (15 minutes) for idle, 28800 seconds (8 hours) for max life time |\n| `requestHeaderConfiguration` | RequestHeaderConfiguration | No | Configuration for HTTP request headers that will be passed through to the runtime. Defaults to no configuration |\n\n### Runtime Endpoint Properties\n\n| Name | Type | Required | Description |\n|------|------|----------|-------------|\n| `endpointName` | `string` | Yes | The name of the runtime endpoint. Valid characters are a-z, A-Z, 0-9, _ (underscore). Must start with a letter and can be up to 48 characters long |\n| `agentRuntimeId` | `string` | Yes | The Agent Runtime ID for this endpoint |\n| `agentRuntimeVersion` | `string` | Yes | The Agent Runtime version for this endpoint. Must be between 1 and 5 characters long.|\n| `description` | `string` | No | Optional description for the runtime endpoint |\n| `tags` | `{ [key: string]: string }` | No | Tags for the runtime endpoint |\n\n### Creating a Runtime\n\n#### Option 1: Use an existing image in ECR\n\nReference an image available within ECR.\n\n```typescript fixture=default\nconst repository = new ecr.Repository(this, \"TestRepository\", {\n repositoryName: \"test-agent-runtime\",\n});\n\n// The runtime by default create ECR permission only for the repository available in the account the stack is being deployed\nconst agentRuntimeArtifact = agentcore.AgentRuntimeArtifact.fromEcrRepository(repository, \"v1.0.0\");\n\n// Create runtime using the built image\nconst runtime = new agentcore.Runtime(this, \"MyAgentRuntime\", {\n runtimeName: \"myAgent\",\n agentRuntimeArtifact: agentRuntimeArtifact\n});\n```\n\n#### Option 2: Use a local asset\n\nReference a local directory containing a Dockerfile.\nImages are built from a local Docker context directory (with a Dockerfile), uploaded to Amazon Elastic Container Registry (ECR)\nby the CDK toolkit,and can be naturally referenced in your CDK app.\n\n```typescript fixture=default\nconst agentRuntimeArtifact = agentcore.AgentRuntimeArtifact.fromAsset(\n path.join(__dirname, \"path to agent dockerfile directory\")\n);\n\nconst runtime = new agentcore.Runtime(this, \"MyAgentRuntime\", {\n runtimeName: \"myAgent\",\n agentRuntimeArtifact: agentRuntimeArtifact,\n});\n```\n\n#### Option 3: Use direct code deployment\n\nWith the container deployment method, developers create a Dockerfile, build ARM-compatible containers, manage ECR repositories, and upload containers for code changes. This works well where container DevOps pipelines have already been established to automate deployments.\n\nHowever, customers looking for fully managed deployments can benefit from direct code deployment, which can significantly improve developer time and productivity. Direct code deployment provides a secure and scalable path forward for rapid prototyping agent capabilities to deploying production workloads at scale.\n\nWith direct code deployment, developers create a zip archive of code and dependencies, upload to Amazon S3, and configure the bucket in the agent configuration. A ZIP archive containing Linux arm64 dependencies needs to be uploaded to S3 as a pre-requisite to Create Agent Runtime.\n\nFor more information, please refer to the [documentation](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/runtime-get-started-code-deploy.html).\n\n```typescript fixture=default\n// S3 bucket containing the agent core\nconst codeBucket = new s3.Bucket(this, \"AgentCode\", {\n bucketName: \"my-code-bucket\",\n removalPolicy: RemovalPolicy.DESTROY, // For demo purposes\n});\n\n// the bucket above needs to contain the agent code\n\nconst agentRuntimeArtifact = agentcore.AgentRuntimeArtifact.fromS3(\n {\n bucketName: codeBucket.bucketName,\n objectKey: 'deployment_package.zip',\n },\n agentcore.AgentCoreRuntime.PYTHON_3_12,\n ['opentelemetry-instrument', 'main.py']\n);\n\nconst runtimeInstance = new agentcore.Runtime(this, \"MyAgentRuntime\", {\n runtimeName: \"myAgent\",\n agentRuntimeArtifact: agentRuntimeArtifact,\n});\n```\n\n#### Option 4: Use an ECR container image URI\n\nReference an ECR container image directly by its URI. This is useful when you have a pre-existing ECR image URI from CloudFormation parameters or cross-stack references. No IAM permissions are automatically granted - you must ensure the runtime has ECR pull permissions.\n\n```typescript fixture=default\n// Direct URI reference\nconst agentRuntimeArtifact = agentcore.AgentRuntimeArtifact.fromImageUri(\n \"123456789012.dkr.ecr.us-east-1.amazonaws.com/my-agent:v1.0.0\"\n);\n\nconst runtime = new agentcore.Runtime(this, \"MyAgentRuntime\", {\n runtimeName: \"myAgent\",\n agentRuntimeArtifact: agentRuntimeArtifact,\n});\n```\n\nYou can also use CloudFormation parameters or references:\n\n```typescript fixture=default\n// Using a CloudFormation parameter\nconst imageUriParam = new cdk.CfnParameter(this, \"ImageUri\", {\n type: \"String\",\n description: \"Container image URI for the agent runtime\",\n});\n\nconst agentRuntimeArtifact = agentcore.AgentRuntimeArtifact.fromImageUri(\n imageUriParam.valueAsString\n);\n\nconst runtime = new agentcore.Runtime(this, \"MyAgentRuntime\", {\n runtimeName: \"myAgent\",\n agentRuntimeArtifact: agentRuntimeArtifact,\n});\n```\n\n### Granting Permissions to Invoke Bedrock Models or Inference Profiles\n\nTo grant the runtime permissions to invoke Bedrock models or inference profiles:\n\n```typescript fixture=default\n// Note: This example uses @aws-cdk/aws-bedrock-alpha which must be installed separately\ndeclare const runtime: agentcore.Runtime;\n\n// Define the Bedrock Foundation Model\nconst model = bedrock.BedrockFoundationModel.ANTHROPIC_CLAUDE_3_7_SONNET_V1_0;\n\n// Grant the runtime permissions to invoke the model\nmodel.grantInvoke(runtime);\n\n// Create a cross-region inference profile for Claude 3.7 Sonnet\nconst inferenceProfile = bedrock.CrossRegionInferenceProfile.fromConfig({\n geoRegion: bedrock.CrossRegionInferenceProfileRegion.US,\n model: bedrock.BedrockFoundationModel.ANTHROPIC_CLAUDE_3_7_SONNET_V1_0\n});\n\n// Grant the runtime permissions to invoke the inference profile\ninferenceProfile.grantInvoke(runtime);\n```\n\n### Runtime Versioning\n\nAmazon Bedrock AgentCore automatically manages runtime versioning to ensure safe deployments and rollback capabilities.\nWhen you create an agent runtime, AgentCore automatically creates version 1 (V1). Each subsequent update to the\nruntime configuration (such as updating the container image, modifying network settings, or changing protocol configurations)\ncreates a new immutable version. These versions contain complete, self-contained configurations that can be referenced by endpoints,\nallowing you to maintain different versions for different environments or gradually roll out updates.\n\n#### Managing Endpoints and Versions\n\nAmazon Bedrock AgentCore automatically manages runtime versioning to provide safe deployments and rollback capabilities. You can follow\nthe steps below to understand how to use versioning with runtime for controlled deployments across different environments.\n\n##### Step 1: Initial Deployment\n\nWhen you first create an agent runtime, AgentCore automatically creates Version 1 of your runtime. At this point, a DEFAULT endpoint is\nautomatically created that points to Version 1. This DEFAULT endpoint serves as the main access point for your runtime.\n\n```typescript fixture=default\nconst repository = new ecr.Repository(this, \"TestRepository\", {\n repositoryName: \"test-agent-runtime\",\n});\n\nconst runtime = new agentcore.Runtime(this, \"MyAgentRuntime\", {\n runtimeName: \"myAgent\",\n agentRuntimeArtifact: agentcore.AgentRuntimeArtifact.fromEcrRepository(repository, \"v1.0.0\"),\n});\n```\n\n##### Step 2: Creating Custom Endpoints\n\nAfter the initial deployment, you can create additional endpoints for different environments. For example, you might create a \"production\"\nendpoint that explicitly points to Version 1. This allows you to maintain stable access points for specific environments while keeping the\nflexibility to test newer versions elsewhere.\n\n```typescript fixture=default\nconst repository = new ecr.Repository(this, \"TestRepository\", {\n repositoryName: \"test-agent-runtime\",\n});\n\nconst runtime = new agentcore.Runtime(this, \"MyAgentRuntime\", {\n runtimeName: \"myAgent\",\n agentRuntimeArtifact: agentcore.AgentRuntimeArtifact.fromEcrRepository(repository, \"v1.0.0\"),\n});\n\nconst prodEndpoint = runtime.addEndpoint(\"production\", {\n version: \"1\",\n description: \"Stable production endpoint - pinned to v1\"\n});\n```\n\n##### Step 3: Runtime Update Deployment\n\nWhen you update the runtime configuration (such as updating the container image, modifying network settings, or changing protocol\nconfigurations), AgentCore automatically creates a new version (Version 2). Upon this update:\n\n- Version 2 is created automatically with the new configuration\n- The DEFAULT endpoint automatically updates to point to Version 2\n- Any explicitly pinned endpoints (like the production endpoint) remain on their specified versions\n\n```typescript fixture=default\nconst repository = new ecr.Repository(this, \"TestRepository\", {\n repositoryName: \"test-agent-runtime\",\n});\n\nconst agentRuntimeArtifactNew = agentcore.AgentRuntimeArtifact.fromEcrRepository(repository, \"v2.0.0\");\n\nconst runtime = new agentcore.Runtime(this, \"MyAgentRuntime\", {\n runtimeName: \"myAgent\",\n agentRuntimeArtifact: agentRuntimeArtifactNew,\n});\n```\n\n##### Step 4: Testing with Staging Endpoints\n\nOnce Version 2 exists, you can create a staging endpoint that points to the new version. This staging endpoint allows you to test the\nnew version in a controlled environment before promoting it to production. This separation ensures that production traffic continues\nto use the stable version while you validate the new version.\n\n```typescript fixture=default\nconst repository = new ecr.Repository(this, \"TestRepository\", {\n repositoryName: \"test-agent-runtime\",\n});\n\nconst agentRuntimeArtifactNew = agentcore.AgentRuntimeArtifact.fromEcrRepository(repository, \"v2.0.0\");\n\nconst runtime = new agentcore.Runtime(this, \"MyAgentRuntime\", {\n runtimeName: \"myAgent\",\n agentRuntimeArtifact: agentRuntimeArtifactNew,\n});\n\nconst stagingEndpoint = runtime.addEndpoint(\"staging\", {\n version: \"2\",\n description: \"Staging environment for testing new version\"\n});\n```\n\n##### Step 5: Promoting to Production\n\nAfter thoroughly testing the new version through the staging endpoint, you can update the production endpoint to point to Version 2.\nThis controlled promotion process ensures that you can validate changes before they affect production traffic.\n\n```typescript fixture=default\nconst repository = new ecr.Repository(this, \"TestRepository\", {\n repositoryName: \"test-agent-runtime\",\n});\n\nconst agentRuntimeArtifactNew = agentcore.AgentRuntimeArtifact.fromEcrRepository(repository, \"v2.0.0\");\n\nconst runtime = new agentcore.Runtime(this, \"MyAgentRuntime\", {\n runtimeName: \"myAgent\",\n agentRuntimeArtifact: agentRuntimeArtifactNew,\n});\n\nconst prodEndpoint = runtime.addEndpoint(\"production\", {\n version: \"2\", // New version added here\n description: \"Stable production endpoint\"\n});\n```\n\n### Creating Standalone Runtime Endpoints\n\nRuntimeEndpoint can also be created as a standalone resource.\n\n#### Example: Creating an endpoint for an existing runtime\n\n```typescript fixture=default\n// Reference an existing runtime by its ID\nconst existingRuntimeId = \"abc123-runtime-id\"; // The ID of an existing runtime\n\n// Create a standalone endpoint\nconst endpoint = new agentcore.RuntimeEndpoint(this, \"MyEndpoint\", {\n endpointName: \"production\",\n agentRuntimeId: existingRuntimeId,\n agentRuntimeVersion: \"1\", // Specify which version to use\n description: \"Production endpoint for existing runtime\"\n});\n```\n\n### Runtime Authentication Configuration\n\nThe AgentCore Runtime supports multiple authentication modes to secure access to your agent endpoints. Authentication is configured during runtime creation using the `RuntimeAuthorizerConfiguration` class's static factory methods.\n\n#### IAM Authentication (Default)\n\nIAM authentication is the default mode, when no authorizerConfiguration is set then the underlying service use IAM.\n\n#### Cognito Authentication\n\nTo configure AWS Cognito User Pool authentication:\n\n```typescript fixture=default\ndeclare const userPool: cognito.UserPool;\ndeclare const userPoolClient: cognito.UserPoolClient;\ndeclare const anotherUserPoolClient: cognito.UserPoolClient;\n\nconst repository = new ecr.Repository(this, \"TestRepository\", {\n repositoryName: \"test-agent-runtime\",\n});\nconst agentRuntimeArtifact = agentcore.AgentRuntimeArtifact.fromEcrRepository(repository, \"v1.0.0\");\n\nconst runtime = new agentcore.Runtime(this, \"MyAgentRuntime\", {\n runtimeName: \"myAgent\",\n agentRuntimeArtifact: agentRuntimeArtifact,\n authorizerConfiguration: agentcore.RuntimeAuthorizerConfiguration.usingCognito(\n userPool, // User Pool (required)\n [userPoolClient, anotherUserPoolClient], // User Pool Clients\n ),\n});\n```\n\n#### JWT Authentication\n\nTo configure custom JWT authentication with your own OpenID Connect (OIDC) provider:\n\n```typescript fixture=default\nconst repository = new ecr.Repository(this, \"TestRepository\", {\n repositoryName: \"test-agent-runtime\",\n});\nconst agentRuntimeArtifact = agentcore.AgentRuntimeArtifact.fromEcrRepository(repository, \"v1.0.0\");\n\nconst runtime = new agentcore.Runtime(this, \"MyAgentRuntime\", {\n runtimeName: \"myAgent\",\n agentRuntimeArtifact: agentRuntimeArtifact,\n authorizerConfiguration: agentcore.RuntimeAuthorizerConfiguration.usingJWT(\n \"https://example.com/.well-known/openid-configuration\", // Discovery URL (required)\n [\"client1\", \"client2\"], // Allowed Client IDs (optional)\n [\"audience1\"] // Allowed Audiences (optional)\n ),\n});\n```\n\n**Note**: The discovery URL must end with `/.well-known/openid-configuration`.\n\n#### OAuth Authentication\n\nTo configure OAuth 2.0 authentication:\n\n```typescript fixture=default\nconst repository = new ecr.Repository(this, \"TestRepository\", {\n repositoryName: \"test-agent-runtime\",\n});\nconst agentRuntimeArtifact = agentcore.AgentRuntimeArtifact.fromEcrRepository(repository, \"v1.0.0\");\n\nconst runtime = new agentcore.Runtime(this, \"MyAgentRuntime\", {\n runtimeName: \"myAgent\",\n agentRuntimeArtifact: agentRuntimeArtifact,\n authorizerConfiguration: agentcore.RuntimeAuthorizerConfiguration.usingOAuth(\n \"https://github.com/.well-known/openid-configuration\",\n \"oauth_client_123\",\n ),\n});\n```\n\n#### Using a Custom IAM Role\n\nInstead of using the auto-created execution role, you can provide your own IAM role with specific permissions:\nThe auto-created role includes all necessary baseline permissions for ECR access, CloudWatch logging, and X-Ray tracing. When providing a custom role, ensure these permissions are included.\n\n### Runtime Network Configuration\n\nThe AgentCore Runtime supports two network modes for deployment:\n\n#### Public Network Mode (Default)\n\nBy default, runtimes are deployed in PUBLIC network mode, which provides internet access suitable for less sensitive or open-use scenarios:\n\n```typescript fixture=default\nconst repository = new ecr.Repository(this, \"TestRepository\", {\n repositoryName: \"test-agent-runtime\",\n});\nconst agentRuntimeArtifact = agentcore.AgentRuntimeArtifact.fromEcrRepository(repository, \"v1.0.0\");\n\n// Explicitly using public network (this is the default)\nconst runtime = new agentcore.Runtime(this, \"MyAgentRuntime\", {\n runtimeName: \"myAgent\",\n agentRuntimeArtifact: agentRuntimeArtifact,\n networkConfiguration: agentcore.RuntimeNetworkConfiguration.usingPublicNetwork(),\n});\n```\n\n#### VPC Network Mode\n\nFor enhanced security and network isolation, you can deploy your runtime within a VPC:\n\n```typescript fixture=default\nconst repository = new ecr.Repository(this, \"TestRepository\", {\n repositoryName: \"test-agent-runtime\",\n});\nconst agentRuntimeArtifact = agentcore.AgentRuntimeArtifact.fromEcrRepository(repository, \"v1.0.0\");\n\n// Create or use an existing VPC\nconst vpc = new ec2.Vpc(this, 'MyVpc', {\n maxAzs: 2,\n});\n\n// Configure runtime with VPC\nconst runtime = new agentcore.Runtime(this, \"MyAgentRuntime\", {\n runtimeName: \"myAgent\",\n agentRuntimeArtifact: agentRuntimeArtifact,\n networkConfiguration: agentcore.RuntimeNetworkConfiguration.usingVpc(this, {\n vpc: vpc,\n vpcSubnets: { subnetType: ec2.SubnetType.PRIVATE_WITH_EGRESS },\n // Optionally specify security groups, or one will be created automatically\n // securityGroups: [mySecurityGroup],\n }),\n});\n\n```\n\n#### Managing Security Groups with VPC Configuration\n\nWhen using VPC mode, the Runtime implements `ec2.IConnectable`, allowing you to manage network access using the `connections` property:\n\n```typescript fixture=default\nconst vpc = new ec2.Vpc(this, 'MyVpc', {\n maxAzs: 2,\n});\n\nconst repository = new ecr.Repository(this, \"TestRepository\", {\n repositoryName: \"test-agent-runtime\",\n});\nconst agentRuntimeArtifact = agentcore.AgentRuntimeArtifact.fromEcrRepository(repository, \"v1.0.0\");\n\n// Create runtime with VPC configuration\nconst runtime = new agentcore.Runtime(this, \"MyAgentRuntime\", {\n runtimeName: \"myAgent\",\n agentRuntimeArtifact: agentRuntimeArtifact,\n networkConfiguration: agentcore.RuntimeNetworkConfiguration.usingVpc(this, {\n vpc: vpc,\n vpcSubnets: { subnetType: ec2.SubnetType.PRIVATE_WITH_EGRESS },\n }),\n});\n\n// Now you can manage network access using the connections property\n// Allow inbound HTTPS traffic from a specific security group\nconst webServerSecurityGroup = new ec2.SecurityGroup(this, 'WebServerSG', { vpc });\nruntime.connections.allowFrom(webServerSecurityGroup, ec2.Port.tcp(443), 'Allow HTTPS from web servers');\n\n// Allow outbound connections to a database\nconst databaseSecurityGroup = new ec2.SecurityGroup(this, 'DatabaseSG', { vpc });\nruntime.connections.allowTo(databaseSecurityGroup, ec2.Port.tcp(5432), 'Allow PostgreSQL connection');\n\n// Allow outbound HTTPS to anywhere (for external API calls)\nruntime.connections.allowToAnyIpv4(ec2.Port.tcp(443), 'Allow HTTPS outbound');\n```\n\n### Runtime IAM Permissions\n\nThe Runtime construct provides convenient methods for granting IAM permissions to principals that need to invoke the runtime or manage its execution role.\n\n```typescript fixture=default\nconst repository = new ecr.Repository(this, \"TestRepository\", {\n repositoryName: \"test-agent-runtime\",\n});\nconst agentRuntimeArtifact = agentcore.AgentRuntimeArtifact.fromEcrRepository(repository, \"v1.0.0\");\n\n// Create a runtime\nconst runtime = new agentcore.Runtime(this, \"MyRuntime\", {\n runtimeName: \"my_runtime\",\n agentRuntimeArtifact: agentRuntimeArtifact,\n});\n\n// Create a Lambda function that needs to invoke the runtime\nconst invokerFunction = new lambda.Function(this, \"InvokerFunction\", {\n runtime: lambda.Runtime.PYTHON_3_12,\n handler: \"index.handler\",\n code: lambda.Code.fromInline(`\nimport boto3\ndef handler(event, context):\n client = boto3.client('bedrock-agentcore')\n # Invoke the runtime...\n `),\n});\n\n// Grant permission to invoke the runtime directly\nruntime.grantInvokeRuntime(invokerFunction);\n\n// Grant permission to invoke the runtime on behalf of a user\n// (requires X-Amzn-Bedrock-AgentCore-Runtime-User-Id header)\nruntime.grantInvokeRuntimeForUser(invokerFunction);\n\n// Grant both invoke permissions (most common use case)\nruntime.grantInvoke(invokerFunction);\n\n// Grant specific custom permissions to the runtime's execution role\nruntime.grant(['bedrock:InvokeModel'], ['arn:aws:bedrock:*:*:*']);\n\n// Add a policy statement to the runtime's execution role\nruntime.addToRolePolicy(new iam.PolicyStatement({\n actions: ['s3:GetObject'],\n resources: ['arn:aws:s3:::my-bucket/*'],\n}));\n```\n\n### Other configuration\n\n#### Lifecycle configuration\n\nThe LifecycleConfiguration input parameter to CreateAgentRuntime lets you manage the lifecycle of runtime sessions and resources in Amazon Bedrock AgentCore Runtime. This configuration helps optimize resource utilization by automatically cleaning up idle sessions and preventing long-running instances from consuming resources indefinitely.\n\nYou can configure:\n\n- idleRuntimeSessionTimeout: Timeout in seconds for idle runtime sessions. When a session remains idle for this duration, it will trigger termination. Termination can last up to 15 seconds due to logging and other process completion. Default: 900 seconds (15 minutes)\n- maxLifetime: Maximum lifetime for the instance in seconds. Once reached, instances will initialize termination. Termination can last up to 15 seconds due to logging and other process completion. Default: 28800 seconds (8 hours)\n\nFor additional information, please refer to the [documentation](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/runtime-lifecycle-settings.html).\n\n```typescript fixture=default\nconst repository = new ecr.Repository(this, \"TestRepository\", {\n repositoryName: \"test-agent-runtime\",\n});\n\nconst agentRuntimeArtifact = agentcore.AgentRuntimeArtifact.fromEcrRepository(repository, \"v1.0.0\");\n\nnew agentcore.Runtime(this, 'test-runtime', {\n runtimeName: 'test_runtime',\n agentRuntimeArtifact: agentRuntimeArtifact,\n lifecycleConfiguration: {\n idleRuntimeSessionTimeout: Duration.minutes(10),\n maxLifetime: Duration.hours(4),\n },\n});\n```\n\n#### Request header configuration\n\nCustom headers let you pass contextual information from your application directly to your agent code without cluttering the main request payload. This includes authentication tokens like JWT (JSON Web Tokens, which contain user identity and authorization claims) through the Authorization header, allowing your agent to make decisions based on who is calling it. You can also pass custom metadata like user preferences, session identifiers, or trace context using headers prefixed with X-Amzn-Bedrock-AgentCore-Runtime-Custom-, giving your agent access to up to 20 pieces of runtime context that travel alongside each request. This information can be also used in downstream systems like AgentCore Memory that you can namespace based on those characteristics like user_id or aud in claims like line of business.\n\nFor additional information, please refer to the [documentation](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/runtime-header-allowlist.html).\n\n```typescript fixture=default\nconst repository = new ecr.Repository(this, \"TestRepository\", {\n repositoryName: \"test-agent-runtime\",\n});\n\nconst agentRuntimeArtifact = agentcore.AgentRuntimeArtifact.fromEcrRepository(repository, \"v1.0.0\");\n\nnew agentcore.Runtime(this, 'test-runtime', {\n runtimeName: 'test_runtime',\n agentRuntimeArtifact: agentRuntimeArtifact,\n requestHeaderConfiguration: {\n allowlistedHeaders: ['X-Amzn-Bedrock-AgentCore-Runtime-Custom-H1'],\n },\n});\n```\n\n## Browser\n\nThe Amazon Bedrock AgentCore Browser provides a secure, cloud-based browser that enables AI agents to interact with websites. It includes security features such as session isolation, built-in observability through live viewing, CloudTrail logging, and session replay capabilities.\n\nAdditional information about the browser tool can be found in the [official documentation](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/browser-tool.html)\n\n### Browser Network modes\n\nThe Browser construct supports the following network modes:\n\n1. **Public Network Mode** (`BrowserNetworkMode.usingPublicNetwork()`) - Default\n\n - Allows internet access for web browsing and external API calls\n - Suitable for scenarios where agents need to interact with publicly available websites\n - Enables full web browsing capabilities\n - VPC mode is not supported with this option\n\n2. **VPC (Virtual Private Cloud)** (`BrowserNetworkMode.usingVpc()`)\n\n - Select whether to run the browser in a virtual private cloud (VPC).\n - By configuring VPC connectivity, you enable secure access to private resources such as databases, internal APIs, and services within your VPC.\n\n While the VPC itself is mandatory, these are optional:\n - Subnets - if not provided, CDK will select appropriate subnets from the VPC\n - Security Groups - if not provided, CDK will create a default security group\n - Specific subnet selection criteria - you can let CDK choose automatically\n\nFor more information on VPC connectivity for Amazon Bedrock AgentCore Browser, please refer to the [official documentation](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/agentcore-vpc.html).\n\n### Browser Properties\n\n| Name | Type | Required | Description |\n|------|------|----------|-------------|\n| `browserCustomName` | `string` | Yes | The name of the browser. Must start with a letter and can be up to 48 characters long. Pattern: `[a-zA-Z][a-zA-Z0-9_]{0,47}` |\n| `description` | `string` | No | Optional description for the browser. Can have up to 200 characters |\n| `networkConfiguration` | `BrowserNetworkConfiguration` | No | Network configuration for browser. Defaults to PUBLIC network mode |\n| `recordingConfig` | `RecordingConfig` | No | Recording configuration for browser. Defaults to no recording |\n| `executionRole` | `iam.IRole` | No | The IAM role that provides permissions for the browser to access AWS services. A new role will be created if not provided |\n| `tags` | `{ [key: string]: string }` | No | Tags to apply to the browser resource |\n| `browserSigning` | BrowserSigning | No | Browser signing configuration. Defaults to DISABLED |\n\n### Basic Browser Creation\n\n```typescript fixture=default\n// Create a basic browser with public network access\nconst browser = new agentcore.BrowserCustom(this, \"MyBrowser\", {\n browserCustomName: \"my_browser\",\n description: \"A browser for web automation\",\n});\n```\n\n### Browser with Tags\n\n```typescript fixture=default\n// Create a browser with custom tags\nconst browser = new agentcore.BrowserCustom(this, \"MyBrowser\", {\n browserCustomName: \"my_browser\",\n description: \"A browser for web automation with tags\",\n networkConfiguration: agentcore.BrowserNetworkConfiguration.usingPublicNetwork(),\n tags: {\n Environment: \"Production\",\n Team: \"AI/ML\",\n Project: \"AgentCore\",\n },\n});\n```\n\n### Browser with VPC\n\n```typescript fixture=default\nconst browser = new agentcore.BrowserCustom(this, 'BrowserVpcWithRecording', {\n browserCustomName: 'browser_recording',\n networkConfiguration: agentcore.BrowserNetworkConfiguration.usingVpc(this, {\n vpc: new ec2.Vpc(this, 'VPC', { restrictDefaultSecurityGroup: false }),\n }),\n});\n```\n\nBrowser exposes a [connections](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.Connections.html) property. This property returns a connections object, which simplifies the process of defining and managing ingress and egress rules for security groups in your AWS CDK applications. Instead of directly manipulating security group rules, you interact with the Connections object of a construct, which then translates your connectivity requirements into the appropriate security group rules. For instance:\n\n```typescript fixture=default\nconst vpc = new ec2.Vpc(this, 'testVPC');\n\nconst browser = new agentcore.BrowserCustom(this, 'test-browser', {\n browserCustomName: 'test_browser',\n networkConfiguration: agentcore.BrowserNetworkConfiguration.usingVpc(this, {\n vpc: vpc,\n }),\n});\n\nbrowser.connections.addSecurityGroup(new ec2.SecurityGroup(this, 'AdditionalGroup', { vpc }));\n```\n\nSo security groups can be added after the browser construct creation. You can use methods like allowFrom() and allowTo() to grant ingress access to/egress access from a specified peer over a given portRange. The Connections object automatically adds the necessary ingress or egress rules to the security group(s) associated with the calling construct.\n\n### Browser with Recording Configuration\n\n```typescript fixture=default\n// Create an S3 bucket for recordings\nconst recordingBucket = new s3.Bucket(this, \"RecordingBucket\", {\n bucketName: \"my-browser-recordings\",\n removalPolicy: RemovalPolicy.DESTROY, // For demo purposes\n});\n\n// Create browser with recording enabled\nconst browser = new agentcore.BrowserCustom(this, \"MyBrowser\", {\n browserCustomName: \"my_browser\",\n description: \"Browser with recording enabled\",\n networkConfiguration: agentcore.BrowserNetworkConfiguration.usingPublicNetwork(),\n recordingConfig: {\n enabled: true,\n s3Location: {\n bucketName: recordingBucket.bucketName,\n objectKey: \"browser-recordings/\",\n },\n },\n});\n```\n\n### Browser with Custom Execution Role\n\n```typescript fixture=default\n// Create a custom execution role\nconst executionRole = new iam.Role(this, \"BrowserExecutionRole\", {\n assumedBy: new iam.ServicePrincipal(\"bedrock-agentcore.amazonaws.com\"),\n managedPolicies: [\n iam.ManagedPolicy.fromAwsManagedPolicyName(\"AmazonBedrockAgentCoreBrowserExecutionRolePolicy\"),\n ],\n});\n\n// Create browser with custom execution role\nconst browser = new agentcore.BrowserCustom(this, \"MyBrowser\", {\n browserCustomName: \"my_browser\",\n description: \"Browser with custom execution role\",\n networkConfiguration: agentcore.BrowserNetworkConfiguration.usingPublicNetwork(),\n executionRole: executionRole,\n});\n```\n\n### Browser with S3 Recording and Permissions\n\n```typescript fixture=default\n// Create an S3 bucket for recordings\nconst recordingBucket = new s3.Bucket(this, \"RecordingBucket\", {\n bucketName: \"my-browser-recordings\",\n removalPolicy: RemovalPolicy.DESTROY, // For demo purposes\n});\n\n// Create browser with recording enabled\nconst browser = new agentcore.BrowserCustom(this, \"MyBrowser\", {\n browserCustomName: \"my_browser\",\n description: \"Browser with recording enabled\",\n networkConfiguration: agentcore.BrowserNetworkConfiguration.usingPublicNetwork(),\n recordingConfig: {\n enabled: true,\n s3Location: {\n bucketName: recordingBucket.bucketName,\n objectKey: \"browser-recordings/\",\n },\n },\n});\n\n// The browser construct automatically grants S3 permissions to the execution role\n// when recording is enabled, so no additional IAM configuration is needed\n```\n\n### Browser with Browser signing\n\nAI agents need to browse the web on your behalf. When your agent visits a website to gather information, complete a form, or verify data, it encounters the same defenses designed to stop unwanted bots: CAPTCHAs, rate limits, and outright blocks.\n\nAmazon Bedrock AgentCore Browser supports Web Bot Auth. Web Bot Auth is a draft IETF protocol that gives agents verifiable cryptographic identities. When you enable Web Bot Auth in AgentCore Browser, the service issues cryptographic credentials that websites can verify. The agent presents these credentials with every request. The WAF may now additionally check the signature, confirm it matches a trusted directory, and allow the request through if verified bots are allowed by the domain owner and other WAF checks are clear.\n\nTo enable the browser to sign requests using the Web Bot Auth protocol, create a browser tool with the browserSigning configuration:\n\n```typescript fixture=default\nconst browser = new agentcore.BrowserCustom(this, 'test-browser', {\n browserCustomName: 'test_browser',\n browserSigning: agentcore.BrowserSigning.ENABLED\n});\n```\n\n### Browser IAM Permissions\n\nThe Browser construct provides convenient methods for granting IAM permissions:\n\n```typescript fixture=default\n// Create a browser\nconst browser = new agentcore.BrowserCustom(this, \"MyBrowser\", {\n browserCustomName: \"my_browser\",\n description: \"Browser for web automation\",\n networkConfiguration: agentcore.BrowserNetworkConfiguration.usingPublicNetwork(),\n});\n\n// Create a role that needs access to the browser\nconst userRole = new iam.Role(this, \"UserRole\", {\n assumedBy: new iam.ServicePrincipal(\"lambda.amazonaws.com\"),\n});\n\n// Grant read permissions (Get and List actions)\nbrowser.grantRead(userRole);\n\n// Grant use permissions (Start, Update, Stop actions)\nbrowser.grantUse(userRole);\n\n// Grant specific custom permissions\nbrowser.grant(userRole, \"bedrock-agentcore:GetBrowserSession\");\n```\n\n## Code Interpreter\n\nThe Amazon Bedrock AgentCore Code Interpreter enables AI agents to write and execute code securely in sandbox environments, enhancing their accuracy and expanding their ability to solve complex end-to-end tasks. This is critical in Agentic AI applications where the agents may execute arbitrary code that can lead to data compromise or security risks. The AgentCore Code Interpreter tool provides secure code execution, which helps you avoid running into these issues.\n\nFor more information about code interpreter, please refer to the [official documentation](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/code-interpreter-tool.html)\n\n### Code Interpreter Network Modes\n\nThe Code Interpreter construct supports the following network modes:\n\n1. **Public Network Mode** (`CodeInterpreterNetworkMode.usingPublicNetwork()`) - Default\n\n - Allows internet access for package installation and external API calls\n - Suitable for development and testing environments\n - Enables downloading Python packages from PyPI\n\n2. **Sandbox Network Mode** (`CodeInterpreterNetworkMode.usingSandboxNetwork()`)\n - Isolated network environment with no internet access\n - Suitable for production environments with strict security requirements\n - Only allows access to pre-installed packages and local resources\n\n3. **VPC (Virtual Private Cloud)** (`CodeInterpreterNetworkMode.usingVpc()`)\n - Select whether to run the browser in a virtual private cloud (VPC).\n - By configuring VPC connectivity, you enable secure access to private resources such as databases, internal APIs, and services within your VPC.\n\n While the VPC itself is mandatory, these are optional:\n - Subnets - if not provided, CDK will select appropriate subnets from the VPC\n - Security Groups - if not provided, CDK will create a default security group\n - Specific subnet selection criteria - you can let CDK choose automatically\n\nFor more information on VPC connectivity for Amazon Bedrock AgentCore Browser, please refer to the [official documentation](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/agentcore-vpc.html).\n\n### Code Interpreter Properties\n\n| Name | Type | Required | Description |\n|------|------|----------|-------------|\n| `codeInterpreterCustomName` | `string` | Yes | The name of the code interpreter. Must start with a letter and can be up to 48 characters long. Pattern: `[a-zA-Z][a-zA-Z0-9_]{0,47}` |\n| `description` | `string` | No | Optional description for the code interpreter. Can have up to 200 characters |\n| `executionRole` | `iam.IRole` | No | The IAM role that provides permissions for the code interpreter to access AWS services. A new role will be created if not provided |\n| `networkConfiguration` | `CodeInterpreterNetworkConfiguration` | No | Network configuration for code interpreter. Defaults to PUBLIC network mode |\n| `tags` | `{ [key: string]: string }` | No | Tags to apply to the code interpreter resource |\n\n### Basic Code Interpreter Creation\n\n```typescript fixture=default\n// Create a basic code interpreter with public network access\nconst codeInterpreter = new agentcore.CodeInterpreterCustom(this, \"MyCodeInterpreter\", {\n codeInterpreterCustomName: \"my_code_interpreter\",\n description: \"A code interpreter for Python execution\",\n});\n```\n\n### Code Interpreter with VPC\n\n```typescript fixture=default\nconst codeInterpreter = new agentcore.CodeInterpreterCustom(this, \"MyCodeInterpreter\", {\n codeInterpreterCustomName: \"my_sandbox_interpreter\",\n description: \"Code interpreter with isolated network access\",\n networkConfiguration: agentcore.BrowserNetworkConfiguration.usingVpc(this, {\n vpc: new ec2.Vpc(this, 'VPC', { restrictDefaultSecurityGroup: false }),\n }),\n});\n```\n\nCode Interpreter exposes a [connections](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.Connections.html) property. This property returns a connections object, which simplifies the process of defining and managing ingress and egress rules for security groups in your AWS CDK applications. Instead of directly manipulating security group rules, you interact with the Connections object of a construct, which then translates your connectivity requirements into the appropriate security group rules. For instance:\n\n```typescript fixture=default\nconst vpc = new ec2.Vpc(this, 'testVPC');\n\nconst codeInterpreter = new agentcore.CodeInterpreterCustom(this, \"MyCodeInterpreter\", {\n codeInterpreterCustomName: \"my_sandbox_interpreter\",\n description: \"Code interpreter with isolated network access\",\n networkConfiguration: agentcore.BrowserNetworkConfiguration.usingVpc(this, {\n vpc: vpc,\n }),\n});\n\ncodeInterpreter.connections.addSecurityGroup(new ec2.SecurityGroup(this, 'AdditionalGroup', { vpc }));\n```\n\nSo security groups can be added after the browser construct creation. You can use methods like allowFrom() and allowTo() to grant ingress access to/egress access from a specified peer over a given portRange. The Connections object automatically adds the necessary ingress or egress rules to the security group(s) associated with the calling construct.\n\n### Code Interpreter with Sandbox Network Mode\n\n```typescript fixture=default\n// Create code interpreter with sandbox network mode (isolated)\nconst codeInterpreter = new agentcore.CodeInterpreterCustom(this, \"MyCodeInterpreter\", {\n codeInterpreterCustomName: \"my_sandbox_interpreter\",\n description: \"Code interpreter with isolated network access\",\n networkConfiguration: agentcore.CodeInterpreterNetworkConfiguration.usingSandboxNetwork(),\n});\n```\n\n### Code Interpreter with Custom Execution Role\n\n```typescript fixture=default\n// Create a custom execution role\nconst executionRole = new iam.Role(this, \"CodeInterpreterExecutionRole\", {\n assumedBy: new iam.ServicePrincipal(\"bedrock-agentcore.amazonaws.com\"),\n});\n\n// Create code interpreter with custom execution role\nconst codeInterpreter = new agentcore.CodeInterpreterCustom(this, \"MyCodeInterpreter\", {\n codeInterpreterCustomName: \"my_code_interpreter\",\n description: \"Code interpreter with custom execution role\",\n networkConfiguration: agentcore.CodeInterpreterNetworkConfiguration.usingPublicNetwork(),\n executionRole: executionRole,\n});\n```\n\n### Code Interpreter IAM Permissions\n\nThe Code Interpreter construct provides convenient methods for granting IAM permissions:\n\n```typescript fixture=default\n// Create a code interpreter\nconst codeInterpreter = new agentcore.CodeInterpreterCustom(this, \"MyCodeInterpreter\", {\n codeInterpreterCustomName: \"my_code_interpreter\",\n description: \"Code interpreter for Python execution\",\n networkConfiguration: agentcore.CodeInterpreterNetworkConfiguration.usingPublicNetwork(),\n});\n\n// Create a role that needs access to the code interpreter\nconst userRole = new iam.Role(this, \"UserRole\", {\n assumedBy: new iam.ServicePrincipal(\"lambda.amazonaws.com\"),\n});\n\n// Grant read permissions (Get and List actions)\ncodeInterpreter.grantRead(userRole);\n\n// Grant use permissions (Start, Invoke, Stop actions)\ncodeInterpreter.grantUse(userRole);\n\n// Grant specific custom permissions\ncodeInterpreter.grant(userRole, \"bedrock-agentcore:GetCodeInterpreterSession\");\n```\n\n### Code interpreter with tags\n\n```typescript fixture=default\n// Create code interpreter with sandbox network mode (isolated)\nconst codeInterpreter = new agentcore.CodeInterpreterCustom(this, \"MyCodeInterpreter\", {\n codeInterpreterCustomName: \"my_sandbox_interpreter\",\n description: \"Code interpreter with isolated network access\",\n networkConfiguration: agentcore.CodeInterpreterNetworkConfiguration.usingPublicNetwork(),\n tags: {\n Environment: \"Production\",\n Team: \"AI/ML\",\n Project: \"AgentCore\",\n },\n});\n```\n\n## Gateway\n\nThe Gateway construct provides a way to create Amazon Bedrock Agent Core Gateways, which serve as integration points between agents and external services.\n\n### Gateway Properties\n\n| Name | Type | Required | Description |\n|------|------|----------|-------------|\n| `gatewayName` | `string` | Yes | The name of the gateway. Valid characters are a-z, A-Z, 0-9, _ (underscore) and - (hyphen). Maximum 100 characters |\n| `description` | `string` | No | Optional description for the gateway. Maximum 200 characters |\n| `protocolConfiguration` | `IGatewayProtocolConfig` | No | The protocol configuration for the gateway. Defaults to MCP protocol |\n| `authorizerConfiguration` | `IGatewayAuthorizerConfig` | No | The authorizer configuration for the gateway. Defaults to Cognito |\n| `exceptionLevel` | `GatewayExceptionLevel` | No | The verbosity of exception messages. Use DEBUG mode to see granular exception messages |\n| `kmsKey` | `kms.IKey` | No | The AWS KMS key used to encrypt data associated with the gateway |\n| `role` | `iam.IRole` | No | The IAM role that provides permissions for the gateway to access AWS services. A new role will be created if not provided |\n| `tags` | `{ [key: string]: string }` | No | Tags for the gateway. A list of key:value pairs of tags to apply to this Gateway resource |\n\n### Basic Gateway Creation\n\nThe protocol configuration defaults to MCP and the inbound auth configuration uses Cognito (it is automatically created on your behalf).\n\n```typescript fixture=default\n// Create a basic gateway with default MCP protocol and Cognito authorizer\nconst gateway = new agentcore.Gateway(this, \"MyGateway\", {\n gatewayName: \"my-gateway\",\n});\n```\n\n### Protocol configuration\n\nCurrently MCP is the only protocol available. To configure it, use the `protocol` property with `McpProtocolConfiguration`:\n\n- Instructions: Guidance for how to use the gateway with your tools\n- Semantic search: Smart tool discovery that finds the right tools without typical limits. It improves accuracy by finding relevant tools based on context\n- Supported versions: Which MCP protocol versions the gateway can use\n\n```typescript fixture=default\nconst gateway = new agentcore.Gateway(this, \"MyGateway\", {\n gatewayName: \"my-gateway\",\n protocolConfiguration: new agentcore.McpProtocolConfiguration({\n instructions: \"Use this gateway to connect to external MCP tools\",\n searchType: agentcore.McpGatewaySearchType.SEMANTIC,\n supportedVersions: [agentcore.MCPProtocolVersion.MCP_2025_03_26],\n }),\n});\n```\n\n### Inbound authorization\n\nBefore you create your gateway, you must set up inbound authorization. Inbound authorization validates users who attempt to access targets through\nyour AgentCore gateway. By default, if not provided, the construct will create and configure Cognito as the default identity provider\n(inbound Auth setup). AgentCore supports the following types of inbound authorization:\n\n**JSON Web Token (JWT)** – A secure and compact token used for authorization. After creating the JWT, you specify it as the authorization\nconfiguration when you create the gateway. You can create a JWT with any of the identity providers at Provider setup and configuration.\n\nYou can configure a custom authorization provider using the `inboundAuthorizer` property with `GatewayAuthorizer.usingCustomJwt()`.\nYou need to specify an OAuth discovery server and client IDs/audiences when you create the gateway. You can specify the following:\n\n- Discovery Url — String that must match the pattern ^.+/\\.well-known/openid-configuration$ for OpenID Connect discovery URLs\n- At least one of the below options depending on the chosen identity provider.\n- Allowed audiences — List of allowed audiences for JWT tokens\n- Allowed clients — List of allowed client identifiers\n\n```typescript fixture=default\nconst gateway = new agentcore.Gateway(this, \"MyGateway\", {\n gatewayName: \"my-gateway\",\n authorizerConfiguration: agentcore.GatewayAuthorizer.usingCustomJwt({\n discoveryUrl: \"https://auth.example.com/.well-known/openid-configuration\",\n allowedAudience: [\"my-app\"],\n allowedClients: [\"my-client-id\"],\n }),\n});\n```\n\n**IAM** – Authorizes through the credentials of the AWS IAM identity trying to access the gateway.\n\n```typescript fixture=default\nconst gateway = new agentcore.Gateway(this, \"MyGateway\", {\n gatewayName: \"my-gateway\",\n authorizerConfiguration: agentcore.GatewayAuthorizer.usingAwsIam(),\n});\n\n// Grant access to a Lambda function's role\nconst lambdaRole = new iam.Role(this, \"LambdaRole\", {\n assumedBy: new iam.ServicePrincipal(\"lambda.amazonaws.com\"),\n});\n\n// The Lambda needs permission to invoke the gateway\ngateway.grantInvoke(lambdaRole);\n```\n\n### Gateway with KMS Encryption\n\nYou can provide a KMS key, and configure the authorizer as well as the protocol configuration.\n\n```typescript fixture=default\n// Create a KMS key for encryption\nconst encryptionKey = new kms.Key(this, \"GatewayEncryptionKey\", {\n enableKeyRotation: true,\n description: \"KMS key for gateway encryption\",\n});\n\n// Create gateway with KMS encryption\nconst gateway = new agentcore.Gateway(this, \"MyGateway\", {\n gatewayName: \"my-encrypted-gateway\",\n description: \"Gateway with KMS encryption\",\n protocolConfiguration: new agentcore.McpProtocolConfiguration({\n instructions: \"Use this gateway to connect to external MCP tools\",\n searchType: agentcore.McpGatewaySearchType.SEMANTIC,\n supportedVersions: [agentcore.MCPProtocolVersion.MCP_2025_03_26],\n }),\n authorizerConfiguration: agentcore.GatewayAuthorizer.usingCustomJwt({\n discoveryUrl: \"https://auth.example.com/.well-known/openid-configuration\",\n allowedAudience: [\"my-app\"],\n allowedClients: [\"my-client-id\"],\n }),\n kmsKey: encryptionKey,\n exceptionLevel: agentcore.GatewayExceptionLevel.DEBUG,\n});\n```\n\n### Gateway with Custom Execution Role\n\n```typescript fixture=default\n// Create a custom execution role\nconst executionRole = new iam.Role(this, \"GatewayExecutionRole\", {\n assumedBy: new iam.ServicePrincipal(\"bedrock-agentcore.amazonaws.com\"),\n managedPolicies: [\n iam.ManagedPolicy.fromAwsManagedPolicyName(\"AmazonBedrockAgentCoreGatewayExecutionRolePolicy\"),\n ],\n});\n\n// Create gateway with custom execution role\nconst gateway = new agentcore.Gateway(this, \"MyGateway\", {\n gatewayName: \"my-gateway\",\n description: \"Gateway with custom execution role\",\n protocolConfiguration: new agentcore.McpProtocolConfiguration({\n instructions: \"Use this gateway to connect to external MCP tools\",\n searchType: agentcore.McpGatewaySearchType.SEMANTIC,\n supportedVersions: [agentcore.MCPProtocolVersion.MCP_2025_03_26],\n }),\n authorizerConfiguration: agentcore.GatewayAuthorizer.usingCustomJwt({\n discoveryUrl: \"https://auth.example.com/.well-known/openid-configuration\",\n allowedAudience: [\"my-app\"],\n allowedClients: [\"my-client-id\"],\n }),\n role: executionRole,\n});\n```\n\n### Gateway IAM Permissions\n\nThe Gateway construct provides convenient methods for granting IAM permissions:\n\n```typescript fixture=default\n// Create a gateway\nconst gateway = new agentcore.Gateway(this, \"MyGateway\", {\n gatewayName: \"my-gateway\",\n description: \"Gateway for external service integration\",\n protocolConfiguration: new agentcore.McpProtocolConfiguration({\n instructions: \"Use this gateway to connect to external MCP tools\",\n searchType: agentcore.McpGatewaySearchType.SEMANTIC,\n supportedVersions: [agentcore.MCPProtocolVersion.MCP_2025_03_26],\n }),\n authorizerConfiguration: agentcore.GatewayAuthorizer.usingCustomJwt({\n discoveryUrl: \"https://auth.example.com/.well-known/openid-configuration\",\n allowedAudience: [\"my-app\"],\n allowedClients: [\"my-client-id\"],\n }),\n});\n\n// Create a role that needs access to the gateway\nconst userRole = new iam.Role(this, \"UserRole\", {\n assumedBy: new iam.ServicePrincipal(\"lambda.amazonaws.com\"),\n});\n\n// Grant read permissions (Get and List actions)\ngateway.grantRead(userRole);\n\n// Grant manage permissions (Create, Update, Delete actions)\ngateway.grantManage(userRole);\n\n// Grant specific custom permissions\ngateway.grant(userRole, \"bedrock-agentcore:GetGateway\");\n```\n\n## Gateway Target\n\nAfter Creating gateways, you can add targets which define the tools that your gateway will host. Gateway supports multiple target\ntypes including Lambda functions and API specifications (either OpenAPI schemas or Smithy models). Gateway allows you to attach multiple\ntargets to a Gateway and you can change the targets / tools attached to a gateway at any point. Each target can have its own\ncredential provider attached enabling you to securely access targets whether they need IAM, API Key, or OAuth credentials.\n\n### Gateway Target Properties\n\n| Name | Type | Required | Description |\n|------|------|----------|-------------|\n| `gatewayTargetName` | `string` | Yes | The name of the gateway target. Valid characters are a-z, A-Z, 0-9, _ (underscore) and - (hyphen) |\n| `description` | `string` | No | Optional description for the gateway target. Maximum 200 characters |\n| `gateway` | `IGateway` | Yes | The gateway this target belongs to |\n| `targetConfiguration` | `ITargetConfiguration` | Yes | The target configuration (Lambda, OpenAPI, or Smithy). **Note:** Users typically don't create this directly. When using convenience methods like `GatewayTarget.forLambda()`, `GatewayTarget.forOpenApi()`, `GatewayTarget.forSmithy()` or the gateway's `addLambdaTarget()`, `addOpenApiTarget()`, `addSmithyTarget()` methods, this configuration is created internally for you. Only needed when using the GatewayTarget constructor directly for [advanced scenarios](#advanced-usage-direct-configuration-for-gateway-target). |\n| `credentialProviderConfigurations` | `IGatewayCredentialProvider[]` | No | Credential providers for authentication. Defaults to `[GatewayCredentialProvider.fromIamRole()]`. Use `GatewayCredentialProvider.fromApiKeyIdentityArn()`, `GatewayCredentialProvider.fromOauthIdentityArn()`, or `GatewayCredentialProvider.fromIamRole()` |\n| `validateOpenApiSchema` | `boolean` | No | (OpenAPI targets only) Whether to validate the OpenAPI schema at synthesis time. Defaults to `true`. Only applies to inline and local asset schemas. For more information refer here <https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/gateway-schema-openapi.html> |\n\nThis approach gives you full control over the configuration but is typically not necessary for most use cases.\n\n### Targets types\n\nYou can create the following targets types:\n\n**Lambda Target**: Lambda targets allow you to connect your gateway to AWS Lambda functions that implement your tools. This is useful\nwhen you want to execute custom code in response to tool invocations.\n\n- Supports GATEWAY_IAM_ROLE credential provider only\n- Ideal for custom serverless function integration\n- Need tool schema (tool schema is a blueprint that describes the functions your Lambda provides to AI agents).\n The construct provide [3 ways to upload a tool schema to Lambda target](#tools-schema-for-lambda-target)\n- When using the default IAM authentication (no `credentialProviderConfigurations` specified),\n the construct automatocally grants the gateway role permission to invoke your Lambda function (`lambda:InvokeFunction`).\n\n**OpenAPI Schema Target** : OpenAPI widely used standard for describing RESTful APIs. Gateway supports OpenAPI 3.0\nspecifications for defining API targets. It connects to REST APIs using OpenAPI specifications\n\n- Supports OAUTH and API_KEY credential providers (Do not support IAM, you must provide `credentialProviderConfigurations`)\n- Ideal for integrating with external REST services\n- Need API schema. The construct provide [3 ways to upload a API schema to OpenAPI target](#api-schema-for-openapi-and-smithy-target)\n\n**Smithy Model Target** : Smithy is a language for defining services and software development kits (SDKs). Smithy models provide\na more structured approach to defining APIs compared to OpenAPI, and are particularly useful for connecting to AWS services.\nAgentCore Gateway supports built-in AWS service models only. It connects to services using Smithy model definitions\n\n- Supports OAUTH and API_KEY credential providers\n- Ideal for AWS service integrations\n- Need API schema. The construct provide 3 ways to upload a API schema to Smity target\n- When using the default IAM authentication (no `credentialProviderConfigurations` specified), The construct only\n grants permission to read the Smithy schema file from S3. You MUST manually grant permissions for the gateway\n role to invoke the actual Smithy API endpoints\n\n> Note: For Smithy model targets that access AWS services, your Gateway's execution role needs permissions to access those services.\nFor example, for a DynamoDB target, your execution role needs permissions to perform DynamoDB operations.\nThis is not managed by the construct due to the large number of options. Please refer to\n[Smithy Model Permission](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/gateway-prerequisites-permissions.html) for example.\n\n**MCP Server Target**: Model Context Protocol (MCP) servers provide external tools, data access, and custom functions for AI agents.\nMCP servers enable agents to interact with external systems and services through a standardized protocol. Gateway automatically\ndiscovers and indexes available tools from MCP servers through synchronization.\n\n**Key Features:**\n\n- Requires explicit authentication configuration (OAuth2 recommended, empty array for NoAuth)\n- Ideal for connecting to external MCP-compliant servers\n- The endpoint must use HTTPS protocol\n- Supported MCP protocol versions: 2025-06-18, 2025-03-26\n- Automatic tool discovery through synchronization\n\n**Synchronization Behavior:**\n\nMCP Server targets require synchronization to discover and index available tools:\n\n- **Implicit Synchronization (Automatic)**: Tool discovery happens automatically during:\n - Target creation (`CreateGatewayTarget`)\n - Target updates (`UpdateGatewayTarget`)\n - The Gateway calls the MCP server's `tools/list` endpoint and indexes tools without user intervention\n\n- **Explicit Synchronization (Manual)**: When the MCP server's tools change independently (new tools added, schemas modified, tools removed):\n - The Gateway's tool catalog becomes stale\n - Call the `SynchronizeGatewayTargets` API to refresh the catalog\n - Use the `grantSync()` method to grant permissions to Lambda functions, CI/CD pipelines, or scheduled tasks that will trigger synchronization\n\n**Authentication & Permissions:**\n\nWhen using OAuth2, the Gateway service role automatically receives:\n\n- `bedrock-agentcore:GetWorkloadAccessToken`\n- `bedrock-agentcore:GetResourceOauth2Token`\n- `secretsmanager:GetSecretValue`\n- KMS decrypt (if secrets are encrypted)\n\nFor explicit synchronization, use `grantSync()` to grant `bedrock-agentcore:SynchronizeGatewayTargets` permission to your operator roles.\n\n> For more information, refer to the [MCP Server Target documentation](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/gateway-target-MCPservers.html).\n\n### Understanding Tool Naming\n\nWhen tools are exposed through gateway targets, AgentCore Gateway prefixes each tool name with the target name to ensure uniqueness across multiple targets. This is important to understand when building your application logic.\n\n**Naming Pattern:**\n\n**Example:**\n\nIf your target is named `my-lambda-target` and provides a tool called `calculate_price`, agents will discover and invoke it as `my-lambda-target__calculate_price`.\n\n**Important Considerations:**\n\n- **For Lambda Targets**: Your Lambda handler must strip the target name prefix before processing the tool request. The full tool name (with prefix) is sent in the event.\n- **For MCP Server Targets**: The MCP server receives tool calls with the prefixed name from the gateway.\n- **For OpenAPI/Smithy Targets**: The gateway handles the prefix automatically when mapping to API operations based on the `operationId`.\n\nThis naming convention ensures that:\n\n- Tools from different targets don't collide even if they have the same name\n- Agents can access tools from multiple targets through a single gateway\n- Tool names remain unique in the unified tool catalog\n\nFor more details, see the [Gateway Tool Naming Documentation](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/gateway-tool-naming.html).\n\n### Tools schema For Lambda target\n\nThe lambda target need tools schema to understand the fuunction lambda provides. You can upload the tool schema by following 3 ways:\n\n- From a local asset file\n\n```typescript\nconst toolSchema = agentcore.ToolSchema.fromLocalAsset(\n path.join(__dirname, \"schemas\", \"my-tool-schema.json\")\n );\n```\n\n- From an existing S3 file:\n\n```typescript\n\nconst toolSchema = agentcore.ToolSchema.fromS3File(\n s3.Bucket.fromBucketName(this, \"SchemasBucket\", \"my-schemas-bucket\"),\n \"tools/complex-tool-schema.json\",\n \"123456789012\"\n );\n```\n\n- From Inline:\n\n```typescript\nconst toolSchema = agentcore.ToolSchema.fromInline([{\n name: \"hello_world\",\n description: \"A simple hello world tool\",\n inputSchema: {\n type: agentcore.SchemaDefinitionType.OBJECT,\n properties: {\n name: {\n type: agentcore.SchemaDefinitionType.STRING,\n description: \"The name to greet\",\n },\n },\n required: [\"name\"],\n },\n }]);\n\n```\n\n### Api schema For OpenAPI and Smithy target\n\nThe OpenAPI and Smithy target need API Schema. The Gateway construct provide three ways to upload API schema for your target:\n\n- From a local asset file (requires binding to scope):\n\n```typescript fixture=default\n// When using ApiSchema.fromLocalAsset, you must bind the schema to a scope\nconst schema = agentcore.ApiSchema.fromLocalAsset(path.join(__dirname, \"mySchema.yml\"));\n\nschema.bind(this);\n```\n\n- From an inline schema:\n\n```typescript fixture=default\nconst inlineSchema = agentcore.ApiSchema.fromInline(`\nopenapi: 3.0.3\ninfo:\n title: Library API\n version: 1.0.0\npaths:\n /search:\n get:\n summary: Search for books\n operationId: searchBooks\n parameters:\n - name: query\n in: query\n required: true\n schema:\n type: string\n`);\n```\n\n- From an existing S3 file:\n\n```typescript fixture=default\nconst bucket = s3.Bucket.fromBucketName(this, \"ExistingBucket\", \"my-schema-bucket\");\nconst s3Schema = agentcore.ApiSchema.fromS3File(bucket, \"schemas/action-group.yaml\");\n```\n\n### Outbound auth\n\nOutbound authorization lets Amazon Bedrock AgentCore gateways securely access gateway targets on behalf of users authenticated\nand authorized during Inbound Auth.\n\nAgentCore Gateway supports the following types of outbound authorization:\n\n**IAM-based outbound authorization** – The gateway uses its execution role to authenticate with AWS services. This is the default\n and most common approach for Lambda targets and AWS service integrations.\n\n**2-legged OAuth (OAuth 2LO)** – Use OAuth 2.0 two-legged flow (2LO) for targets that require OAuth authentication.\nThe gateway authenticates on its own behalf, not on behalf of a user.\n\n**API key** – Use the AgentCore service/AWS console to generate an API key to authenticate access to the gateway target.\n\n**Note > You need to set up the outbound identity before you can create a gateway target.\n\n### Basic Gateway Target Creation\n\nYou can create targets in two ways: using the static factory methods on `GatewayTarget` or using the convenient `addTarget` methods on the gateway instance.\n\n#### Using addTarget methods (Recommended)\n\nBelow are the examples on how you can create Lambda , Smity and OpenAPI target using `addTarget` method.\n\n```typescript fixture=default\n// Create a gateway first\nconst gateway = new agentcore.Gateway(this, \"MyGateway\", {\n gatewayName: \"my-gateway\",\n});\n\nconst lambdaFunction = new lambda.Function(this, \"MyFunction\", {\n runtime: lambda.Runtime.NODEJS_22_X,\n handler: \"index.handler\",\n code: lambda.Code.fromInline(`\n exports.handler = async (event) => {\n return {\n statusCode: 200,\n body: JSON.stringify({ message: 'Hello from Lambda!' })\n };\n };\n `),\n});\n\nconst lambdaTarget = gateway.addLambdaTarget(\"MyLambdaTarget\", {\n gatewayTargetName: \"my-lambda-target\",\n description: \"Lambda function target\",\n lambdaFunction: lambdaFunction,\n toolSchema: agentcore.ToolSchema.fromInline([\n {\n name: \"hello_world\",\n description: \"A simple hello world tool\",\n inputSchema: {\n type: agentcore.SchemaDefinitionType.OBJECT,\n properties: {\n name: {\n type: agentcore.SchemaDefinitionType.STRING,\n description: \"The name to greet\",\n },\n },\n required: [\"name\"],\n },\n },\n ]),\n});\n```\n\n- OpenAPI Target\n\n``` typescript\nconst gateway = new agentcore.Gateway(this, \"MyGateway\", {\n gatewayName: \"my-gateway\",\n});\n\n// These ARNs are returned when creating the API key credential provider via Console or API\nconst apiKeyProviderArn = \"arn:aws:bedrock-agentcore:us-east-1:123456789012:token-vault/abc123/apikeycredentialprovider/my-apikey\"\nconst apiKeySecretArn = \"arn:aws:secretsmanager:us-east-1:123456789012:secret:my-apikey-secret-abc123\"\n\nconst bucket = s3.Bucket.fromBucketName(this, \"ExistingBucket\", \"my-schema-bucket\");\nconst s3mySchema = agentcore.ApiSchema.fromS3File(bucket, \"schemas/myschema.yaml\");\n\n// Add an OpenAPI target directly to the gateway\nconst target = gateway.addOpenApiTarget(\"MyTarget\", {\n gatewayTargetName: \"my-api-target\",\n description: \"Target for external API integration\",\n apiSchema: s3mySchema,\n credentialProviderConfigurations: [\n agentcore.GatewayCredentialProvider.fromApiKeyIdentityArn({\n providerArn: apiKeyProviderArn,\n secretArn: apiKeySecretArn,\n credentialLocation: agentcore.ApiKeyCredentialLocation.header({\n credentialParameterName: \"X-API-Key\",\n }),\n }),\n ],\n});\n\n// This make sure your s3 bucket is available before target\ntarget.node.addDependency(bucket);\n```\n\n- Smithy Target\n\n```typescript fixture=default\n\nconst gateway = new agentcore.Gateway(this, \"MyGateway\", {\n gatewayName: \"my-gateway\",\n});\n\nconst smithySchema = agentcore.ApiSchema.fromLocalAsset(\n path.join(__dirname, \"models\", \"smithy-model.json\")\n);\nsmithySchema.bind(this);\n\nconst smithyTarget = gateway.addSmithyTarget(\"MySmithyTarget\", {\n gatewayTargetName: \"my-smithy-target\",\n description: \"Smithy model target\",\n smithyModel: smithySchema,\n\n});\n```\n\n- MCP Server Target\n\n```typescript fixture=default\nconst gateway = new agentcore.Gateway(this, \"MyGateway\", {\n gatewayName: \"my-gateway\",\n});\n\n// OAuth2 authentication (recommended)\n// Note: Create the OAuth provider using AWS console or Identity L2 construct when available\nconst oauthProviderArn = \"arn:aws:bedrock-agentcore:us-east-1:123456789012:token-vault/abc123/oauth2credentialprovider/my-oauth\";\nconst oauthSecretArn = \"arn:aws:secretsmanager:us-east-1:123456789012:secret:my-oauth-secret-abc123\";\n\n// Add an MCP server target directly to the gateway\nconst mcpTarget = gateway.addMcpServerTarget(\"MyMcpServer\", {\n gatewayTargetName: \"my-mcp-server\",\n description: \"External MCP server integration\",\n endpoint: \"https://my-mcp-server.example.com\",\n credentialProviderConfigurations: [\n agentcore.GatewayCredentialProvider.fromOauthIdentityArn({\n providerArn: oauthProviderArn,\n secretArn: oauthSecretArn,\n scopes:['mcp-runtime-server/invoke']\n }),\n ],\n});\n\n// Grant sync permission to a Lambda function that will trigger synchronization\nconst syncFunction = new lambda.Function(this, \"SyncFunction\", {\n runtime: lambda.Runtime.PYTHON_3_12,\n handler: \"index.handler\",\n code: lambda.Code.fromInline(`\nimport boto3\n\ndef handler(event, context):\n client = boto3.client('bedrock-agentcore')\n response = client.synchronize_gateway_targets(\n gatewayIdentifier=event['gatewayId'],\n targetIds=[event['targetId']]\n )\n return response\n `),\n});\n\nmcpTarget.grantSync(syncFunction);\n```\n\n#### Using static factory methods\n\nCreate Gateway target using static convienence method.\n\n- Lambda Target\n\n```typescript fixture=default\nconst gateway = new agentcore.Gateway(this, \"MyGateway\", {\n gatewayName: \"my-gateway\",\n});\n\nconst lambdaFunction = new lambda.Function(this, \"MyFunction\", {\n runtime: lambda.Runtime.NODEJS_22_X,\n handler: \"index.handler\",\n code: lambda.Code.fromInline(`\n exports.handler = async (event) => {\n return {\n statusCode: 200,\n body: JSON.stringify({ message: 'Hello from Lambda!' })\n };\n };\n `),\n});\n\n// Create a gateway target with Lambda and tool schema\nconst target = agentcore.GatewayTarget.forLambda(this, \"MyLambdaTarget\", {\n gatewayTargetName: \"my-lambda-target\",\n description: \"Target for Lambda function integration\",\n gateway: gateway,\n lambdaFunction: lambdaFunction,\n toolSchema: agentcore.ToolSchema.fromLocalAsset(\n path.join(__dirname, \"schemas\", \"my-tool-schema.json\")\n ),\n});\n```\n\n- OpenAPI Target\n\n```typescript fixture=default\n\nconst gateway = new agentcore.Gateway(this, \"MyGateway\", {\n gatewayName: \"my-gateway\",\n});\n\n// outbound auth (Use AWS console to create it, Once Identity L2 construct is available you can use it to create identity)\nconst apiKeyIdentityArn = \"arn:aws:bedrock-agentcore:us-east-1:123456789012:token-vault/abc123/apikeycredentialprovider/my-apikey\"\nconst apiKeySecretArn = \"arn:aws:secretsmanager:us-east-1:123456789012:secret:my-apikey-secret-abc123\"\n\nconst opneapiSchema = agentcore.ApiSchema.fromLocalAsset(path.join(__dirname, \"mySchema.yml\"));\nopneapiSchema.bind(this);\n\n// Create a gateway target with OpenAPI Schema\nconst target = agentcore.GatewayTarget.forOpenApi(this, \"MyTarget\", {\n gatewayTargetName: \"my-api-target\",\n description: \"Target for external API integration\",\n gateway: gateway, // Note: you need to pass the gateway reference\n apiSchema: opneapiSchema,\n credentialProviderConfigurations: [\n agentcore.GatewayCredentialProvider.fromApiKeyIdentityArn({\n providerArn: apiKeyIdentityArn,\n secretArn: apiKeySecretArn\n }),\n ],\n});\n\n```\n\n- Smithy Target\n\n```typescript fixture=default\n\nconst gateway = new agentcore.Gateway(this, \"MyGateway\", {\n gatewayName: \"my-gateway\",\n});\n\nconst smithySchema = agentcore.ApiSchema.fromLocalAsset(\n path.join(__dirname, \"models\", \"smithy-model.json\")\n);\nsmithySchema.bind(this);\n\n// Create a gateway target with Smithy Model and OAuth\nconst target = agentcore.GatewayTarget.forSmithy(this, \"MySmithyTarget\", {\n gatewayTargetName: \"my-smithy-target\",\n description: \"Target for Smithy model integration\",\n gateway: gateway,\n smithyModel: smithySchema,\n});\n\n```\n\n- MCP Server Target\n\n```typescript fixture=default\nconst gateway = new agentcore.Gateway(this, \"MyGateway\", {\n gatewayName: \"my-gateway\",\n});\n\n// OAuth2 authentication (recommended)\n// Note: Create the OAuth provider using AWS console or Identity L2 construct when available\nconst oauthProviderArn = \"arn:aws:bedrock-agentcore:us-east-1:123456789012:token-vault/abc123/oauth2credentialprovider/my-oauth\";\nconst oauthSecretArn = \"arn:aws:secretsmanager:us-east-1:123456789012:secret:my-oauth-secret-abc123\";\n\n// Create a gateway target with MCP Server\nconst mcpTarget = agentcore.GatewayTarget.forMcpServer(this, \"MyMcpServer\", {\n gatewayTargetName: \"my-mcp-server\",\n description: \"External MCP server integration\",\n gateway: gateway,\n endpoint: \"https://my-mcp-server.example.com\",\n credentialProviderConfigurations: [\n agentcore.GatewayCredentialProvider.fromOauthIdentityArn({\n providerArn: oauthProviderArn,\n secretArn: oauthSecretArn,\n scopes:['mcp-runtime-server/invoke']\n }),\n ],\n});\n```\n\n### Advanced Usage: Direct Configuration for gateway target\n\nFor advanced use cases where you need full control over the target configuration, you can create configurations manually using the static factory methods and use the GatewayTarget constructor directly.\n\n#### Configuration Factory Methods\n\nEach target type has a corresponding configuration class with a static `create()` method:\n\n- **Lambda**: `LambdaTargetConfiguration.create(lambdaFunction, toolSchema)`\n- **OpenAPI**: `OpenApiTargetConfiguration.create(apiSchema, validateSchema?)`\n- **Smithy**: `SmithyTargetConfiguration.create(smithyModel)`\n\n#### Example: Lambda Target with Custom Configuration\n\n```typescript\nconst gateway = new agentcore.Gateway(this, \"MyGateway\", {\n gatewayName: \"my-gateway\",\n});\n\nconst myLambdaFunction = new lambda.Function(this, \"MyFunction\", {\n runtime: lambda.Runtime.NODEJS_22_X,\n handler: \"index.handler\",\n code: lambda.Code.fromInline(`\n exports.handler = async (event) => ({ statusCode: 200 });\n `),\n});\n\nconst myToolSchema = agentcore.ToolSchema.fromInline([{\n name: \"my_tool\",\n description: \"My custom tool\",\n inputSchema: {\n type: agentcore.SchemaDefinitionType.OBJECT,\n properties: {},\n },\n}]);\n\n// Create a custom Lambda configuration\nconst customConfig = agentcore.LambdaTargetConfiguration.create(\n myLambdaFunction,\n myToolSchema\n);\n\n// Use the GatewayTarget constructor directly\nconst target = new agentcore.GatewayTarget(this, \"AdvancedTarget\", {\n gateway: gateway,\n gatewayTargetName: \"advanced-target\",\n targetConfiguration: customConfig, // Manually created configuration\n credentialProviderConfigurations: [\n agentcore.GatewayCredentialProvider.fromIamRole()\n ]\n});\n```\n\nThis approach gives you full control over the configuration but is typically not necessary for most use cases. The convenience methods (`GatewayTarget.forLambda()`, `GatewayTarget.forOpenApi()`, `GatewayTarget.forSmithy()`) handle all of this internally.\n\n### Gateway Target IAM Permissions\n\nThe Gateway Target construct provides convenient methods for granting IAM permissions:\n\n```typescript fixture=default\n// Create a gateway and target\nconst gateway = new agentcore.Gateway(this, \"MyGateway\", {\n gatewayName: \"my-gateway\",\n});\n\nconst smithySchema = agentcore.ApiSchema.fromLocalAsset(\n path.join(__dirname, \"models\", \"smithy-model.json\")\n);\nsmithySchema.bind(this);\n\n// Create a gateway target with Smithy Model and OAuth\nconst target = agentcore.GatewayTarget.forSmithy(this, \"MySmithyTarget\", {\n gatewayTargetName: \"my-smithy-target\",\n description: \"Target for Smithy model integration\",\n gateway: gateway,\n smithyModel: smithySchema,\n});\n\n// Create a role that needs access to the gateway target\nconst userRole = new iam.Role(this, \"UserRole\", {\n assumedBy: new iam.ServicePrincipal(\"lambda.amazonaws.com\"),\n});\n\n// Grant read permissions (Get and List actions)\ntarget.grantRead(userRole);\n\n// Grant manage permissions (Create, Update, Delete actions)\ntarget.grantManage(userRole);\n\n// Grant specific custom permissions\ntarget.grant(userRole, \"bedrock-agentcore:GetGatewayTarget\");\n\n\n// Grants permission to invoke this Gateway\ngateway.grantInvoke(userRole);\n```\n\n## Memory\n\nMemory is a critical component of intelligence. While Large Language Models (LLMs) have impressive capabilities, they lack persistent memory across conversations. Amazon Bedrock AgentCore Memory addresses this limitation by providing a managed service that enables AI agents to maintain context over time, remember important facts, and deliver consistent, personalized experiences.\n\nAgentCore Memory operates on two levels:\n\n- **Short-Term Memory**: Immediate conversation context and session-based information that provides continuity within a single interaction or closely related sessions.\n- **Long-Term Memory**: Persistent information extracted and stored across multiple conversations, including facts, preferences, and summaries that enable personalized experiences over time.\n\nWhen you interact with the memory via the `CreateEvent` API, you store interactions in Short-Term Memory (STM) instantly. These interactions can include everything from user messages, assistant responses, to tool actions.\n\nTo write to long-term memory, you need to configure extraction strategies which define how and where to store information from conversations for future use. These strategies are asynchronously processed from raw events after every few turns based on the strategy that was selected. You can't create long term memory records directly, as they are extracted asynchronously by AgentCore Memory.\n\n### Memory Properties\n\n| Name | Type | Required | Description |\n|------|------|----------|-------------|\n| `memoryName` | `string` | Yes | The name of the memory |\n| `expirationDuration` | `Duration` | No | Short-term memory expiration in days (between 7 and 365). Default: 90 days |\n| `description` | `string` | No | Optional description for the memory. Default: no description. |\n| `kmsKey` | `IKey` | No | Custom KMS key to use for encryption. Default: Your data is encrypted with a key that AWS owns and manages for you |\n| `memoryStrategies` | `MemoryStrategyBase[]` | No | Built-in extraction strategies to use for this memory. Default: No extraction strategies (short term memory only) |\n| `executionRole` | `iam.IRole` | No | The IAM role that provides permissions for the memory to access AWS services. Default: A new role will be created. |\n| `tags` | `{ [key: string]: string }` | No | Tags for memory. Default: no tags. |\n\n### Basic Memory Creation\n\nBelow you can find how to configure a simple short-term memory (STM) with no long-term memory extraction strategies.\nNote how you set `expirationDuration`, which defines the time the events will be stored in the short-term memory before they expire.\n\n```typescript fixture=default\n\n// Create a basic memory with default settings, no LTM strategies\nconst memory = new agentcore.Memory(this, \"MyMemory\", {\n memoryName: \"my_memory\",\n description: \"A memory for storing user interactions for a period of 90 days\",\n expirationDuration: cdk.Duration.days(90),\n});\n```\n\nBasic Memory with Custom KMS Encryption\n\n```typescript fixture=default\n// Create a custom KMS key for encryption\nconst encryptionKey = new kms.Key(this, \"MemoryEncryptionKey\", {\n enableKeyRotation: true,\n description: \"KMS key for memory encryption\",\n});\n\n// Create memory with custom encryption\nconst memory = new agentcore.Memory(this, \"MyMemory\", {\n memoryName: \"my_encrypted_memory\",\n description: \"Memory with custom KMS encryption\",\n expirationDuration: cdk.Duration.days(90),\n kmsKey: encryptionKey,\n});\n```\n\n### LTM Memory Extraction Stategies\n\nIf you need long-term memory for context recall across sessions, you can setup memory extraction strategies\nto extract the relevant memory from the raw events.\n\nAmazon Bedrock AgentCore Memory has different memory strategies for extracting and organizing information:\n\n- **Summarization**: to summarize interactions to preserve critical context and key insights.\n- **Semantic Memory**: to extract general factual knowledge, concepts and meanings from raw conversations using vector embeddings.\nThis enables similarity-based retrieval of relevant facts and context.\n- **User Preferences**: to extract user behavior patterns from raw conversations.\n\nYou can use built-in extraction strategies for quick setup, or create custom extraction strategies with specific models and prompt templates.\n\n### Memory with Built-in Strategies\n\nThe library provides three built-in LTM strategies. These are default strategies for organizing and extracting memory data,\neach optimized for specific use cases.\n\nFor example: An agent helps multiple users with cloud storage setup. From these conversations,\nsee how each strategy processes users expressing confusion about account connection:\n\n1. **Summarization Strategy** (`MemoryStrategy.usingBuiltInSummarization()`)\nThis strategy compresses conversations into concise overviews, preserving essential context and key insights for quick recall.\nExtracted memory example: Users confused by cloud setup during onboarding.\n\n - Extracts concise summaries to preserve critical context and key insights\n - Namespace: `/strategies/{memoryStrategyId}/actors/{actorId}/sessions/{sessionId}`\n\n2. **Semantic Memory Strategy** (`MemoryStrategy.usingBuiltInSemantic()`)\nDistills general facts, concepts, and underlying meanings from raw conversational data, presenting the information in a context-independent format.\nExtracted memory example: In-context learning = task-solving via examples, no training needed.\n\n - Extracts general factual knowledge, concepts and meanings from raw conversations\n - Namespace: `/strategies/{memoryStrategyId}/actors/{actorId}`\n\n3. **User Preference Strategy** (`MemoryStrategy.usingBuiltInUserPreference()`)\nCaptures individual preferences, interaction patterns, and personalized settings to enhance future experiences.\nExtracted memory example: User needs clear guidance on cloud storage account connection during onboarding.\n\n - Extracts user behavior patterns from raw conversations\n - Namespace: `/strategies/{memoryStrategyId}/actors/{actorId}`\n\n```typescript fixture=default\n// Create memory with built-in strategies\nconst memory = new agentcore.Memory(this, \"MyMemory\", {\n memoryName: \"my_memory\",\n description: \"Memory with built-in strategies\",\n expirationDuration: cdk.Duration.days(90),\n memoryStrategies: [\n agentcore.MemoryStrategy.usingBuiltInSummarization(),\n agentcore.MemoryStrategy.usingBuiltInSemantic(),\n agentcore.MemoryStrategy.usingBuiltInUserPreference(),\n ],\n});\n```\n\nThe name generated for each built in memory strategy is as follows:\n\n- For Summarization: `summary_builtin_cdk001`\n- For Semantic:`semantic_builtin_cdk001>`\n- For User Preferences: `preference_builtin_cdk001`\n\n### Memory with custom Strategies\n\nWith Long-Term Memory, organization is managed through Namespaces.\n\nAn `actor` refers to entity such as end users or agent/user combinations. For example, in a coding support chatbot,\nthe actor is usually the developer asking questions. Using the actor ID helps the system know which user the memory belongs to,\nkeeping each user's data separate and organized.\n\nA `session` is usually a single conversation or interaction period between the user and the AI agent.\nIt groups all related messages and events that happen during that conversation.\n\nA `namespace` is used to logically group and organize long-term memories. It ensures data stays neat, separate, and secure.\n\nWith AgentCore Memory, you need to add a namespace when you define a memory strategy. This namespace helps define where the long-term memory\nwill be logically grouped. Every time a new long-term memory is extracted using this memory strategy, it is saved under the namespace you set.\nThis means that all long-term memories are scoped to their specific namespace, keeping them organized and preventing any mix-ups with other\nusers or sessions. You should use a hierarchical format separated by forward slashes /. This helps keep memories organized clearly. As needed,\nyou can choose to use the below pre-defined variables within braces in the namespace based on your applications' organization needs:\n\n- `actorId` – Identifies who the long-term memory belongs to, such as a user\n- `memoryStrategyId` – Shows which memory strategy is being used. This strategy identifier is auto-generated when you create a memory using CreateMemory operation.\n- `sessionId` – Identifies which session or conversation the memory is from.\n\nFor example, if you define the following namespace as the input to your strategy in CreateMemory operation:\n\n```shell\n/strategy/{memoryStrategyId}/actor/{actorId}/session/{sessionId}\n```\n\nAfter memory creation, this namespace might look like:\n\n```shell\n/strategy/summarization-93483043//actor/actor-9830m2w3/session/session-9330sds8\n```\n\nYou can customise the namespace, i.e. where the memories are stored by using the following methods:\n\n1. **Summarization Strategy** (`MemoryStrategy.usingSummarization(props)`)\n1. **Semantic Memory Strategy** (`MemoryStrategy.usingSemantic(props)`)\n1. **User Preference Strategy** (`MemoryStrategy.usingUserPreference(props)`)\n\n```typescript fixture=default\n// Create memory with built-in strategies\nconst memory = new agentcore.Memory(this, \"MyMemory\", {\n memoryName: \"my_memory\",\n description: \"Memory with built-in strategies\",\n expirationDuration: cdk.Duration.days(90),\n memoryStrategies: [\n agentcore.MemoryStrategy.usingUserPreference({\n name: \"CustomerPreferences\",\n namespaces: [\"support/customer/{actorId}/preferences\"]\n }),\n agentcore.MemoryStrategy.usingSemantic({\n name: \"CustomerSupportSemantic\",\n namespaces: [\"support/customer/{actorId}/semantic\"]\n }),\n ],\n});\n```\n\nCustom memory strategies let you tailor memory extraction and consolidation to your specific domain or use case.\nYou can override the prompts for extracting and consolidating semantic, summary, or user preferences.\nYou can also choose the model that you want to use for extraction and consolidation.\n\nThe custom prompts you create are appended to a non-editable system prompt.\n\nSince a custom strategy requires you to invoke certain FMs, you need a role with appropriate permissions. For that, you can:\n\n- Let the L2 construct create a minimum permission role for you when use L2 Bedrock Foundation Models.\n- Use a custom role with the overly permissive `AmazonBedrockAgentCoreMemoryBedrockModelInferenceExecutionRolePolicy` managed policy.\n- Use a custom role with your own custom policies.\n\n#### Memory with Custom Execution Role\n\nKeep in mind that memories that **do not** use custom strategies do not require a service role.\nSo even if you provide it, it will be ignored as it will never be used.\n\n```typescript fixture=default\n// Create a custom execution role\nconst executionRole = new iam.Role(this, \"MemoryExecutionRole\", {\n assumedBy: new iam.ServicePrincipal(\"bedrock-agentcore.amazonaws.com\"),\n managedPolicies: [\n iam.ManagedPolicy.fromAwsManagedPolicyName(\n \"AmazonBedrockAgentCoreMemoryBedrockModelInferenceExecutionRolePolicy\"\n ),\n ],\n});\n\n// Create memory with custom execution role\nconst memory = new agentcore.Memory(this, \"MyMemory\", {\n memoryName: \"my_memory\",\n description: \"Memory with custom execution role\",\n expirationDuration: cdk.Duration.days(90),\n executionRole: executionRole,\n});\n```\n\nIn customConsolidation and customExtraction, the model property uses the [@aws-cdk/aws-bedrock-alph](https://www.npmjs.com/package/@aws-cdk/aws-bedrock-alpha) library which must be installed separately.\n\n```typescript fixture=default\n// Create a custom semantic memory strategy\nconst customSemanticStrategy = agentcore.MemoryStrategy.usingSemantic({\n name: \"customSemanticStrategy\",\n description: \"Custom semantic memory strategy\",\n namespaces: [\"/custom/strategies/{memoryStrategyId}/actors/{actorId}\"],\n customConsolidation: {\n model: bedrock.BedrockFoundationModel.ANTHROPIC_CLAUDE_3_5_SONNET_V1_0,\n appendToPrompt: \"Custom consolidation prompt for semantic memory\",\n },\n customExtraction: {\n model: bedrock.BedrockFoundationModel.ANTHROPIC_CLAUDE_3_5_SONNET_V1_0,\n appendToPrompt: \"Custom extraction prompt for semantic memory\",\n },\n});\n\n// Create memory with custom strategy\nconst memory = new agentcore.Memory(this, \"MyMemory\", {\n memoryName: \"my-custom-memory\",\n description: \"Memory with custom strategy\",\n expirationDuration: cdk.Duration.days(90),\n memoryStrategies: [customSemanticStrategy],\n});\n```\n\n### Memory with self-managed Strategies\n\nA self-managed strategy in Amazon Bedrock AgentCore Memory gives you complete control over your memory extraction and consolidation pipelines.\nWith a self-managed strategy, you can build custom memory processing workflows while leveraging Amazon Bedrock AgentCore for storage and retrieval.\n\nFor additional information, you can refer to the [developer guide for self managed strategies](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/memory-self-managed-strategies.html).\n\nCreate the required AWS resources including:\n\n- an S3 bucket in your account where Amazon Bedrock AgentCore will deliver batched event payloads.\n- an SNS topic for job notifications. Use FIFO topics if processing order within sessions is important for your use case.\n\nThe construct will apply the correct permissions to the memory execution role to access these resources.\n\n```typescript fixture=default\n\nconst bucket = new s3.Bucket(this, 'memoryBucket', {\n bucketName: 'test-memory',\n removalPolicy: cdk.RemovalPolicy.DESTROY,\n autoDeleteObjects: true,\n});\n\nconst topic = new sns.Topic(this, 'topic');\n\n// Create a custom semantic memory strategy\nconst selfManagedStrategy = agentcore.MemoryStrategy.usingSelfManaged({\n name: \"selfManagedStrategy\",\n description: \"self managed memory strategy\",\n historicalContextWindowSize: 5,\n invocationConfiguration: {\n topic: topic,\n s3Location: {\n bucketName: bucket.bucketName,\n objectKey: 'memory/',\n }\n },\n triggerConditions: {\n messageBasedTrigger: 1,\n timeBasedTrigger: cdk.Duration.seconds(10),\n tokenBasedTrigger: 100\n }\n});\n\n// Create memory with custom strategy\nconst memory = new agentcore.Memory(this, \"MyMemory\", {\n memoryName: \"my-custom-memory\",\n description: \"Memory with custom strategy\",\n expirationDuration: cdk.Duration.days(90),\n memoryStrategies: [selfManagedStrategy],\n});\n```\n\n### Memory Strategy Methods\n\nYou can add new memory strategies to the memory construct using the `addMemoryStrategy()` method, for instance:\n\n```typescript fixture=default\n// Create memory without initial strategies\nconst memory = new agentcore.Memory(this, \"test-memory\", {\n memoryName: \"test_memory_add_strategy\",\n description: \"A test memory for testing addMemoryStrategy method\",\n expirationDuration: cdk.Duration.days(90),\n});\n\n// Add strategies after instantiation\nmemory.addMemoryStrategy(agentcore.MemoryStrategy.usingBuiltInSummarization());\nmemory.addMemoryStrategy(agentcore.MemoryStrategy.usingBuiltInSemantic());\n```\n"
8527
+ "markdown": "# Amazon Bedrock AgentCore Construct Library\n\n<!--BEGIN STABILITY BANNER-->\n\n---\n\n![cdk-constructs: Experimental](https://img.shields.io/badge/cdk--constructs-experimental-important.svg?style=for-the-badge)\n\n> The APIs of higher level constructs in this module are experimental and under active development.\n> They are subject to non-backward compatible changes or removal in any future version. These are\n> not subject to the [Semantic Versioning](https://semver.org/) model and breaking changes will be\n> announced in the release notes. This means that while you may use them, you may need to update\n> your source code when upgrading to a newer version of this package.\n\n---\n\n<!--END STABILITY BANNER-->\n\n| **Language** | **Package** |\n| :--------------------------------------------------------------------------------------------- | --------------------------------------- |\n| ![Typescript Logo](https://docs.aws.amazon.com/cdk/api/latest/img/typescript32.png) TypeScript | `@aws-cdk/aws-bedrock-agentcore-alpha` |\n\n[Amazon Bedrock AgentCore](https://aws.amazon.com/bedrock/agentcore/) enables you to deploy and operate highly capable AI agents securely, at scale. It offers infrastructure purpose-built for dynamic agent workloads, powerful tools to enhance agents, and essential controls for real-world deployment. AgentCore services can be used together or independently and work with any framework including CrewAI, LangGraph, LlamaIndex, and Strands Agents, as well as any foundation model in or outside of Amazon Bedrock, giving you ultimate flexibility. AgentCore eliminates the undifferentiated heavy lifting of building specialized agent infrastructure, so you can accelerate agents to production.\n\nThis construct library facilitates the deployment of Bedrock AgentCore primitives, enabling you to create sophisticated AI applications that can interact with your systems and data sources.\n\n> **Note:** Users need to ensure their CDK deployment role has the `iam:CreateServiceLinkedRole` permission for AgentCore service-linked roles.\n\n## Table of contents\n\n- [AgentCore Runtime](#agentcore-runtime)\n - [Runtime Versioning](#runtime-versioning)\n - [Runtime Endpoints](#runtime-endpoints)\n - [AgentCore Runtime Properties](#agentcore-runtime-properties)\n - [Runtime Endpoint Properties](#runtime-endpoint-properties)\n - [Creating a Runtime](#creating-a-runtime)\n - [Option 1: Use an existing image in ECR](#option-1-use-an-existing-image-in-ecr)\n - [Managing Endpoints and Versions](#managing-endpoints-and-versions)\n - [Option 2: Use a local asset](#option-2-use-a-local-asset)\n- [Browser Custom tool](#browser)\n - [Browser properties](#browser-properties)\n - [Browser Network modes](#browser-network-modes)\n - [Basic Browser Creation](#basic-browser-creation)\n - [Browser IAM permissions](#browser-iam-permissions)\n- [Code Interpreter Custom tool](#code-interpreter)\n - [Code Interpreter properties](#code-interpreter-properties)\n - [Code Interpreter Network Modes](#code-interpreter-network-modes)\n - [Basic Code Interpreter Creation](#basic-code-interpreter-creation)\n - [Code Interpreter IAM permissions](#code-interpreter-iam-permissions)\n- [Gateway](#gateway)\n - [Gateway Properties](#gateway-properties)\n - [Basic Gateway Creation](#basic-gateway-creation)\n - [Protocol configuration](#protocol-configuration)\n - [Inbound authorization](#inbound-authorization)\n - [Gateway with KMS Encryption](#gateway-with-kms-encryption)\n - [Gateway with Custom Execution Role](#gateway-with-custom-execution-role)\n - [Gateway IAM Permissions](#gateway-iam-permissions)\n- [Gateway Target](#gateway-target)\n - [Gateway Target Properties](#gateway-target-properties)\n - [Targets types](#targets-types)\n - [Outbound auth](#outbound-auth)\n - [Api schema](#api-schema-for-openapi-and-smithy-target)\n - [Basic Gateway Target Creation](#basic-gateway-target-creation)\n - [Using addTarget methods (Recommended)](#using-addtarget-methods-recommended)\n - [Using static factory methods](#using-static-factory-methods)\n - [Lambda Target with Tool Schema](#tools-schema-for-lambda-target)\n - [Smithy Model Target with OAuth](#api-schema-for-openapi-and-smithy-target)\n - [Gateway Target IAM Permissions](#gateway-target-iam-permissions)\n- [Memory](#memory)\n - [Memory properties](#memory-properties)\n - [Basic Memory Creation](#basic-memory-creation)\n - [LTM Memory Extraction Stategies](#ltm-memory-extraction-stategies)\n - [Memory Strategy Methods](#memory-strategy-methods)\n- [Amazon Bedrock AgentCore Construct Library](#amazon-bedrock-agentcore-construct-library)\n - [Table of contents](#table-of-contents)\n - [AgentCore Runtime](#agentcore-runtime)\n - [Runtime Endpoints](#runtime-endpoints)\n - [AgentCore Runtime Properties](#agentcore-runtime-properties)\n - [Runtime Endpoint Properties](#runtime-endpoint-properties)\n - [Creating a Runtime](#creating-a-runtime)\n - [Option 1: Use an existing image in ECR](#option-1-use-an-existing-image-in-ecr)\n - [Option 2: Use a local asset](#option-2-use-a-local-asset)\n - [Option 3: Use direct code deployment](#option-3-use-direct-code-deployment)\n - [Granting Permissions to Invoke Bedrock Models or Inference Profiles](#granting-permissions-to-invoke-bedrock-models-or-inference-profiles)\n - [Runtime Versioning](#runtime-versioning)\n - [Managing Endpoints and Versions](#managing-endpoints-and-versions)\n - [Step 1: Initial Deployment](#step-1-initial-deployment)\n - [Step 2: Creating Custom Endpoints](#step-2-creating-custom-endpoints)\n - [Step 3: Runtime Update Deployment](#step-3-runtime-update-deployment)\n - [Step 4: Testing with Staging Endpoints](#step-4-testing-with-staging-endpoints)\n - [Step 5: Promoting to Production](#step-5-promoting-to-production)\n - [Creating Standalone Runtime Endpoints](#creating-standalone-runtime-endpoints)\n - [Example: Creating an endpoint for an existing runtime](#example-creating-an-endpoint-for-an-existing-runtime)\n - [Runtime Authentication Configuration](#runtime-authentication-configuration)\n - [IAM Authentication (Default)](#iam-authentication-default)\n - [Cognito Authentication](#cognito-authentication)\n - [JWT Authentication](#jwt-authentication)\n - [OAuth Authentication](#oauth-authentication)\n - [Using a Custom IAM Role](#using-a-custom-iam-role)\n - [Runtime Network Configuration](#runtime-network-configuration)\n - [Public Network Mode (Default)](#public-network-mode-default)\n - [VPC Network Mode](#vpc-network-mode)\n - [Managing Security Groups with VPC Configuration](#managing-security-groups-with-vpc-configuration)\n - [Browser](#browser)\n - [Browser Network modes](#browser-network-modes)\n - [Browser Properties](#browser-properties)\n - [Basic Browser Creation](#basic-browser-creation)\n - [Browser with Tags](#browser-with-tags)\n - [Browser with VPC](#browser-with-vpc)\n - [Browser with Recording Configuration](#browser-with-recording-configuration)\n - [Browser with Custom Execution Role](#browser-with-custom-execution-role)\n - [Browser with S3 Recording and Permissions](#browser-with-s3-recording-and-permissions)\n - [Browser IAM Permissions](#browser-iam-permissions)\n - [Code Interpreter](#code-interpreter)\n - [Code Interpreter Network Modes](#code-interpreter-network-modes)\n - [Code Interpreter Properties](#code-interpreter-properties)\n - [Basic Code Interpreter Creation](#basic-code-interpreter-creation)\n - [Code Interpreter with VPC](#code-interpreter-with-vpc)\n - [Code Interpreter with Sandbox Network Mode](#code-interpreter-with-sandbox-network-mode)\n - [Code Interpreter with Custom Execution Role](#code-interpreter-with-custom-execution-role)\n - [Code Interpreter IAM Permissions](#code-interpreter-iam-permissions)\n - [Code interpreter with tags](#code-interpreter-with-tags)\n - [Memory](#memory)\n - [Memory Properties](#memory-properties)\n - [Basic Memory Creation](#basic-memory-creation)\n - [LTM Memory Extraction Stategies](#ltm-memory-extraction-stategies)\n - [Memory with Built-in Strategies](#memory-with-built-in-strategies)\n - [Memory with custom Strategies](#memory-with-custom-strategies)\n - [Memory with Custom Execution Role](#memory-with-custom-execution-role)\n - [Memory with self-managed Strategies](#memory-with-self-managed-strategies)\n - [Memory Strategy Methods](#memory-strategy-methods)\n\n## AgentCore Runtime\n\nThe AgentCore Runtime construct enables you to deploy containerized agents on Amazon Bedrock AgentCore.\nThis L2 construct simplifies runtime creation just pass your ECR repository name\nand the construct handles all the configuration with sensible defaults.\n\n### Runtime Endpoints\n\nEndpoints provide a stable way to invoke specific versions of your agent runtime, enabling controlled deployments across different environments.\nWhen you create an agent runtime, Amazon Bedrock AgentCore automatically creates a \"DEFAULT\" endpoint which always points to the latest version\nof runtime.\n\nYou can create additional endpoints in two ways:\n\n1. **Using Runtime.addEndpoint()** - Convenient method when creating endpoints alongside the runtime.\n2. **Using RuntimeEndpoint** - Flexible approach for existing runtimes.\n\nFor example, you might keep a \"production\" endpoint on a stable version while testing newer versions\nthrough a \"staging\" endpoint. This separation allows you to test changes thoroughly before promoting them\nto production by simply updating the endpoint to point to the newer version.\n\n### AgentCore Runtime Properties\n\n| Name | Type | Required | Description |\n|------|------|----------|-------------|\n| `runtimeName` | `string` | Yes | The name of the agent runtime. Valid characters are a-z, A-Z, 0-9, _ (underscore). Must start with a letter and can be up to 48 characters long |\n| `agentRuntimeArtifact` | `AgentRuntimeArtifact` | Yes | The artifact configuration for the agent runtime containing the container configuration with ECR URI |\n| `executionRole` | `iam.IRole` | No | The IAM role that provides permissions for the agent runtime. If not provided, a role will be created automatically |\n| `networkConfiguration` | `NetworkConfiguration` | No | Network configuration for the agent runtime. Defaults to `RuntimeNetworkConfiguration.usingPublicNetwork()` |\n| `description` | `string` | No | Optional description for the agent runtime |\n| `protocolConfiguration` | `ProtocolType` | No | Protocol configuration for the agent runtime. Defaults to `ProtocolType.HTTP` |\n| `authorizerConfiguration` | `RuntimeAuthorizerConfiguration` | No | Authorizer configuration for the agent runtime. Use `RuntimeAuthorizerConfiguration` static methods to create configurations for IAM, Cognito, JWT, or OAuth authentication |\n| `environmentVariables` | `{ [key: string]: string }` | No | Environment variables for the agent runtime. Maximum 50 environment variables |\n| `tags` | `{ [key: string]: string }` | No | Tags for the agent runtime. A list of key:value pairs of tags to apply to this Runtime resource |\n| `lifecycleConfiguration` | LifecycleConfiguration | No | The life cycle configuration for the AgentCore Runtime. Defaults to 900 seconds (15 minutes) for idle, 28800 seconds (8 hours) for max life time |\n| `requestHeaderConfiguration` | RequestHeaderConfiguration | No | Configuration for HTTP request headers that will be passed through to the runtime. Defaults to no configuration |\n\n### Runtime Endpoint Properties\n\n| Name | Type | Required | Description |\n|------|------|----------|-------------|\n| `endpointName` | `string` | Yes | The name of the runtime endpoint. Valid characters are a-z, A-Z, 0-9, _ (underscore). Must start with a letter and can be up to 48 characters long |\n| `agentRuntimeId` | `string` | Yes | The Agent Runtime ID for this endpoint |\n| `agentRuntimeVersion` | `string` | Yes | The Agent Runtime version for this endpoint. Must be between 1 and 5 characters long.|\n| `description` | `string` | No | Optional description for the runtime endpoint |\n| `tags` | `{ [key: string]: string }` | No | Tags for the runtime endpoint |\n\n### Creating a Runtime\n\n#### Option 1: Use an existing image in ECR\n\nReference an image available within ECR.\n\n```typescript fixture=default\nconst repository = new ecr.Repository(this, \"TestRepository\", {\n repositoryName: \"test-agent-runtime\",\n});\n\n// The runtime by default create ECR permission only for the repository available in the account the stack is being deployed\nconst agentRuntimeArtifact = agentcore.AgentRuntimeArtifact.fromEcrRepository(repository, \"v1.0.0\");\n\n// Create runtime using the built image\nconst runtime = new agentcore.Runtime(this, \"MyAgentRuntime\", {\n runtimeName: \"myAgent\",\n agentRuntimeArtifact: agentRuntimeArtifact\n});\n```\n\n#### Option 2: Use a local asset\n\nReference a local directory containing a Dockerfile.\nImages are built from a local Docker context directory (with a Dockerfile), uploaded to Amazon Elastic Container Registry (ECR)\nby the CDK toolkit,and can be naturally referenced in your CDK app.\n\n```typescript fixture=default\nconst agentRuntimeArtifact = agentcore.AgentRuntimeArtifact.fromAsset(\n path.join(__dirname, \"path to agent dockerfile directory\")\n);\n\nconst runtime = new agentcore.Runtime(this, \"MyAgentRuntime\", {\n runtimeName: \"myAgent\",\n agentRuntimeArtifact: agentRuntimeArtifact,\n});\n```\n\n#### Option 3: Use direct code deployment\n\nWith the container deployment method, developers create a Dockerfile, build ARM-compatible containers, manage ECR repositories, and upload containers for code changes. This works well where container DevOps pipelines have already been established to automate deployments.\n\nHowever, customers looking for fully managed deployments can benefit from direct code deployment, which can significantly improve developer time and productivity. Direct code deployment provides a secure and scalable path forward for rapid prototyping agent capabilities to deploying production workloads at scale.\n\nWith direct code deployment, developers create a zip archive of code and dependencies, upload to Amazon S3, and configure the bucket in the agent configuration. A ZIP archive containing Linux arm64 dependencies needs to be uploaded to S3 as a pre-requisite to Create Agent Runtime.\n\nFor more information, please refer to the [documentation](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/runtime-get-started-code-deploy.html).\n\n```typescript fixture=default\n// S3 bucket containing the agent core\nconst codeBucket = new s3.Bucket(this, \"AgentCode\", {\n bucketName: \"my-code-bucket\",\n removalPolicy: RemovalPolicy.DESTROY, // For demo purposes\n});\n\n// the bucket above needs to contain the agent code\n\nconst agentRuntimeArtifact = agentcore.AgentRuntimeArtifact.fromS3(\n {\n bucketName: codeBucket.bucketName,\n objectKey: 'deployment_package.zip',\n },\n agentcore.AgentCoreRuntime.PYTHON_3_12,\n ['opentelemetry-instrument', 'main.py']\n);\n\nconst runtimeInstance = new agentcore.Runtime(this, \"MyAgentRuntime\", {\n runtimeName: \"myAgent\",\n agentRuntimeArtifact: agentRuntimeArtifact,\n});\n```\n\n#### Option 4: Use an ECR container image URI\n\nReference an ECR container image directly by its URI. This is useful when you have a pre-existing ECR image URI from CloudFormation parameters or cross-stack references. No IAM permissions are automatically granted - you must ensure the runtime has ECR pull permissions.\n\n```typescript fixture=default\n// Direct URI reference\nconst agentRuntimeArtifact = agentcore.AgentRuntimeArtifact.fromImageUri(\n \"123456789012.dkr.ecr.us-east-1.amazonaws.com/my-agent:v1.0.0\"\n);\n\nconst runtime = new agentcore.Runtime(this, \"MyAgentRuntime\", {\n runtimeName: \"myAgent\",\n agentRuntimeArtifact: agentRuntimeArtifact,\n});\n```\n\nYou can also use CloudFormation parameters or references:\n\n```typescript fixture=default\n// Using a CloudFormation parameter\nconst imageUriParam = new cdk.CfnParameter(this, \"ImageUri\", {\n type: \"String\",\n description: \"Container image URI for the agent runtime\",\n});\n\nconst agentRuntimeArtifact = agentcore.AgentRuntimeArtifact.fromImageUri(\n imageUriParam.valueAsString\n);\n\nconst runtime = new agentcore.Runtime(this, \"MyAgentRuntime\", {\n runtimeName: \"myAgent\",\n agentRuntimeArtifact: agentRuntimeArtifact,\n});\n```\n\n### Granting Permissions to Invoke Bedrock Models or Inference Profiles\n\nTo grant the runtime permissions to invoke Bedrock models or inference profiles:\n\n```typescript fixture=default\n// Note: This example uses @aws-cdk/aws-bedrock-alpha which must be installed separately\ndeclare const runtime: agentcore.Runtime;\n\n// Define the Bedrock Foundation Model\nconst model = bedrock.BedrockFoundationModel.ANTHROPIC_CLAUDE_3_7_SONNET_V1_0;\n\n// Grant the runtime permissions to invoke the model\nmodel.grantInvoke(runtime);\n\n// Create a cross-region inference profile for Claude 3.7 Sonnet\nconst inferenceProfile = bedrock.CrossRegionInferenceProfile.fromConfig({\n geoRegion: bedrock.CrossRegionInferenceProfileRegion.US,\n model: bedrock.BedrockFoundationModel.ANTHROPIC_CLAUDE_3_7_SONNET_V1_0\n});\n\n// Grant the runtime permissions to invoke the inference profile\ninferenceProfile.grantInvoke(runtime);\n```\n\n### Runtime Versioning\n\nAmazon Bedrock AgentCore automatically manages runtime versioning to ensure safe deployments and rollback capabilities.\nWhen you create an agent runtime, AgentCore automatically creates version 1 (V1). Each subsequent update to the\nruntime configuration (such as updating the container image, modifying network settings, or changing protocol configurations)\ncreates a new immutable version. These versions contain complete, self-contained configurations that can be referenced by endpoints,\nallowing you to maintain different versions for different environments or gradually roll out updates.\n\n#### Managing Endpoints and Versions\n\nAmazon Bedrock AgentCore automatically manages runtime versioning to provide safe deployments and rollback capabilities. You can follow\nthe steps below to understand how to use versioning with runtime for controlled deployments across different environments.\n\n##### Step 1: Initial Deployment\n\nWhen you first create an agent runtime, AgentCore automatically creates Version 1 of your runtime. At this point, a DEFAULT endpoint is\nautomatically created that points to Version 1. This DEFAULT endpoint serves as the main access point for your runtime.\n\n```typescript fixture=default\nconst repository = new ecr.Repository(this, \"TestRepository\", {\n repositoryName: \"test-agent-runtime\",\n});\n\nconst runtime = new agentcore.Runtime(this, \"MyAgentRuntime\", {\n runtimeName: \"myAgent\",\n agentRuntimeArtifact: agentcore.AgentRuntimeArtifact.fromEcrRepository(repository, \"v1.0.0\"),\n});\n```\n\n##### Step 2: Creating Custom Endpoints\n\nAfter the initial deployment, you can create additional endpoints for different environments. For example, you might create a \"production\"\nendpoint that explicitly points to Version 1. This allows you to maintain stable access points for specific environments while keeping the\nflexibility to test newer versions elsewhere.\n\n```typescript fixture=default\nconst repository = new ecr.Repository(this, \"TestRepository\", {\n repositoryName: \"test-agent-runtime\",\n});\n\nconst runtime = new agentcore.Runtime(this, \"MyAgentRuntime\", {\n runtimeName: \"myAgent\",\n agentRuntimeArtifact: agentcore.AgentRuntimeArtifact.fromEcrRepository(repository, \"v1.0.0\"),\n});\n\nconst prodEndpoint = runtime.addEndpoint(\"production\", {\n version: \"1\",\n description: \"Stable production endpoint - pinned to v1\"\n});\n```\n\n##### Step 3: Runtime Update Deployment\n\nWhen you update the runtime configuration (such as updating the container image, modifying network settings, or changing protocol\nconfigurations), AgentCore automatically creates a new version (Version 2). Upon this update:\n\n- Version 2 is created automatically with the new configuration\n- The DEFAULT endpoint automatically updates to point to Version 2\n- Any explicitly pinned endpoints (like the production endpoint) remain on their specified versions\n\n```typescript fixture=default\nconst repository = new ecr.Repository(this, \"TestRepository\", {\n repositoryName: \"test-agent-runtime\",\n});\n\nconst agentRuntimeArtifactNew = agentcore.AgentRuntimeArtifact.fromEcrRepository(repository, \"v2.0.0\");\n\nconst runtime = new agentcore.Runtime(this, \"MyAgentRuntime\", {\n runtimeName: \"myAgent\",\n agentRuntimeArtifact: agentRuntimeArtifactNew,\n});\n```\n\n##### Step 4: Testing with Staging Endpoints\n\nOnce Version 2 exists, you can create a staging endpoint that points to the new version. This staging endpoint allows you to test the\nnew version in a controlled environment before promoting it to production. This separation ensures that production traffic continues\nto use the stable version while you validate the new version.\n\n```typescript fixture=default\nconst repository = new ecr.Repository(this, \"TestRepository\", {\n repositoryName: \"test-agent-runtime\",\n});\n\nconst agentRuntimeArtifactNew = agentcore.AgentRuntimeArtifact.fromEcrRepository(repository, \"v2.0.0\");\n\nconst runtime = new agentcore.Runtime(this, \"MyAgentRuntime\", {\n runtimeName: \"myAgent\",\n agentRuntimeArtifact: agentRuntimeArtifactNew,\n});\n\nconst stagingEndpoint = runtime.addEndpoint(\"staging\", {\n version: \"2\",\n description: \"Staging environment for testing new version\"\n});\n```\n\n##### Step 5: Promoting to Production\n\nAfter thoroughly testing the new version through the staging endpoint, you can update the production endpoint to point to Version 2.\nThis controlled promotion process ensures that you can validate changes before they affect production traffic.\n\n```typescript fixture=default\nconst repository = new ecr.Repository(this, \"TestRepository\", {\n repositoryName: \"test-agent-runtime\",\n});\n\nconst agentRuntimeArtifactNew = agentcore.AgentRuntimeArtifact.fromEcrRepository(repository, \"v2.0.0\");\n\nconst runtime = new agentcore.Runtime(this, \"MyAgentRuntime\", {\n runtimeName: \"myAgent\",\n agentRuntimeArtifact: agentRuntimeArtifactNew,\n});\n\nconst prodEndpoint = runtime.addEndpoint(\"production\", {\n version: \"2\", // New version added here\n description: \"Stable production endpoint\"\n});\n```\n\n### Creating Standalone Runtime Endpoints\n\nRuntimeEndpoint can also be created as a standalone resource.\n\n#### Example: Creating an endpoint for an existing runtime\n\n```typescript fixture=default\n// Reference an existing runtime by its ID\nconst existingRuntimeId = \"abc123-runtime-id\"; // The ID of an existing runtime\n\n// Create a standalone endpoint\nconst endpoint = new agentcore.RuntimeEndpoint(this, \"MyEndpoint\", {\n endpointName: \"production\",\n agentRuntimeId: existingRuntimeId,\n agentRuntimeVersion: \"1\", // Specify which version to use\n description: \"Production endpoint for existing runtime\"\n});\n```\n\n### Runtime Authentication Configuration\n\nThe AgentCore Runtime supports multiple authentication modes to secure access to your agent endpoints. Authentication is configured during runtime creation using the `RuntimeAuthorizerConfiguration` class's static factory methods.\n\n#### IAM Authentication (Default)\n\nIAM authentication is the default mode, when no authorizerConfiguration is set then the underlying service use IAM.\n\n#### Cognito Authentication\n\nTo configure AWS Cognito User Pool authentication:\n\n```typescript fixture=default\ndeclare const userPool: cognito.UserPool;\ndeclare const userPoolClient: cognito.UserPoolClient;\ndeclare const anotherUserPoolClient: cognito.UserPoolClient;\n\nconst repository = new ecr.Repository(this, \"TestRepository\", {\n repositoryName: \"test-agent-runtime\",\n});\nconst agentRuntimeArtifact = agentcore.AgentRuntimeArtifact.fromEcrRepository(repository, \"v1.0.0\");\n\nconst runtime = new agentcore.Runtime(this, \"MyAgentRuntime\", {\n runtimeName: \"myAgent\",\n agentRuntimeArtifact: agentRuntimeArtifact,\n authorizerConfiguration: agentcore.RuntimeAuthorizerConfiguration.usingCognito(\n userPool, // User Pool (required)\n [userPoolClient, anotherUserPoolClient], // User Pool Clients\n ),\n});\n```\n\n#### JWT Authentication\n\nTo configure custom JWT authentication with your own OpenID Connect (OIDC) provider:\n\n```typescript fixture=default\nconst repository = new ecr.Repository(this, \"TestRepository\", {\n repositoryName: \"test-agent-runtime\",\n});\nconst agentRuntimeArtifact = agentcore.AgentRuntimeArtifact.fromEcrRepository(repository, \"v1.0.0\");\n\nconst runtime = new agentcore.Runtime(this, \"MyAgentRuntime\", {\n runtimeName: \"myAgent\",\n agentRuntimeArtifact: agentRuntimeArtifact,\n authorizerConfiguration: agentcore.RuntimeAuthorizerConfiguration.usingJWT(\n \"https://example.com/.well-known/openid-configuration\", // Discovery URL (required)\n [\"client1\", \"client2\"], // Allowed Client IDs (optional)\n [\"audience1\"] // Allowed Audiences (optional)\n ),\n});\n```\n\n**Note**: The discovery URL must end with `/.well-known/openid-configuration`.\n\n#### OAuth Authentication\n\nTo configure OAuth 2.0 authentication:\n\n```typescript fixture=default\nconst repository = new ecr.Repository(this, \"TestRepository\", {\n repositoryName: \"test-agent-runtime\",\n});\nconst agentRuntimeArtifact = agentcore.AgentRuntimeArtifact.fromEcrRepository(repository, \"v1.0.0\");\n\nconst runtime = new agentcore.Runtime(this, \"MyAgentRuntime\", {\n runtimeName: \"myAgent\",\n agentRuntimeArtifact: agentRuntimeArtifact,\n authorizerConfiguration: agentcore.RuntimeAuthorizerConfiguration.usingOAuth(\n \"https://github.com/.well-known/openid-configuration\",\n \"oauth_client_123\",\n ),\n});\n```\n\n#### Using a Custom IAM Role\n\nInstead of using the auto-created execution role, you can provide your own IAM role with specific permissions:\nThe auto-created role includes all necessary baseline permissions for ECR access, CloudWatch logging, and X-Ray tracing. When providing a custom role, ensure these permissions are included.\n\n### Runtime Network Configuration\n\nThe AgentCore Runtime supports two network modes for deployment:\n\n#### Public Network Mode (Default)\n\nBy default, runtimes are deployed in PUBLIC network mode, which provides internet access suitable for less sensitive or open-use scenarios:\n\n```typescript fixture=default\nconst repository = new ecr.Repository(this, \"TestRepository\", {\n repositoryName: \"test-agent-runtime\",\n});\nconst agentRuntimeArtifact = agentcore.AgentRuntimeArtifact.fromEcrRepository(repository, \"v1.0.0\");\n\n// Explicitly using public network (this is the default)\nconst runtime = new agentcore.Runtime(this, \"MyAgentRuntime\", {\n runtimeName: \"myAgent\",\n agentRuntimeArtifact: agentRuntimeArtifact,\n networkConfiguration: agentcore.RuntimeNetworkConfiguration.usingPublicNetwork(),\n});\n```\n\n#### VPC Network Mode\n\nFor enhanced security and network isolation, you can deploy your runtime within a VPC:\n\n```typescript fixture=default\nconst repository = new ecr.Repository(this, \"TestRepository\", {\n repositoryName: \"test-agent-runtime\",\n});\nconst agentRuntimeArtifact = agentcore.AgentRuntimeArtifact.fromEcrRepository(repository, \"v1.0.0\");\n\n// Create or use an existing VPC\nconst vpc = new ec2.Vpc(this, 'MyVpc', {\n maxAzs: 2,\n});\n\n// Configure runtime with VPC\nconst runtime = new agentcore.Runtime(this, \"MyAgentRuntime\", {\n runtimeName: \"myAgent\",\n agentRuntimeArtifact: agentRuntimeArtifact,\n networkConfiguration: agentcore.RuntimeNetworkConfiguration.usingVpc(this, {\n vpc: vpc,\n vpcSubnets: { subnetType: ec2.SubnetType.PRIVATE_WITH_EGRESS },\n // Optionally specify security groups, or one will be created automatically\n // securityGroups: [mySecurityGroup],\n }),\n});\n\n```\n\n#### Managing Security Groups with VPC Configuration\n\nWhen using VPC mode, the Runtime implements `ec2.IConnectable`, allowing you to manage network access using the `connections` property:\n\n```typescript fixture=default\nconst vpc = new ec2.Vpc(this, 'MyVpc', {\n maxAzs: 2,\n});\n\nconst repository = new ecr.Repository(this, \"TestRepository\", {\n repositoryName: \"test-agent-runtime\",\n});\nconst agentRuntimeArtifact = agentcore.AgentRuntimeArtifact.fromEcrRepository(repository, \"v1.0.0\");\n\n// Create runtime with VPC configuration\nconst runtime = new agentcore.Runtime(this, \"MyAgentRuntime\", {\n runtimeName: \"myAgent\",\n agentRuntimeArtifact: agentRuntimeArtifact,\n networkConfiguration: agentcore.RuntimeNetworkConfiguration.usingVpc(this, {\n vpc: vpc,\n vpcSubnets: { subnetType: ec2.SubnetType.PRIVATE_WITH_EGRESS },\n }),\n});\n\n// Now you can manage network access using the connections property\n// Allow inbound HTTPS traffic from a specific security group\nconst webServerSecurityGroup = new ec2.SecurityGroup(this, 'WebServerSG', { vpc });\nruntime.connections.allowFrom(webServerSecurityGroup, ec2.Port.tcp(443), 'Allow HTTPS from web servers');\n\n// Allow outbound connections to a database\nconst databaseSecurityGroup = new ec2.SecurityGroup(this, 'DatabaseSG', { vpc });\nruntime.connections.allowTo(databaseSecurityGroup, ec2.Port.tcp(5432), 'Allow PostgreSQL connection');\n\n// Allow outbound HTTPS to anywhere (for external API calls)\nruntime.connections.allowToAnyIpv4(ec2.Port.tcp(443), 'Allow HTTPS outbound');\n```\n\n### Runtime IAM Permissions\n\nThe Runtime construct provides convenient methods for granting IAM permissions to principals that need to invoke the runtime or manage its execution role.\n\n```typescript fixture=default\nconst repository = new ecr.Repository(this, \"TestRepository\", {\n repositoryName: \"test-agent-runtime\",\n});\nconst agentRuntimeArtifact = agentcore.AgentRuntimeArtifact.fromEcrRepository(repository, \"v1.0.0\");\n\n// Create a runtime\nconst runtime = new agentcore.Runtime(this, \"MyRuntime\", {\n runtimeName: \"my_runtime\",\n agentRuntimeArtifact: agentRuntimeArtifact,\n});\n\n// Create a Lambda function that needs to invoke the runtime\nconst invokerFunction = new lambda.Function(this, \"InvokerFunction\", {\n runtime: lambda.Runtime.PYTHON_3_12,\n handler: \"index.handler\",\n code: lambda.Code.fromInline(`\nimport boto3\ndef handler(event, context):\n client = boto3.client('bedrock-agentcore')\n # Invoke the runtime...\n `),\n});\n\n// Grant permission to invoke the runtime directly\nruntime.grantInvokeRuntime(invokerFunction);\n\n// Grant permission to invoke the runtime on behalf of a user\n// (requires X-Amzn-Bedrock-AgentCore-Runtime-User-Id header)\nruntime.grantInvokeRuntimeForUser(invokerFunction);\n\n// Grant both invoke permissions (most common use case)\nruntime.grantInvoke(invokerFunction);\n\n// Grant specific custom permissions to the runtime's execution role\nruntime.grant(['bedrock:InvokeModel'], ['arn:aws:bedrock:*:*:*']);\n\n// Add a policy statement to the runtime's execution role\nruntime.addToRolePolicy(new iam.PolicyStatement({\n actions: ['s3:GetObject'],\n resources: ['arn:aws:s3:::my-bucket/*'],\n}));\n```\n\n### Other configuration\n\n#### Lifecycle configuration\n\nThe LifecycleConfiguration input parameter to CreateAgentRuntime lets you manage the lifecycle of runtime sessions and resources in Amazon Bedrock AgentCore Runtime. This configuration helps optimize resource utilization by automatically cleaning up idle sessions and preventing long-running instances from consuming resources indefinitely.\n\nYou can configure:\n\n- idleRuntimeSessionTimeout: Timeout in seconds for idle runtime sessions. When a session remains idle for this duration, it will trigger termination. Termination can last up to 15 seconds due to logging and other process completion. Default: 900 seconds (15 minutes)\n- maxLifetime: Maximum lifetime for the instance in seconds. Once reached, instances will initialize termination. Termination can last up to 15 seconds due to logging and other process completion. Default: 28800 seconds (8 hours)\n\nFor additional information, please refer to the [documentation](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/runtime-lifecycle-settings.html).\n\n```typescript fixture=default\nconst repository = new ecr.Repository(this, \"TestRepository\", {\n repositoryName: \"test-agent-runtime\",\n});\n\nconst agentRuntimeArtifact = agentcore.AgentRuntimeArtifact.fromEcrRepository(repository, \"v1.0.0\");\n\nnew agentcore.Runtime(this, 'test-runtime', {\n runtimeName: 'test_runtime',\n agentRuntimeArtifact: agentRuntimeArtifact,\n lifecycleConfiguration: {\n idleRuntimeSessionTimeout: Duration.minutes(10),\n maxLifetime: Duration.hours(4),\n },\n});\n```\n\n#### Request header configuration\n\nCustom headers let you pass contextual information from your application directly to your agent code without cluttering the main request payload. This includes authentication tokens like JWT (JSON Web Tokens, which contain user identity and authorization claims) through the Authorization header, allowing your agent to make decisions based on who is calling it. You can also pass custom metadata like user preferences, session identifiers, or trace context using headers prefixed with X-Amzn-Bedrock-AgentCore-Runtime-Custom-, giving your agent access to up to 20 pieces of runtime context that travel alongside each request. This information can be also used in downstream systems like AgentCore Memory that you can namespace based on those characteristics like user_id or aud in claims like line of business.\n\nFor additional information, please refer to the [documentation](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/runtime-header-allowlist.html).\n\n```typescript fixture=default\nconst repository = new ecr.Repository(this, \"TestRepository\", {\n repositoryName: \"test-agent-runtime\",\n});\n\nconst agentRuntimeArtifact = agentcore.AgentRuntimeArtifact.fromEcrRepository(repository, \"v1.0.0\");\n\nnew agentcore.Runtime(this, 'test-runtime', {\n runtimeName: 'test_runtime',\n agentRuntimeArtifact: agentRuntimeArtifact,\n requestHeaderConfiguration: {\n allowlistedHeaders: ['X-Amzn-Bedrock-AgentCore-Runtime-Custom-H1'],\n },\n});\n```\n\n## Browser\n\nThe Amazon Bedrock AgentCore Browser provides a secure, cloud-based browser that enables AI agents to interact with websites. It includes security features such as session isolation, built-in observability through live viewing, CloudTrail logging, and session replay capabilities.\n\nAdditional information about the browser tool can be found in the [official documentation](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/browser-tool.html)\n\n### Browser Network modes\n\nThe Browser construct supports the following network modes:\n\n1. **Public Network Mode** (`BrowserNetworkMode.usingPublicNetwork()`) - Default\n\n - Allows internet access for web browsing and external API calls\n - Suitable for scenarios where agents need to interact with publicly available websites\n - Enables full web browsing capabilities\n - VPC mode is not supported with this option\n\n2. **VPC (Virtual Private Cloud)** (`BrowserNetworkMode.usingVpc()`)\n\n - Select whether to run the browser in a virtual private cloud (VPC).\n - By configuring VPC connectivity, you enable secure access to private resources such as databases, internal APIs, and services within your VPC.\n\n While the VPC itself is mandatory, these are optional:\n - Subnets - if not provided, CDK will select appropriate subnets from the VPC\n - Security Groups - if not provided, CDK will create a default security group\n - Specific subnet selection criteria - you can let CDK choose automatically\n\nFor more information on VPC connectivity for Amazon Bedrock AgentCore Browser, please refer to the [official documentation](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/agentcore-vpc.html).\n\n### Browser Properties\n\n| Name | Type | Required | Description |\n|------|------|----------|-------------|\n| `browserCustomName` | `string` | Yes | The name of the browser. Must start with a letter and can be up to 48 characters long. Pattern: `[a-zA-Z][a-zA-Z0-9_]{0,47}` |\n| `description` | `string` | No | Optional description for the browser. Can have up to 200 characters |\n| `networkConfiguration` | `BrowserNetworkConfiguration` | No | Network configuration for browser. Defaults to PUBLIC network mode |\n| `recordingConfig` | `RecordingConfig` | No | Recording configuration for browser. Defaults to no recording |\n| `executionRole` | `iam.IRole` | No | The IAM role that provides permissions for the browser to access AWS services. A new role will be created if not provided |\n| `tags` | `{ [key: string]: string }` | No | Tags to apply to the browser resource |\n| `browserSigning` | BrowserSigning | No | Browser signing configuration. Defaults to DISABLED |\n\n### Basic Browser Creation\n\n```typescript fixture=default\n// Create a basic browser with public network access\nconst browser = new agentcore.BrowserCustom(this, \"MyBrowser\", {\n browserCustomName: \"my_browser\",\n description: \"A browser for web automation\",\n});\n```\n\n### Browser with Tags\n\n```typescript fixture=default\n// Create a browser with custom tags\nconst browser = new agentcore.BrowserCustom(this, \"MyBrowser\", {\n browserCustomName: \"my_browser\",\n description: \"A browser for web automation with tags\",\n networkConfiguration: agentcore.BrowserNetworkConfiguration.usingPublicNetwork(),\n tags: {\n Environment: \"Production\",\n Team: \"AI/ML\",\n Project: \"AgentCore\",\n },\n});\n```\n\n### Browser with VPC\n\n```typescript fixture=default\nconst browser = new agentcore.BrowserCustom(this, 'BrowserVpcWithRecording', {\n browserCustomName: 'browser_recording',\n networkConfiguration: agentcore.BrowserNetworkConfiguration.usingVpc(this, {\n vpc: new ec2.Vpc(this, 'VPC', { restrictDefaultSecurityGroup: false }),\n }),\n});\n```\n\nBrowser exposes a [connections](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.Connections.html) property. This property returns a connections object, which simplifies the process of defining and managing ingress and egress rules for security groups in your AWS CDK applications. Instead of directly manipulating security group rules, you interact with the Connections object of a construct, which then translates your connectivity requirements into the appropriate security group rules. For instance:\n\n```typescript fixture=default\nconst vpc = new ec2.Vpc(this, 'testVPC');\n\nconst browser = new agentcore.BrowserCustom(this, 'test-browser', {\n browserCustomName: 'test_browser',\n networkConfiguration: agentcore.BrowserNetworkConfiguration.usingVpc(this, {\n vpc: vpc,\n }),\n});\n\nbrowser.connections.addSecurityGroup(new ec2.SecurityGroup(this, 'AdditionalGroup', { vpc }));\n```\n\nSo security groups can be added after the browser construct creation. You can use methods like allowFrom() and allowTo() to grant ingress access to/egress access from a specified peer over a given portRange. The Connections object automatically adds the necessary ingress or egress rules to the security group(s) associated with the calling construct.\n\n### Browser with Recording Configuration\n\n```typescript fixture=default\n// Create an S3 bucket for recordings\nconst recordingBucket = new s3.Bucket(this, \"RecordingBucket\", {\n bucketName: \"my-browser-recordings\",\n removalPolicy: RemovalPolicy.DESTROY, // For demo purposes\n});\n\n// Create browser with recording enabled\nconst browser = new agentcore.BrowserCustom(this, \"MyBrowser\", {\n browserCustomName: \"my_browser\",\n description: \"Browser with recording enabled\",\n networkConfiguration: agentcore.BrowserNetworkConfiguration.usingPublicNetwork(),\n recordingConfig: {\n enabled: true,\n s3Location: {\n bucketName: recordingBucket.bucketName,\n objectKey: \"browser-recordings/\",\n },\n },\n});\n```\n\n### Browser with Custom Execution Role\n\n```typescript fixture=default\n// Create a custom execution role\nconst executionRole = new iam.Role(this, \"BrowserExecutionRole\", {\n assumedBy: new iam.ServicePrincipal(\"bedrock-agentcore.amazonaws.com\"),\n managedPolicies: [\n iam.ManagedPolicy.fromAwsManagedPolicyName(\"AmazonBedrockAgentCoreBrowserExecutionRolePolicy\"),\n ],\n});\n\n// Create browser with custom execution role\nconst browser = new agentcore.BrowserCustom(this, \"MyBrowser\", {\n browserCustomName: \"my_browser\",\n description: \"Browser with custom execution role\",\n networkConfiguration: agentcore.BrowserNetworkConfiguration.usingPublicNetwork(),\n executionRole: executionRole,\n});\n```\n\n### Browser with S3 Recording and Permissions\n\n```typescript fixture=default\n// Create an S3 bucket for recordings\nconst recordingBucket = new s3.Bucket(this, \"RecordingBucket\", {\n bucketName: \"my-browser-recordings\",\n removalPolicy: RemovalPolicy.DESTROY, // For demo purposes\n});\n\n// Create browser with recording enabled\nconst browser = new agentcore.BrowserCustom(this, \"MyBrowser\", {\n browserCustomName: \"my_browser\",\n description: \"Browser with recording enabled\",\n networkConfiguration: agentcore.BrowserNetworkConfiguration.usingPublicNetwork(),\n recordingConfig: {\n enabled: true,\n s3Location: {\n bucketName: recordingBucket.bucketName,\n objectKey: \"browser-recordings/\",\n },\n },\n});\n\n// The browser construct automatically grants S3 permissions to the execution role\n// when recording is enabled, so no additional IAM configuration is needed\n```\n\n### Browser with Browser signing\n\nAI agents need to browse the web on your behalf. When your agent visits a website to gather information, complete a form, or verify data, it encounters the same defenses designed to stop unwanted bots: CAPTCHAs, rate limits, and outright blocks.\n\nAmazon Bedrock AgentCore Browser supports Web Bot Auth. Web Bot Auth is a draft IETF protocol that gives agents verifiable cryptographic identities. When you enable Web Bot Auth in AgentCore Browser, the service issues cryptographic credentials that websites can verify. The agent presents these credentials with every request. The WAF may now additionally check the signature, confirm it matches a trusted directory, and allow the request through if verified bots are allowed by the domain owner and other WAF checks are clear.\n\nTo enable the browser to sign requests using the Web Bot Auth protocol, create a browser tool with the browserSigning configuration:\n\n```typescript fixture=default\nconst browser = new agentcore.BrowserCustom(this, 'test-browser', {\n browserCustomName: 'test_browser',\n browserSigning: agentcore.BrowserSigning.ENABLED\n});\n```\n\n### Browser IAM Permissions\n\nThe Browser construct provides convenient methods for granting IAM permissions:\n\n```typescript fixture=default\n// Create a browser\nconst browser = new agentcore.BrowserCustom(this, \"MyBrowser\", {\n browserCustomName: \"my_browser\",\n description: \"Browser for web automation\",\n networkConfiguration: agentcore.BrowserNetworkConfiguration.usingPublicNetwork(),\n});\n\n// Create a role that needs access to the browser\nconst userRole = new iam.Role(this, \"UserRole\", {\n assumedBy: new iam.ServicePrincipal(\"lambda.amazonaws.com\"),\n});\n\n// Grant read permissions (Get and List actions)\nbrowser.grantRead(userRole);\n\n// Grant use permissions (Start, Update, Stop actions)\nbrowser.grantUse(userRole);\n\n// Grant specific custom permissions\nbrowser.grant(userRole, \"bedrock-agentcore:GetBrowserSession\");\n```\n\n## Code Interpreter\n\nThe Amazon Bedrock AgentCore Code Interpreter enables AI agents to write and execute code securely in sandbox environments, enhancing their accuracy and expanding their ability to solve complex end-to-end tasks. This is critical in Agentic AI applications where the agents may execute arbitrary code that can lead to data compromise or security risks. The AgentCore Code Interpreter tool provides secure code execution, which helps you avoid running into these issues.\n\nFor more information about code interpreter, please refer to the [official documentation](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/code-interpreter-tool.html)\n\n### Code Interpreter Network Modes\n\nThe Code Interpreter construct supports the following network modes:\n\n1. **Public Network Mode** (`CodeInterpreterNetworkMode.usingPublicNetwork()`) - Default\n\n - Allows internet access for package installation and external API calls\n - Suitable for development and testing environments\n - Enables downloading Python packages from PyPI\n\n2. **Sandbox Network Mode** (`CodeInterpreterNetworkMode.usingSandboxNetwork()`)\n - Isolated network environment with no internet access\n - Suitable for production environments with strict security requirements\n - Only allows access to pre-installed packages and local resources\n\n3. **VPC (Virtual Private Cloud)** (`CodeInterpreterNetworkMode.usingVpc()`)\n - Select whether to run the browser in a virtual private cloud (VPC).\n - By configuring VPC connectivity, you enable secure access to private resources such as databases, internal APIs, and services within your VPC.\n\n While the VPC itself is mandatory, these are optional:\n - Subnets - if not provided, CDK will select appropriate subnets from the VPC\n - Security Groups - if not provided, CDK will create a default security group\n - Specific subnet selection criteria - you can let CDK choose automatically\n\nFor more information on VPC connectivity for Amazon Bedrock AgentCore Browser, please refer to the [official documentation](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/agentcore-vpc.html).\n\n### Code Interpreter Properties\n\n| Name | Type | Required | Description |\n|------|------|----------|-------------|\n| `codeInterpreterCustomName` | `string` | Yes | The name of the code interpreter. Must start with a letter and can be up to 48 characters long. Pattern: `[a-zA-Z][a-zA-Z0-9_]{0,47}` |\n| `description` | `string` | No | Optional description for the code interpreter. Can have up to 200 characters |\n| `executionRole` | `iam.IRole` | No | The IAM role that provides permissions for the code interpreter to access AWS services. A new role will be created if not provided |\n| `networkConfiguration` | `CodeInterpreterNetworkConfiguration` | No | Network configuration for code interpreter. Defaults to PUBLIC network mode |\n| `tags` | `{ [key: string]: string }` | No | Tags to apply to the code interpreter resource |\n\n### Basic Code Interpreter Creation\n\n```typescript fixture=default\n// Create a basic code interpreter with public network access\nconst codeInterpreter = new agentcore.CodeInterpreterCustom(this, \"MyCodeInterpreter\", {\n codeInterpreterCustomName: \"my_code_interpreter\",\n description: \"A code interpreter for Python execution\",\n});\n```\n\n### Code Interpreter with VPC\n\n```typescript fixture=default\nconst codeInterpreter = new agentcore.CodeInterpreterCustom(this, \"MyCodeInterpreter\", {\n codeInterpreterCustomName: \"my_sandbox_interpreter\",\n description: \"Code interpreter with isolated network access\",\n networkConfiguration: agentcore.BrowserNetworkConfiguration.usingVpc(this, {\n vpc: new ec2.Vpc(this, 'VPC', { restrictDefaultSecurityGroup: false }),\n }),\n});\n```\n\nCode Interpreter exposes a [connections](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.Connections.html) property. This property returns a connections object, which simplifies the process of defining and managing ingress and egress rules for security groups in your AWS CDK applications. Instead of directly manipulating security group rules, you interact with the Connections object of a construct, which then translates your connectivity requirements into the appropriate security group rules. For instance:\n\n```typescript fixture=default\nconst vpc = new ec2.Vpc(this, 'testVPC');\n\nconst codeInterpreter = new agentcore.CodeInterpreterCustom(this, \"MyCodeInterpreter\", {\n codeInterpreterCustomName: \"my_sandbox_interpreter\",\n description: \"Code interpreter with isolated network access\",\n networkConfiguration: agentcore.BrowserNetworkConfiguration.usingVpc(this, {\n vpc: vpc,\n }),\n});\n\ncodeInterpreter.connections.addSecurityGroup(new ec2.SecurityGroup(this, 'AdditionalGroup', { vpc }));\n```\n\nSo security groups can be added after the browser construct creation. You can use methods like allowFrom() and allowTo() to grant ingress access to/egress access from a specified peer over a given portRange. The Connections object automatically adds the necessary ingress or egress rules to the security group(s) associated with the calling construct.\n\n### Code Interpreter with Sandbox Network Mode\n\n```typescript fixture=default\n// Create code interpreter with sandbox network mode (isolated)\nconst codeInterpreter = new agentcore.CodeInterpreterCustom(this, \"MyCodeInterpreter\", {\n codeInterpreterCustomName: \"my_sandbox_interpreter\",\n description: \"Code interpreter with isolated network access\",\n networkConfiguration: agentcore.CodeInterpreterNetworkConfiguration.usingSandboxNetwork(),\n});\n```\n\n### Code Interpreter with Custom Execution Role\n\n```typescript fixture=default\n// Create a custom execution role\nconst executionRole = new iam.Role(this, \"CodeInterpreterExecutionRole\", {\n assumedBy: new iam.ServicePrincipal(\"bedrock-agentcore.amazonaws.com\"),\n});\n\n// Create code interpreter with custom execution role\nconst codeInterpreter = new agentcore.CodeInterpreterCustom(this, \"MyCodeInterpreter\", {\n codeInterpreterCustomName: \"my_code_interpreter\",\n description: \"Code interpreter with custom execution role\",\n networkConfiguration: agentcore.CodeInterpreterNetworkConfiguration.usingPublicNetwork(),\n executionRole: executionRole,\n});\n```\n\n### Code Interpreter IAM Permissions\n\nThe Code Interpreter construct provides convenient methods for granting IAM permissions:\n\n```typescript fixture=default\n// Create a code interpreter\nconst codeInterpreter = new agentcore.CodeInterpreterCustom(this, \"MyCodeInterpreter\", {\n codeInterpreterCustomName: \"my_code_interpreter\",\n description: \"Code interpreter for Python execution\",\n networkConfiguration: agentcore.CodeInterpreterNetworkConfiguration.usingPublicNetwork(),\n});\n\n// Create a role that needs access to the code interpreter\nconst userRole = new iam.Role(this, \"UserRole\", {\n assumedBy: new iam.ServicePrincipal(\"lambda.amazonaws.com\"),\n});\n\n// Grant read permissions (Get and List actions)\ncodeInterpreter.grantRead(userRole);\n\n// Grant use permissions (Start, Invoke, Stop actions)\ncodeInterpreter.grantUse(userRole);\n\n// Grant specific custom permissions\ncodeInterpreter.grant(userRole, \"bedrock-agentcore:GetCodeInterpreterSession\");\n```\n\n### Code interpreter with tags\n\n```typescript fixture=default\n// Create code interpreter with sandbox network mode (isolated)\nconst codeInterpreter = new agentcore.CodeInterpreterCustom(this, \"MyCodeInterpreter\", {\n codeInterpreterCustomName: \"my_sandbox_interpreter\",\n description: \"Code interpreter with isolated network access\",\n networkConfiguration: agentcore.CodeInterpreterNetworkConfiguration.usingPublicNetwork(),\n tags: {\n Environment: \"Production\",\n Team: \"AI/ML\",\n Project: \"AgentCore\",\n },\n});\n```\n\n## Gateway\n\nThe Gateway construct provides a way to create Amazon Bedrock Agent Core Gateways, which serve as integration points between agents and external services.\n\n### Gateway Properties\n\n| Name | Type | Required | Description |\n|------|------|----------|-------------|\n| `gatewayName` | `string` | Yes | The name of the gateway. Valid characters are a-z, A-Z, 0-9, _ (underscore) and - (hyphen). Maximum 100 characters |\n| `description` | `string` | No | Optional description for the gateway. Maximum 200 characters |\n| `protocolConfiguration` | `IGatewayProtocolConfig` | No | The protocol configuration for the gateway. Defaults to MCP protocol |\n| `authorizerConfiguration` | `IGatewayAuthorizerConfig` | No | The authorizer configuration for the gateway. Defaults to Cognito |\n| `exceptionLevel` | `GatewayExceptionLevel` | No | The verbosity of exception messages. Use DEBUG mode to see granular exception messages |\n| `kmsKey` | `kms.IKey` | No | The AWS KMS key used to encrypt data associated with the gateway |\n| `role` | `iam.IRole` | No | The IAM role that provides permissions for the gateway to access AWS services. A new role will be created if not provided |\n| `tags` | `{ [key: string]: string }` | No | Tags for the gateway. A list of key:value pairs of tags to apply to this Gateway resource |\n\n### Basic Gateway Creation\n\nThe protocol configuration defaults to MCP and the inbound auth configuration uses Cognito (it is automatically created on your behalf).\n\n```typescript fixture=default\n// Create a basic gateway with default MCP protocol and Cognito authorizer\nconst gateway = new agentcore.Gateway(this, \"MyGateway\", {\n gatewayName: \"my-gateway\",\n});\n```\n\n### Protocol configuration\n\nCurrently MCP is the only protocol available. To configure it, use the `protocol` property with `McpProtocolConfiguration`:\n\n- Instructions: Guidance for how to use the gateway with your tools\n- Semantic search: Smart tool discovery that finds the right tools without typical limits. It improves accuracy by finding relevant tools based on context\n- Supported versions: Which MCP protocol versions the gateway can use\n\n```typescript fixture=default\nconst gateway = new agentcore.Gateway(this, \"MyGateway\", {\n gatewayName: \"my-gateway\",\n protocolConfiguration: new agentcore.McpProtocolConfiguration({\n instructions: \"Use this gateway to connect to external MCP tools\",\n searchType: agentcore.McpGatewaySearchType.SEMANTIC,\n supportedVersions: [agentcore.MCPProtocolVersion.MCP_2025_03_26],\n }),\n});\n```\n\n### Inbound authorization\n\nBefore you create your gateway, you must set up inbound authorization. Inbound authorization validates users who attempt to access targets through\nyour AgentCore gateway. By default, if not provided, the construct will create and configure Cognito as the default identity provider\n(inbound Auth setup). AgentCore supports the following types of inbound authorization:\n\n**JSON Web Token (JWT)** – A secure and compact token used for authorization. After creating the JWT, you specify it as the authorization\nconfiguration when you create the gateway. You can create a JWT with any of the identity providers at Provider setup and configuration.\n\nYou can configure a custom authorization provider using the `inboundAuthorizer` property with `GatewayAuthorizer.usingCustomJwt()`.\nYou need to specify an OAuth discovery server and client IDs/audiences when you create the gateway. You can specify the following:\n\n- Discovery Url — String that must match the pattern ^.+/\\.well-known/openid-configuration$ for OpenID Connect discovery URLs\n- At least one of the below options depending on the chosen identity provider.\n- Allowed audiences — List of allowed audiences for JWT tokens\n- Allowed clients — List of allowed client identifiers\n\n```typescript fixture=default\nconst gateway = new agentcore.Gateway(this, \"MyGateway\", {\n gatewayName: \"my-gateway\",\n authorizerConfiguration: agentcore.GatewayAuthorizer.usingCustomJwt({\n discoveryUrl: \"https://auth.example.com/.well-known/openid-configuration\",\n allowedAudience: [\"my-app\"],\n allowedClients: [\"my-client-id\"],\n }),\n});\n```\n\n**IAM** – Authorizes through the credentials of the AWS IAM identity trying to access the gateway.\n\n```typescript fixture=default\nconst gateway = new agentcore.Gateway(this, \"MyGateway\", {\n gatewayName: \"my-gateway\",\n authorizerConfiguration: agentcore.GatewayAuthorizer.usingAwsIam(),\n});\n\n// Grant access to a Lambda function's role\nconst lambdaRole = new iam.Role(this, \"LambdaRole\", {\n assumedBy: new iam.ServicePrincipal(\"lambda.amazonaws.com\"),\n});\n\n// The Lambda needs permission to invoke the gateway\ngateway.grantInvoke(lambdaRole);\n```\n\n**Cognito with M2M (Machine-to-Machine) Authentication (Default)** – When no authorizer is specified, the construct automatically creates a Cognito User Pool configured for OAuth 2.0 client credentials flow. This enables machine-to-machine authentication suitable for AI agents and service-to-service communication.\n\nFor more information, see [Setting up Amazon Cognito for Gateway inbound authorization](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/identity-idp-cognito.html).\n\n```typescript fixture=default\n// Create a gateway with default Cognito M2M authorizer\nconst gateway = new agentcore.Gateway(this, \"MyGateway\", {\n gatewayName: \"my-gateway\",\n});\n\n// Access the Cognito resources for authentication setup\nconst userPool = gateway.userPool;\nconst userPoolClient = gateway.userPoolClient;\n\n// Get the token endpoint URL and OAuth scopes for client credentials flow\nconst tokenEndpointUrl = gateway.tokenEndpointUrl;\nconst oauthScopes = gateway.oauthScopes;\n// oauthScopes are in the format: ['{resourceServerId}/read', '{resourceServerId}/write']\n```\n\nTo authenticate with the gateway, request an access token using the client credentials flow and use it to call Gateway endpoints. For more information about the token endpoint, see [The token issuer endpoint](https://docs.aws.amazon.com/cognito/latest/developerguide/token-endpoint.html).\n\nThe following is an example of a token request using curl:\n\n```bash\ncurl -X POST \"${TOKEN_ENDPOINT_URL}\" \\\n -H \"Content-Type: application/x-www-form-urlencoded\" \\\n -d \"grant_type=client_credentials\" \\\n -d \"client_id=${USER_POOL_CLIENT_ID}\" \\\n -d \"client_secret=${CLIENT_SECRET}\" \\\n -d \"scope=${OAUTH_SCOPES}\"\n```\n\n### Gateway with KMS Encryption\n\nYou can provide a KMS key, and configure the authorizer as well as the protocol configuration.\n\n```typescript fixture=default\n// Create a KMS key for encryption\nconst encryptionKey = new kms.Key(this, \"GatewayEncryptionKey\", {\n enableKeyRotation: true,\n description: \"KMS key for gateway encryption\",\n});\n\n// Create gateway with KMS encryption\nconst gateway = new agentcore.Gateway(this, \"MyGateway\", {\n gatewayName: \"my-encrypted-gateway\",\n description: \"Gateway with KMS encryption\",\n protocolConfiguration: new agentcore.McpProtocolConfiguration({\n instructions: \"Use this gateway to connect to external MCP tools\",\n searchType: agentcore.McpGatewaySearchType.SEMANTIC,\n supportedVersions: [agentcore.MCPProtocolVersion.MCP_2025_03_26],\n }),\n authorizerConfiguration: agentcore.GatewayAuthorizer.usingCustomJwt({\n discoveryUrl: \"https://auth.example.com/.well-known/openid-configuration\",\n allowedAudience: [\"my-app\"],\n allowedClients: [\"my-client-id\"],\n }),\n kmsKey: encryptionKey,\n exceptionLevel: agentcore.GatewayExceptionLevel.DEBUG,\n});\n```\n\n### Gateway with Custom Execution Role\n\n```typescript fixture=default\n// Create a custom execution role\nconst executionRole = new iam.Role(this, \"GatewayExecutionRole\", {\n assumedBy: new iam.ServicePrincipal(\"bedrock-agentcore.amazonaws.com\"),\n managedPolicies: [\n iam.ManagedPolicy.fromAwsManagedPolicyName(\"AmazonBedrockAgentCoreGatewayExecutionRolePolicy\"),\n ],\n});\n\n// Create gateway with custom execution role\nconst gateway = new agentcore.Gateway(this, \"MyGateway\", {\n gatewayName: \"my-gateway\",\n description: \"Gateway with custom execution role\",\n protocolConfiguration: new agentcore.McpProtocolConfiguration({\n instructions: \"Use this gateway to connect to external MCP tools\",\n searchType: agentcore.McpGatewaySearchType.SEMANTIC,\n supportedVersions: [agentcore.MCPProtocolVersion.MCP_2025_03_26],\n }),\n authorizerConfiguration: agentcore.GatewayAuthorizer.usingCustomJwt({\n discoveryUrl: \"https://auth.example.com/.well-known/openid-configuration\",\n allowedAudience: [\"my-app\"],\n allowedClients: [\"my-client-id\"],\n }),\n role: executionRole,\n});\n```\n\n### Gateway IAM Permissions\n\nThe Gateway construct provides convenient methods for granting IAM permissions:\n\n```typescript fixture=default\n// Create a gateway\nconst gateway = new agentcore.Gateway(this, \"MyGateway\", {\n gatewayName: \"my-gateway\",\n description: \"Gateway for external service integration\",\n protocolConfiguration: new agentcore.McpProtocolConfiguration({\n instructions: \"Use this gateway to connect to external MCP tools\",\n searchType: agentcore.McpGatewaySearchType.SEMANTIC,\n supportedVersions: [agentcore.MCPProtocolVersion.MCP_2025_03_26],\n }),\n authorizerConfiguration: agentcore.GatewayAuthorizer.usingCustomJwt({\n discoveryUrl: \"https://auth.example.com/.well-known/openid-configuration\",\n allowedAudience: [\"my-app\"],\n allowedClients: [\"my-client-id\"],\n }),\n});\n\n// Create a role that needs access to the gateway\nconst userRole = new iam.Role(this, \"UserRole\", {\n assumedBy: new iam.ServicePrincipal(\"lambda.amazonaws.com\"),\n});\n\n// Grant read permissions (Get and List actions)\ngateway.grantRead(userRole);\n\n// Grant manage permissions (Create, Update, Delete actions)\ngateway.grantManage(userRole);\n\n// Grant specific custom permissions\ngateway.grant(userRole, \"bedrock-agentcore:GetGateway\");\n```\n\n## Gateway Target\n\nAfter Creating gateways, you can add targets which define the tools that your gateway will host. Gateway supports multiple target\ntypes including Lambda functions and API specifications (either OpenAPI schemas or Smithy models). Gateway allows you to attach multiple\ntargets to a Gateway and you can change the targets / tools attached to a gateway at any point. Each target can have its own\ncredential provider attached enabling you to securely access targets whether they need IAM, API Key, or OAuth credentials.\n\n### Gateway Target Properties\n\n| Name | Type | Required | Description |\n|------|------|----------|-------------|\n| `gatewayTargetName` | `string` | Yes | The name of the gateway target. Valid characters are a-z, A-Z, 0-9, _ (underscore) and - (hyphen) |\n| `description` | `string` | No | Optional description for the gateway target. Maximum 200 characters |\n| `gateway` | `IGateway` | Yes | The gateway this target belongs to |\n| `targetConfiguration` | `ITargetConfiguration` | Yes | The target configuration (Lambda, OpenAPI, or Smithy). **Note:** Users typically don't create this directly. When using convenience methods like `GatewayTarget.forLambda()`, `GatewayTarget.forOpenApi()`, `GatewayTarget.forSmithy()` or the gateway's `addLambdaTarget()`, `addOpenApiTarget()`, `addSmithyTarget()` methods, this configuration is created internally for you. Only needed when using the GatewayTarget constructor directly for [advanced scenarios](#advanced-usage-direct-configuration-for-gateway-target). |\n| `credentialProviderConfigurations` | `IGatewayCredentialProvider[]` | No | Credential providers for authentication. Defaults to `[GatewayCredentialProvider.fromIamRole()]`. Use `GatewayCredentialProvider.fromApiKeyIdentityArn()`, `GatewayCredentialProvider.fromOauthIdentityArn()`, or `GatewayCredentialProvider.fromIamRole()` |\n| `validateOpenApiSchema` | `boolean` | No | (OpenAPI targets only) Whether to validate the OpenAPI schema at synthesis time. Defaults to `true`. Only applies to inline and local asset schemas. For more information refer here <https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/gateway-schema-openapi.html> |\n\nThis approach gives you full control over the configuration but is typically not necessary for most use cases.\n\n### Targets types\n\nYou can create the following targets types:\n\n**Lambda Target**: Lambda targets allow you to connect your gateway to AWS Lambda functions that implement your tools. This is useful\nwhen you want to execute custom code in response to tool invocations.\n\n- Supports GATEWAY_IAM_ROLE credential provider only\n- Ideal for custom serverless function integration\n- Need tool schema (tool schema is a blueprint that describes the functions your Lambda provides to AI agents).\n The construct provide [3 ways to upload a tool schema to Lambda target](#tools-schema-for-lambda-target)\n- When using the default IAM authentication (no `credentialProviderConfigurations` specified),\n the construct automatocally grants the gateway role permission to invoke your Lambda function (`lambda:InvokeFunction`).\n\n**OpenAPI Schema Target** : OpenAPI widely used standard for describing RESTful APIs. Gateway supports OpenAPI 3.0\nspecifications for defining API targets. It connects to REST APIs using OpenAPI specifications\n\n- Supports OAUTH and API_KEY credential providers (Do not support IAM, you must provide `credentialProviderConfigurations`)\n- Ideal for integrating with external REST services\n- Need API schema. The construct provide [3 ways to upload a API schema to OpenAPI target](#api-schema-for-openapi-and-smithy-target)\n\n**Smithy Model Target** : Smithy is a language for defining services and software development kits (SDKs). Smithy models provide\na more structured approach to defining APIs compared to OpenAPI, and are particularly useful for connecting to AWS services.\nAgentCore Gateway supports built-in AWS service models only. It connects to services using Smithy model definitions\n\n- Supports OAUTH and API_KEY credential providers\n- Ideal for AWS service integrations\n- Need API schema. The construct provide 3 ways to upload a API schema to Smity target\n- When using the default IAM authentication (no `credentialProviderConfigurations` specified), The construct only\n grants permission to read the Smithy schema file from S3. You MUST manually grant permissions for the gateway\n role to invoke the actual Smithy API endpoints\n\n> Note: For Smithy model targets that access AWS services, your Gateway's execution role needs permissions to access those services.\nFor example, for a DynamoDB target, your execution role needs permissions to perform DynamoDB operations.\nThis is not managed by the construct due to the large number of options. Please refer to\n[Smithy Model Permission](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/gateway-prerequisites-permissions.html) for example.\n\n**MCP Server Target**: Model Context Protocol (MCP) servers provide external tools, data access, and custom functions for AI agents.\nMCP servers enable agents to interact with external systems and services through a standardized protocol. Gateway automatically\ndiscovers and indexes available tools from MCP servers through synchronization.\n\n**Key Features:**\n\n- Requires explicit authentication configuration (OAuth2 recommended, empty array for NoAuth)\n- Ideal for connecting to external MCP-compliant servers\n- The endpoint must use HTTPS protocol\n- Supported MCP protocol versions: 2025-06-18, 2025-03-26\n- Automatic tool discovery through synchronization\n\n**Synchronization Behavior:**\n\nMCP Server targets require synchronization to discover and index available tools:\n\n- **Implicit Synchronization (Automatic)**: Tool discovery happens automatically during:\n - Target creation (`CreateGatewayTarget`)\n - Target updates (`UpdateGatewayTarget`)\n - The Gateway calls the MCP server's `tools/list` endpoint and indexes tools without user intervention\n\n- **Explicit Synchronization (Manual)**: When the MCP server's tools change independently (new tools added, schemas modified, tools removed):\n - The Gateway's tool catalog becomes stale\n - Call the `SynchronizeGatewayTargets` API to refresh the catalog\n - Use the `grantSync()` method to grant permissions to Lambda functions, CI/CD pipelines, or scheduled tasks that will trigger synchronization\n\n**Authentication & Permissions:**\n\nWhen using OAuth2, the Gateway service role automatically receives:\n\n- `bedrock-agentcore:GetWorkloadAccessToken`\n- `bedrock-agentcore:GetResourceOauth2Token`\n- `secretsmanager:GetSecretValue`\n- KMS decrypt (if secrets are encrypted)\n\nFor explicit synchronization, use `grantSync()` to grant `bedrock-agentcore:SynchronizeGatewayTargets` permission to your operator roles.\n\n> For more information, refer to the [MCP Server Target documentation](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/gateway-target-MCPservers.html).\n\n### Understanding Tool Naming\n\nWhen tools are exposed through gateway targets, AgentCore Gateway prefixes each tool name with the target name to ensure uniqueness across multiple targets. This is important to understand when building your application logic.\n\n**Naming Pattern:**\n\n**Example:**\n\nIf your target is named `my-lambda-target` and provides a tool called `calculate_price`, agents will discover and invoke it as `my-lambda-target__calculate_price`.\n\n**Important Considerations:**\n\n- **For Lambda Targets**: Your Lambda handler must strip the target name prefix before processing the tool request. The full tool name (with prefix) is sent in the event.\n- **For MCP Server Targets**: The MCP server receives tool calls with the prefixed name from the gateway.\n- **For OpenAPI/Smithy Targets**: The gateway handles the prefix automatically when mapping to API operations based on the `operationId`.\n\nThis naming convention ensures that:\n\n- Tools from different targets don't collide even if they have the same name\n- Agents can access tools from multiple targets through a single gateway\n- Tool names remain unique in the unified tool catalog\n\nFor more details, see the [Gateway Tool Naming Documentation](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/gateway-tool-naming.html).\n\n### Tools schema For Lambda target\n\nThe lambda target need tools schema to understand the fuunction lambda provides. You can upload the tool schema by following 3 ways:\n\n- From a local asset file\n\n```typescript\nconst toolSchema = agentcore.ToolSchema.fromLocalAsset(\n path.join(__dirname, \"schemas\", \"my-tool-schema.json\")\n );\n```\n\n- From an existing S3 file:\n\n```typescript\n\nconst toolSchema = agentcore.ToolSchema.fromS3File(\n s3.Bucket.fromBucketName(this, \"SchemasBucket\", \"my-schemas-bucket\"),\n \"tools/complex-tool-schema.json\",\n \"123456789012\"\n );\n```\n\n- From Inline:\n\n```typescript\nconst toolSchema = agentcore.ToolSchema.fromInline([{\n name: \"hello_world\",\n description: \"A simple hello world tool\",\n inputSchema: {\n type: agentcore.SchemaDefinitionType.OBJECT,\n properties: {\n name: {\n type: agentcore.SchemaDefinitionType.STRING,\n description: \"The name to greet\",\n },\n },\n required: [\"name\"],\n },\n }]);\n\n```\n\n### Api schema For OpenAPI and Smithy target\n\nThe OpenAPI and Smithy target need API Schema. The Gateway construct provide three ways to upload API schema for your target:\n\n- From a local asset file (requires binding to scope):\n\n```typescript fixture=default\n// When using ApiSchema.fromLocalAsset, you must bind the schema to a scope\nconst schema = agentcore.ApiSchema.fromLocalAsset(path.join(__dirname, \"mySchema.yml\"));\n\nschema.bind(this);\n```\n\n- From an inline schema:\n\n```typescript fixture=default\nconst inlineSchema = agentcore.ApiSchema.fromInline(`\nopenapi: 3.0.3\ninfo:\n title: Library API\n version: 1.0.0\npaths:\n /search:\n get:\n summary: Search for books\n operationId: searchBooks\n parameters:\n - name: query\n in: query\n required: true\n schema:\n type: string\n`);\n```\n\n- From an existing S3 file:\n\n```typescript fixture=default\nconst bucket = s3.Bucket.fromBucketName(this, \"ExistingBucket\", \"my-schema-bucket\");\nconst s3Schema = agentcore.ApiSchema.fromS3File(bucket, \"schemas/action-group.yaml\");\n```\n\n### Outbound auth\n\nOutbound authorization lets Amazon Bedrock AgentCore gateways securely access gateway targets on behalf of users authenticated\nand authorized during Inbound Auth.\n\nAgentCore Gateway supports the following types of outbound authorization:\n\n**IAM-based outbound authorization** – The gateway uses its execution role to authenticate with AWS services. This is the default\n and most common approach for Lambda targets and AWS service integrations.\n\n**2-legged OAuth (OAuth 2LO)** – Use OAuth 2.0 two-legged flow (2LO) for targets that require OAuth authentication.\nThe gateway authenticates on its own behalf, not on behalf of a user.\n\n**API key** – Use the AgentCore service/AWS console to generate an API key to authenticate access to the gateway target.\n\n**Note > You need to set up the outbound identity before you can create a gateway target.\n\n### Basic Gateway Target Creation\n\nYou can create targets in two ways: using the static factory methods on `GatewayTarget` or using the convenient `addTarget` methods on the gateway instance.\n\n#### Using addTarget methods (Recommended)\n\nBelow are the examples on how you can create Lambda , Smity and OpenAPI target using `addTarget` method.\n\n```typescript fixture=default\n// Create a gateway first\nconst gateway = new agentcore.Gateway(this, \"MyGateway\", {\n gatewayName: \"my-gateway\",\n});\n\nconst lambdaFunction = new lambda.Function(this, \"MyFunction\", {\n runtime: lambda.Runtime.NODEJS_22_X,\n handler: \"index.handler\",\n code: lambda.Code.fromInline(`\n exports.handler = async (event) => {\n return {\n statusCode: 200,\n body: JSON.stringify({ message: 'Hello from Lambda!' })\n };\n };\n `),\n});\n\nconst lambdaTarget = gateway.addLambdaTarget(\"MyLambdaTarget\", {\n gatewayTargetName: \"my-lambda-target\",\n description: \"Lambda function target\",\n lambdaFunction: lambdaFunction,\n toolSchema: agentcore.ToolSchema.fromInline([\n {\n name: \"hello_world\",\n description: \"A simple hello world tool\",\n inputSchema: {\n type: agentcore.SchemaDefinitionType.OBJECT,\n properties: {\n name: {\n type: agentcore.SchemaDefinitionType.STRING,\n description: \"The name to greet\",\n },\n },\n required: [\"name\"],\n },\n },\n ]),\n});\n```\n\n- OpenAPI Target\n\n``` typescript\nconst gateway = new agentcore.Gateway(this, \"MyGateway\", {\n gatewayName: \"my-gateway\",\n});\n\n// These ARNs are returned when creating the API key credential provider via Console or API\nconst apiKeyProviderArn = \"arn:aws:bedrock-agentcore:us-east-1:123456789012:token-vault/abc123/apikeycredentialprovider/my-apikey\"\nconst apiKeySecretArn = \"arn:aws:secretsmanager:us-east-1:123456789012:secret:my-apikey-secret-abc123\"\n\nconst bucket = s3.Bucket.fromBucketName(this, \"ExistingBucket\", \"my-schema-bucket\");\nconst s3mySchema = agentcore.ApiSchema.fromS3File(bucket, \"schemas/myschema.yaml\");\n\n// Add an OpenAPI target directly to the gateway\nconst target = gateway.addOpenApiTarget(\"MyTarget\", {\n gatewayTargetName: \"my-api-target\",\n description: \"Target for external API integration\",\n apiSchema: s3mySchema,\n credentialProviderConfigurations: [\n agentcore.GatewayCredentialProvider.fromApiKeyIdentityArn({\n providerArn: apiKeyProviderArn,\n secretArn: apiKeySecretArn,\n credentialLocation: agentcore.ApiKeyCredentialLocation.header({\n credentialParameterName: \"X-API-Key\",\n }),\n }),\n ],\n});\n\n// This make sure your s3 bucket is available before target\ntarget.node.addDependency(bucket);\n```\n\n- Smithy Target\n\n```typescript fixture=default\n\nconst gateway = new agentcore.Gateway(this, \"MyGateway\", {\n gatewayName: \"my-gateway\",\n});\n\nconst smithySchema = agentcore.ApiSchema.fromLocalAsset(\n path.join(__dirname, \"models\", \"smithy-model.json\")\n);\nsmithySchema.bind(this);\n\nconst smithyTarget = gateway.addSmithyTarget(\"MySmithyTarget\", {\n gatewayTargetName: \"my-smithy-target\",\n description: \"Smithy model target\",\n smithyModel: smithySchema,\n\n});\n```\n\n- MCP Server Target\n\n```typescript fixture=default\nconst gateway = new agentcore.Gateway(this, \"MyGateway\", {\n gatewayName: \"my-gateway\",\n});\n\n// OAuth2 authentication (recommended)\n// Note: Create the OAuth provider using AWS console or Identity L2 construct when available\nconst oauthProviderArn = \"arn:aws:bedrock-agentcore:us-east-1:123456789012:token-vault/abc123/oauth2credentialprovider/my-oauth\";\nconst oauthSecretArn = \"arn:aws:secretsmanager:us-east-1:123456789012:secret:my-oauth-secret-abc123\";\n\n// Add an MCP server target directly to the gateway\nconst mcpTarget = gateway.addMcpServerTarget(\"MyMcpServer\", {\n gatewayTargetName: \"my-mcp-server\",\n description: \"External MCP server integration\",\n endpoint: \"https://my-mcp-server.example.com\",\n credentialProviderConfigurations: [\n agentcore.GatewayCredentialProvider.fromOauthIdentityArn({\n providerArn: oauthProviderArn,\n secretArn: oauthSecretArn,\n scopes:['mcp-runtime-server/invoke']\n }),\n ],\n});\n\n// Grant sync permission to a Lambda function that will trigger synchronization\nconst syncFunction = new lambda.Function(this, \"SyncFunction\", {\n runtime: lambda.Runtime.PYTHON_3_12,\n handler: \"index.handler\",\n code: lambda.Code.fromInline(`\nimport boto3\n\ndef handler(event, context):\n client = boto3.client('bedrock-agentcore')\n response = client.synchronize_gateway_targets(\n gatewayIdentifier=event['gatewayId'],\n targetIds=[event['targetId']]\n )\n return response\n `),\n});\n\nmcpTarget.grantSync(syncFunction);\n```\n\n#### Using static factory methods\n\nCreate Gateway target using static convienence method.\n\n- Lambda Target\n\n```typescript fixture=default\nconst gateway = new agentcore.Gateway(this, \"MyGateway\", {\n gatewayName: \"my-gateway\",\n});\n\nconst lambdaFunction = new lambda.Function(this, \"MyFunction\", {\n runtime: lambda.Runtime.NODEJS_22_X,\n handler: \"index.handler\",\n code: lambda.Code.fromInline(`\n exports.handler = async (event) => {\n return {\n statusCode: 200,\n body: JSON.stringify({ message: 'Hello from Lambda!' })\n };\n };\n `),\n});\n\n// Create a gateway target with Lambda and tool schema\nconst target = agentcore.GatewayTarget.forLambda(this, \"MyLambdaTarget\", {\n gatewayTargetName: \"my-lambda-target\",\n description: \"Target for Lambda function integration\",\n gateway: gateway,\n lambdaFunction: lambdaFunction,\n toolSchema: agentcore.ToolSchema.fromLocalAsset(\n path.join(__dirname, \"schemas\", \"my-tool-schema.json\")\n ),\n});\n```\n\n- OpenAPI Target\n\n```typescript fixture=default\n\nconst gateway = new agentcore.Gateway(this, \"MyGateway\", {\n gatewayName: \"my-gateway\",\n});\n\n// outbound auth (Use AWS console to create it, Once Identity L2 construct is available you can use it to create identity)\nconst apiKeyIdentityArn = \"arn:aws:bedrock-agentcore:us-east-1:123456789012:token-vault/abc123/apikeycredentialprovider/my-apikey\"\nconst apiKeySecretArn = \"arn:aws:secretsmanager:us-east-1:123456789012:secret:my-apikey-secret-abc123\"\n\nconst opneapiSchema = agentcore.ApiSchema.fromLocalAsset(path.join(__dirname, \"mySchema.yml\"));\nopneapiSchema.bind(this);\n\n// Create a gateway target with OpenAPI Schema\nconst target = agentcore.GatewayTarget.forOpenApi(this, \"MyTarget\", {\n gatewayTargetName: \"my-api-target\",\n description: \"Target for external API integration\",\n gateway: gateway, // Note: you need to pass the gateway reference\n apiSchema: opneapiSchema,\n credentialProviderConfigurations: [\n agentcore.GatewayCredentialProvider.fromApiKeyIdentityArn({\n providerArn: apiKeyIdentityArn,\n secretArn: apiKeySecretArn\n }),\n ],\n});\n\n```\n\n- Smithy Target\n\n```typescript fixture=default\n\nconst gateway = new agentcore.Gateway(this, \"MyGateway\", {\n gatewayName: \"my-gateway\",\n});\n\nconst smithySchema = agentcore.ApiSchema.fromLocalAsset(\n path.join(__dirname, \"models\", \"smithy-model.json\")\n);\nsmithySchema.bind(this);\n\n// Create a gateway target with Smithy Model and OAuth\nconst target = agentcore.GatewayTarget.forSmithy(this, \"MySmithyTarget\", {\n gatewayTargetName: \"my-smithy-target\",\n description: \"Target for Smithy model integration\",\n gateway: gateway,\n smithyModel: smithySchema,\n});\n\n```\n\n- MCP Server Target\n\n```typescript fixture=default\nconst gateway = new agentcore.Gateway(this, \"MyGateway\", {\n gatewayName: \"my-gateway\",\n});\n\n// OAuth2 authentication (recommended)\n// Note: Create the OAuth provider using AWS console or Identity L2 construct when available\nconst oauthProviderArn = \"arn:aws:bedrock-agentcore:us-east-1:123456789012:token-vault/abc123/oauth2credentialprovider/my-oauth\";\nconst oauthSecretArn = \"arn:aws:secretsmanager:us-east-1:123456789012:secret:my-oauth-secret-abc123\";\n\n// Create a gateway target with MCP Server\nconst mcpTarget = agentcore.GatewayTarget.forMcpServer(this, \"MyMcpServer\", {\n gatewayTargetName: \"my-mcp-server\",\n description: \"External MCP server integration\",\n gateway: gateway,\n endpoint: \"https://my-mcp-server.example.com\",\n credentialProviderConfigurations: [\n agentcore.GatewayCredentialProvider.fromOauthIdentityArn({\n providerArn: oauthProviderArn,\n secretArn: oauthSecretArn,\n scopes:['mcp-runtime-server/invoke']\n }),\n ],\n});\n```\n\n### Advanced Usage: Direct Configuration for gateway target\n\nFor advanced use cases where you need full control over the target configuration, you can create configurations manually using the static factory methods and use the GatewayTarget constructor directly.\n\n#### Configuration Factory Methods\n\nEach target type has a corresponding configuration class with a static `create()` method:\n\n- **Lambda**: `LambdaTargetConfiguration.create(lambdaFunction, toolSchema)`\n- **OpenAPI**: `OpenApiTargetConfiguration.create(apiSchema, validateSchema?)`\n- **Smithy**: `SmithyTargetConfiguration.create(smithyModel)`\n\n#### Example: Lambda Target with Custom Configuration\n\n```typescript\nconst gateway = new agentcore.Gateway(this, \"MyGateway\", {\n gatewayName: \"my-gateway\",\n});\n\nconst myLambdaFunction = new lambda.Function(this, \"MyFunction\", {\n runtime: lambda.Runtime.NODEJS_22_X,\n handler: \"index.handler\",\n code: lambda.Code.fromInline(`\n exports.handler = async (event) => ({ statusCode: 200 });\n `),\n});\n\nconst myToolSchema = agentcore.ToolSchema.fromInline([{\n name: \"my_tool\",\n description: \"My custom tool\",\n inputSchema: {\n type: agentcore.SchemaDefinitionType.OBJECT,\n properties: {},\n },\n}]);\n\n// Create a custom Lambda configuration\nconst customConfig = agentcore.LambdaTargetConfiguration.create(\n myLambdaFunction,\n myToolSchema\n);\n\n// Use the GatewayTarget constructor directly\nconst target = new agentcore.GatewayTarget(this, \"AdvancedTarget\", {\n gateway: gateway,\n gatewayTargetName: \"advanced-target\",\n targetConfiguration: customConfig, // Manually created configuration\n credentialProviderConfigurations: [\n agentcore.GatewayCredentialProvider.fromIamRole()\n ]\n});\n```\n\nThis approach gives you full control over the configuration but is typically not necessary for most use cases. The convenience methods (`GatewayTarget.forLambda()`, `GatewayTarget.forOpenApi()`, `GatewayTarget.forSmithy()`) handle all of this internally.\n\n### Gateway Target IAM Permissions\n\nThe Gateway Target construct provides convenient methods for granting IAM permissions:\n\n```typescript fixture=default\n// Create a gateway and target\nconst gateway = new agentcore.Gateway(this, \"MyGateway\", {\n gatewayName: \"my-gateway\",\n});\n\nconst smithySchema = agentcore.ApiSchema.fromLocalAsset(\n path.join(__dirname, \"models\", \"smithy-model.json\")\n);\nsmithySchema.bind(this);\n\n// Create a gateway target with Smithy Model and OAuth\nconst target = agentcore.GatewayTarget.forSmithy(this, \"MySmithyTarget\", {\n gatewayTargetName: \"my-smithy-target\",\n description: \"Target for Smithy model integration\",\n gateway: gateway,\n smithyModel: smithySchema,\n});\n\n// Create a role that needs access to the gateway target\nconst userRole = new iam.Role(this, \"UserRole\", {\n assumedBy: new iam.ServicePrincipal(\"lambda.amazonaws.com\"),\n});\n\n// Grant read permissions (Get and List actions)\ntarget.grantRead(userRole);\n\n// Grant manage permissions (Create, Update, Delete actions)\ntarget.grantManage(userRole);\n\n// Grant specific custom permissions\ntarget.grant(userRole, \"bedrock-agentcore:GetGatewayTarget\");\n\n\n// Grants permission to invoke this Gateway\ngateway.grantInvoke(userRole);\n```\n\n## Memory\n\nMemory is a critical component of intelligence. While Large Language Models (LLMs) have impressive capabilities, they lack persistent memory across conversations. Amazon Bedrock AgentCore Memory addresses this limitation by providing a managed service that enables AI agents to maintain context over time, remember important facts, and deliver consistent, personalized experiences.\n\nAgentCore Memory operates on two levels:\n\n- **Short-Term Memory**: Immediate conversation context and session-based information that provides continuity within a single interaction or closely related sessions.\n- **Long-Term Memory**: Persistent information extracted and stored across multiple conversations, including facts, preferences, and summaries that enable personalized experiences over time.\n\nWhen you interact with the memory via the `CreateEvent` API, you store interactions in Short-Term Memory (STM) instantly. These interactions can include everything from user messages, assistant responses, to tool actions.\n\nTo write to long-term memory, you need to configure extraction strategies which define how and where to store information from conversations for future use. These strategies are asynchronously processed from raw events after every few turns based on the strategy that was selected. You can't create long term memory records directly, as they are extracted asynchronously by AgentCore Memory.\n\n### Memory Properties\n\n| Name | Type | Required | Description |\n|------|------|----------|-------------|\n| `memoryName` | `string` | Yes | The name of the memory |\n| `expirationDuration` | `Duration` | No | Short-term memory expiration in days (between 7 and 365). Default: 90 days |\n| `description` | `string` | No | Optional description for the memory. Default: no description. |\n| `kmsKey` | `IKey` | No | Custom KMS key to use for encryption. Default: Your data is encrypted with a key that AWS owns and manages for you |\n| `memoryStrategies` | `MemoryStrategyBase[]` | No | Built-in extraction strategies to use for this memory. Default: No extraction strategies (short term memory only) |\n| `executionRole` | `iam.IRole` | No | The IAM role that provides permissions for the memory to access AWS services. Default: A new role will be created. |\n| `tags` | `{ [key: string]: string }` | No | Tags for memory. Default: no tags. |\n\n### Basic Memory Creation\n\nBelow you can find how to configure a simple short-term memory (STM) with no long-term memory extraction strategies.\nNote how you set `expirationDuration`, which defines the time the events will be stored in the short-term memory before they expire.\n\n```typescript fixture=default\n\n// Create a basic memory with default settings, no LTM strategies\nconst memory = new agentcore.Memory(this, \"MyMemory\", {\n memoryName: \"my_memory\",\n description: \"A memory for storing user interactions for a period of 90 days\",\n expirationDuration: cdk.Duration.days(90),\n});\n```\n\nBasic Memory with Custom KMS Encryption\n\n```typescript fixture=default\n// Create a custom KMS key for encryption\nconst encryptionKey = new kms.Key(this, \"MemoryEncryptionKey\", {\n enableKeyRotation: true,\n description: \"KMS key for memory encryption\",\n});\n\n// Create memory with custom encryption\nconst memory = new agentcore.Memory(this, \"MyMemory\", {\n memoryName: \"my_encrypted_memory\",\n description: \"Memory with custom KMS encryption\",\n expirationDuration: cdk.Duration.days(90),\n kmsKey: encryptionKey,\n});\n```\n\n### LTM Memory Extraction Stategies\n\nIf you need long-term memory for context recall across sessions, you can setup memory extraction strategies\nto extract the relevant memory from the raw events.\n\nAmazon Bedrock AgentCore Memory has different memory strategies for extracting and organizing information:\n\n- **Summarization**: to summarize interactions to preserve critical context and key insights.\n- **Semantic Memory**: to extract general factual knowledge, concepts and meanings from raw conversations using vector embeddings.\nThis enables similarity-based retrieval of relevant facts and context.\n- **User Preferences**: to extract user behavior patterns from raw conversations.\n\nYou can use built-in extraction strategies for quick setup, or create custom extraction strategies with specific models and prompt templates.\n\n### Memory with Built-in Strategies\n\nThe library provides three built-in LTM strategies. These are default strategies for organizing and extracting memory data,\neach optimized for specific use cases.\n\nFor example: An agent helps multiple users with cloud storage setup. From these conversations,\nsee how each strategy processes users expressing confusion about account connection:\n\n1. **Summarization Strategy** (`MemoryStrategy.usingBuiltInSummarization()`)\nThis strategy compresses conversations into concise overviews, preserving essential context and key insights for quick recall.\nExtracted memory example: Users confused by cloud setup during onboarding.\n\n - Extracts concise summaries to preserve critical context and key insights\n - Namespace: `/strategies/{memoryStrategyId}/actors/{actorId}/sessions/{sessionId}`\n\n2. **Semantic Memory Strategy** (`MemoryStrategy.usingBuiltInSemantic()`)\nDistills general facts, concepts, and underlying meanings from raw conversational data, presenting the information in a context-independent format.\nExtracted memory example: In-context learning = task-solving via examples, no training needed.\n\n - Extracts general factual knowledge, concepts and meanings from raw conversations\n - Namespace: `/strategies/{memoryStrategyId}/actors/{actorId}`\n\n3. **User Preference Strategy** (`MemoryStrategy.usingBuiltInUserPreference()`)\nCaptures individual preferences, interaction patterns, and personalized settings to enhance future experiences.\nExtracted memory example: User needs clear guidance on cloud storage account connection during onboarding.\n\n - Extracts user behavior patterns from raw conversations\n - Namespace: `/strategies/{memoryStrategyId}/actors/{actorId}`\n\n```typescript fixture=default\n// Create memory with built-in strategies\nconst memory = new agentcore.Memory(this, \"MyMemory\", {\n memoryName: \"my_memory\",\n description: \"Memory with built-in strategies\",\n expirationDuration: cdk.Duration.days(90),\n memoryStrategies: [\n agentcore.MemoryStrategy.usingBuiltInSummarization(),\n agentcore.MemoryStrategy.usingBuiltInSemantic(),\n agentcore.MemoryStrategy.usingBuiltInUserPreference(),\n ],\n});\n```\n\nThe name generated for each built in memory strategy is as follows:\n\n- For Summarization: `summary_builtin_cdk001`\n- For Semantic:`semantic_builtin_cdk001>`\n- For User Preferences: `preference_builtin_cdk001`\n\n### Memory with custom Strategies\n\nWith Long-Term Memory, organization is managed through Namespaces.\n\nAn `actor` refers to entity such as end users or agent/user combinations. For example, in a coding support chatbot,\nthe actor is usually the developer asking questions. Using the actor ID helps the system know which user the memory belongs to,\nkeeping each user's data separate and organized.\n\nA `session` is usually a single conversation or interaction period between the user and the AI agent.\nIt groups all related messages and events that happen during that conversation.\n\nA `namespace` is used to logically group and organize long-term memories. It ensures data stays neat, separate, and secure.\n\nWith AgentCore Memory, you need to add a namespace when you define a memory strategy. This namespace helps define where the long-term memory\nwill be logically grouped. Every time a new long-term memory is extracted using this memory strategy, it is saved under the namespace you set.\nThis means that all long-term memories are scoped to their specific namespace, keeping them organized and preventing any mix-ups with other\nusers or sessions. You should use a hierarchical format separated by forward slashes /. This helps keep memories organized clearly. As needed,\nyou can choose to use the below pre-defined variables within braces in the namespace based on your applications' organization needs:\n\n- `actorId` – Identifies who the long-term memory belongs to, such as a user\n- `memoryStrategyId` – Shows which memory strategy is being used. This strategy identifier is auto-generated when you create a memory using CreateMemory operation.\n- `sessionId` – Identifies which session or conversation the memory is from.\n\nFor example, if you define the following namespace as the input to your strategy in CreateMemory operation:\n\n```shell\n/strategy/{memoryStrategyId}/actor/{actorId}/session/{sessionId}\n```\n\nAfter memory creation, this namespace might look like:\n\n```shell\n/strategy/summarization-93483043//actor/actor-9830m2w3/session/session-9330sds8\n```\n\nYou can customise the namespace, i.e. where the memories are stored by using the following methods:\n\n1. **Summarization Strategy** (`MemoryStrategy.usingSummarization(props)`)\n1. **Semantic Memory Strategy** (`MemoryStrategy.usingSemantic(props)`)\n1. **User Preference Strategy** (`MemoryStrategy.usingUserPreference(props)`)\n\n```typescript fixture=default\n// Create memory with built-in strategies\nconst memory = new agentcore.Memory(this, \"MyMemory\", {\n memoryName: \"my_memory\",\n description: \"Memory with built-in strategies\",\n expirationDuration: cdk.Duration.days(90),\n memoryStrategies: [\n agentcore.MemoryStrategy.usingUserPreference({\n name: \"CustomerPreferences\",\n namespaces: [\"support/customer/{actorId}/preferences\"]\n }),\n agentcore.MemoryStrategy.usingSemantic({\n name: \"CustomerSupportSemantic\",\n namespaces: [\"support/customer/{actorId}/semantic\"]\n }),\n ],\n});\n```\n\nCustom memory strategies let you tailor memory extraction and consolidation to your specific domain or use case.\nYou can override the prompts for extracting and consolidating semantic, summary, or user preferences.\nYou can also choose the model that you want to use for extraction and consolidation.\n\nThe custom prompts you create are appended to a non-editable system prompt.\n\nSince a custom strategy requires you to invoke certain FMs, you need a role with appropriate permissions. For that, you can:\n\n- Let the L2 construct create a minimum permission role for you when use L2 Bedrock Foundation Models.\n- Use a custom role with the overly permissive `AmazonBedrockAgentCoreMemoryBedrockModelInferenceExecutionRolePolicy` managed policy.\n- Use a custom role with your own custom policies.\n\n#### Memory with Custom Execution Role\n\nKeep in mind that memories that **do not** use custom strategies do not require a service role.\nSo even if you provide it, it will be ignored as it will never be used.\n\n```typescript fixture=default\n// Create a custom execution role\nconst executionRole = new iam.Role(this, \"MemoryExecutionRole\", {\n assumedBy: new iam.ServicePrincipal(\"bedrock-agentcore.amazonaws.com\"),\n managedPolicies: [\n iam.ManagedPolicy.fromAwsManagedPolicyName(\n \"AmazonBedrockAgentCoreMemoryBedrockModelInferenceExecutionRolePolicy\"\n ),\n ],\n});\n\n// Create memory with custom execution role\nconst memory = new agentcore.Memory(this, \"MyMemory\", {\n memoryName: \"my_memory\",\n description: \"Memory with custom execution role\",\n expirationDuration: cdk.Duration.days(90),\n executionRole: executionRole,\n});\n```\n\nIn customConsolidation and customExtraction, the model property uses the [@aws-cdk/aws-bedrock-alph](https://www.npmjs.com/package/@aws-cdk/aws-bedrock-alpha) library which must be installed separately.\n\n```typescript fixture=default\n// Create a custom semantic memory strategy\nconst customSemanticStrategy = agentcore.MemoryStrategy.usingSemantic({\n name: \"customSemanticStrategy\",\n description: \"Custom semantic memory strategy\",\n namespaces: [\"/custom/strategies/{memoryStrategyId}/actors/{actorId}\"],\n customConsolidation: {\n model: bedrock.BedrockFoundationModel.ANTHROPIC_CLAUDE_3_5_SONNET_V1_0,\n appendToPrompt: \"Custom consolidation prompt for semantic memory\",\n },\n customExtraction: {\n model: bedrock.BedrockFoundationModel.ANTHROPIC_CLAUDE_3_5_SONNET_V1_0,\n appendToPrompt: \"Custom extraction prompt for semantic memory\",\n },\n});\n\n// Create memory with custom strategy\nconst memory = new agentcore.Memory(this, \"MyMemory\", {\n memoryName: \"my-custom-memory\",\n description: \"Memory with custom strategy\",\n expirationDuration: cdk.Duration.days(90),\n memoryStrategies: [customSemanticStrategy],\n});\n```\n\n### Memory with self-managed Strategies\n\nA self-managed strategy in Amazon Bedrock AgentCore Memory gives you complete control over your memory extraction and consolidation pipelines.\nWith a self-managed strategy, you can build custom memory processing workflows while leveraging Amazon Bedrock AgentCore for storage and retrieval.\n\nFor additional information, you can refer to the [developer guide for self managed strategies](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/memory-self-managed-strategies.html).\n\nCreate the required AWS resources including:\n\n- an S3 bucket in your account where Amazon Bedrock AgentCore will deliver batched event payloads.\n- an SNS topic for job notifications. Use FIFO topics if processing order within sessions is important for your use case.\n\nThe construct will apply the correct permissions to the memory execution role to access these resources.\n\n```typescript fixture=default\n\nconst bucket = new s3.Bucket(this, 'memoryBucket', {\n bucketName: 'test-memory',\n removalPolicy: cdk.RemovalPolicy.DESTROY,\n autoDeleteObjects: true,\n});\n\nconst topic = new sns.Topic(this, 'topic');\n\n// Create a custom semantic memory strategy\nconst selfManagedStrategy = agentcore.MemoryStrategy.usingSelfManaged({\n name: \"selfManagedStrategy\",\n description: \"self managed memory strategy\",\n historicalContextWindowSize: 5,\n invocationConfiguration: {\n topic: topic,\n s3Location: {\n bucketName: bucket.bucketName,\n objectKey: 'memory/',\n }\n },\n triggerConditions: {\n messageBasedTrigger: 1,\n timeBasedTrigger: cdk.Duration.seconds(10),\n tokenBasedTrigger: 100\n }\n});\n\n// Create memory with custom strategy\nconst memory = new agentcore.Memory(this, \"MyMemory\", {\n memoryName: \"my-custom-memory\",\n description: \"Memory with custom strategy\",\n expirationDuration: cdk.Duration.days(90),\n memoryStrategies: [selfManagedStrategy],\n});\n```\n\n### Memory Strategy Methods\n\nYou can add new memory strategies to the memory construct using the `addMemoryStrategy()` method, for instance:\n\n```typescript fixture=default\n// Create memory without initial strategies\nconst memory = new agentcore.Memory(this, \"test-memory\", {\n memoryName: \"test_memory_add_strategy\",\n description: \"A test memory for testing addMemoryStrategy method\",\n expirationDuration: cdk.Duration.days(90),\n});\n\n// Add strategies after instantiation\nmemory.addMemoryStrategy(agentcore.MemoryStrategy.usingBuiltInSummarization());\nmemory.addMemoryStrategy(agentcore.MemoryStrategy.usingBuiltInSemantic());\n```\n"
8528
8528
  },
8529
8529
  "repository": {
8530
8530
  "directory": "packages/@aws-cdk/aws-bedrock-agentcore-alpha",
@@ -9304,7 +9304,7 @@
9304
9304
  "kind": "interface",
9305
9305
  "locationInModule": {
9306
9306
  "filename": "lib/runtime/runtime-base.ts",
9307
- "line": 392
9307
+ "line": 403
9308
9308
  },
9309
9309
  "name": "AgentRuntimeAttributes",
9310
9310
  "properties": [
@@ -9317,7 +9317,7 @@
9317
9317
  "immutable": true,
9318
9318
  "locationInModule": {
9319
9319
  "filename": "lib/runtime/runtime-base.ts",
9320
- "line": 396
9320
+ "line": 407
9321
9321
  },
9322
9322
  "name": "agentRuntimeArn",
9323
9323
  "type": {
@@ -9333,7 +9333,7 @@
9333
9333
  "immutable": true,
9334
9334
  "locationInModule": {
9335
9335
  "filename": "lib/runtime/runtime-base.ts",
9336
- "line": 401
9336
+ "line": 412
9337
9337
  },
9338
9338
  "name": "agentRuntimeId",
9339
9339
  "type": {
@@ -9349,7 +9349,7 @@
9349
9349
  "immutable": true,
9350
9350
  "locationInModule": {
9351
9351
  "filename": "lib/runtime/runtime-base.ts",
9352
- "line": 406
9352
+ "line": 417
9353
9353
  },
9354
9354
  "name": "agentRuntimeName",
9355
9355
  "type": {
@@ -9365,7 +9365,7 @@
9365
9365
  "immutable": true,
9366
9366
  "locationInModule": {
9367
9367
  "filename": "lib/runtime/runtime-base.ts",
9368
- "line": 411
9368
+ "line": 422
9369
9369
  },
9370
9370
  "name": "roleArn",
9371
9371
  "type": {
@@ -9382,7 +9382,7 @@
9382
9382
  "immutable": true,
9383
9383
  "locationInModule": {
9384
9384
  "filename": "lib/runtime/runtime-base.ts",
9385
- "line": 419
9385
+ "line": 430
9386
9386
  },
9387
9387
  "name": "agentRuntimeVersion",
9388
9388
  "optional": true,
@@ -9400,7 +9400,7 @@
9400
9400
  "immutable": true,
9401
9401
  "locationInModule": {
9402
9402
  "filename": "lib/runtime/runtime-base.ts",
9403
- "line": 437
9403
+ "line": 448
9404
9404
  },
9405
9405
  "name": "agentStatus",
9406
9406
  "optional": true,
@@ -9418,7 +9418,7 @@
9418
9418
  "immutable": true,
9419
9419
  "locationInModule": {
9420
9420
  "filename": "lib/runtime/runtime-base.ts",
9421
- "line": 443
9421
+ "line": 454
9422
9422
  },
9423
9423
  "name": "createdAt",
9424
9424
  "optional": true,
@@ -9436,7 +9436,7 @@
9436
9436
  "immutable": true,
9437
9437
  "locationInModule": {
9438
9438
  "filename": "lib/runtime/runtime-base.ts",
9439
- "line": 425
9439
+ "line": 436
9440
9440
  },
9441
9441
  "name": "description",
9442
9442
  "optional": true,
@@ -9454,7 +9454,7 @@
9454
9454
  "immutable": true,
9455
9455
  "locationInModule": {
9456
9456
  "filename": "lib/runtime/runtime-base.ts",
9457
- "line": 449
9457
+ "line": 460
9458
9458
  },
9459
9459
  "name": "lastUpdatedAt",
9460
9460
  "optional": true,
@@ -9472,7 +9472,7 @@
9472
9472
  "immutable": true,
9473
9473
  "locationInModule": {
9474
9474
  "filename": "lib/runtime/runtime-base.ts",
9475
- "line": 431
9475
+ "line": 442
9476
9476
  },
9477
9477
  "name": "securityGroups",
9478
9478
  "optional": true,
@@ -10206,7 +10206,7 @@
10206
10206
  },
10207
10207
  "locationInModule": {
10208
10208
  "filename": "lib/tools/browser.ts",
10209
- "line": 727
10209
+ "line": 734
10210
10210
  },
10211
10211
  "parameters": [
10212
10212
  {
@@ -10232,7 +10232,7 @@
10232
10232
  "kind": "class",
10233
10233
  "locationInModule": {
10234
10234
  "filename": "lib/tools/browser.ts",
10235
- "line": 611
10235
+ "line": 618
10236
10236
  },
10237
10237
  "methods": [
10238
10238
  {
@@ -10243,7 +10243,7 @@
10243
10243
  },
10244
10244
  "locationInModule": {
10245
10245
  "filename": "lib/tools/browser.ts",
10246
- "line": 627
10246
+ "line": 634
10247
10247
  },
10248
10248
  "name": "fromBrowserCustomAttributes",
10249
10249
  "parameters": [
@@ -10294,7 +10294,7 @@
10294
10294
  "immutable": true,
10295
10295
  "locationInModule": {
10296
10296
  "filename": "lib/tools/browser.ts",
10297
- "line": 614
10297
+ "line": 621
10298
10298
  },
10299
10299
  "name": "PROPERTY_INJECTION_ID",
10300
10300
  "static": true,
@@ -10313,7 +10313,7 @@
10313
10313
  "immutable": true,
10314
10314
  "locationInModule": {
10315
10315
  "filename": "lib/tools/browser.ts",
10316
- "line": 659
10316
+ "line": 666
10317
10317
  },
10318
10318
  "name": "browserArn",
10319
10319
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.BrowserCustomBase",
@@ -10332,7 +10332,7 @@
10332
10332
  "immutable": true,
10333
10333
  "locationInModule": {
10334
10334
  "filename": "lib/tools/browser.ts",
10335
- "line": 664
10335
+ "line": 671
10336
10336
  },
10337
10337
  "name": "browserId",
10338
10338
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.BrowserCustomBase",
@@ -10348,7 +10348,7 @@
10348
10348
  "immutable": true,
10349
10349
  "locationInModule": {
10350
10350
  "filename": "lib/tools/browser.ts",
10351
- "line": 696
10351
+ "line": 703
10352
10352
  },
10353
10353
  "name": "executionRole",
10354
10354
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.BrowserCustomBase",
@@ -10364,7 +10364,7 @@
10364
10364
  "immutable": true,
10365
10365
  "locationInModule": {
10366
10366
  "filename": "lib/tools/browser.ts",
10367
- "line": 706
10367
+ "line": 713
10368
10368
  },
10369
10369
  "name": "grantPrincipal",
10370
10370
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.BrowserCustomBase",
@@ -10380,7 +10380,7 @@
10380
10380
  "immutable": true,
10381
10381
  "locationInModule": {
10382
10382
  "filename": "lib/tools/browser.ts",
10383
- "line": 668
10383
+ "line": 675
10384
10384
  },
10385
10385
  "name": "name",
10386
10386
  "type": {
@@ -10395,7 +10395,7 @@
10395
10395
  "immutable": true,
10396
10396
  "locationInModule": {
10397
10397
  "filename": "lib/tools/browser.ts",
10398
- "line": 710
10398
+ "line": 717
10399
10399
  },
10400
10400
  "name": "networkConfiguration",
10401
10401
  "type": {
@@ -10410,7 +10410,7 @@
10410
10410
  "immutable": true,
10411
10411
  "locationInModule": {
10412
10412
  "filename": "lib/tools/browser.ts",
10413
- "line": 718
10413
+ "line": 725
10414
10414
  },
10415
10415
  "name": "browserSigning",
10416
10416
  "optional": true,
@@ -10429,7 +10429,7 @@
10429
10429
  "immutable": true,
10430
10430
  "locationInModule": {
10431
10431
  "filename": "lib/tools/browser.ts",
10432
- "line": 687
10432
+ "line": 694
10433
10433
  },
10434
10434
  "name": "createdAt",
10435
10435
  "optional": true,
@@ -10446,7 +10446,7 @@
10446
10446
  "immutable": true,
10447
10447
  "locationInModule": {
10448
10448
  "filename": "lib/tools/browser.ts",
10449
- "line": 672
10449
+ "line": 679
10450
10450
  },
10451
10451
  "name": "description",
10452
10452
  "optional": true,
@@ -10465,7 +10465,7 @@
10465
10465
  "immutable": true,
10466
10466
  "locationInModule": {
10467
10467
  "filename": "lib/tools/browser.ts",
10468
- "line": 692
10468
+ "line": 699
10469
10469
  },
10470
10470
  "name": "failureReason",
10471
10471
  "optional": true,
@@ -10484,7 +10484,7 @@
10484
10484
  "immutable": true,
10485
10485
  "locationInModule": {
10486
10486
  "filename": "lib/tools/browser.ts",
10487
- "line": 677
10487
+ "line": 684
10488
10488
  },
10489
10489
  "name": "lastUpdatedAt",
10490
10490
  "optional": true,
@@ -10501,7 +10501,7 @@
10501
10501
  "immutable": true,
10502
10502
  "locationInModule": {
10503
10503
  "filename": "lib/tools/browser.ts",
10504
- "line": 714
10504
+ "line": 721
10505
10505
  },
10506
10506
  "name": "recordingConfig",
10507
10507
  "optional": true,
@@ -10520,7 +10520,7 @@
10520
10520
  "immutable": true,
10521
10521
  "locationInModule": {
10522
10522
  "filename": "lib/tools/browser.ts",
10523
- "line": 682
10523
+ "line": 689
10524
10524
  },
10525
10525
  "name": "status",
10526
10526
  "optional": true,
@@ -10538,7 +10538,7 @@
10538
10538
  "immutable": true,
10539
10539
  "locationInModule": {
10540
10540
  "filename": "lib/tools/browser.ts",
10541
- "line": 702
10541
+ "line": 709
10542
10542
  },
10543
10543
  "name": "tags",
10544
10544
  "optional": true,
@@ -10569,7 +10569,7 @@
10569
10569
  "kind": "interface",
10570
10570
  "locationInModule": {
10571
10571
  "filename": "lib/tools/browser.ts",
10572
- "line": 567
10572
+ "line": 574
10573
10573
  },
10574
10574
  "name": "BrowserCustomAttributes",
10575
10575
  "properties": [
@@ -10585,7 +10585,7 @@
10585
10585
  "immutable": true,
10586
10586
  "locationInModule": {
10587
10587
  "filename": "lib/tools/browser.ts",
10588
- "line": 572
10588
+ "line": 579
10589
10589
  },
10590
10590
  "name": "browserArn",
10591
10591
  "type": {
@@ -10604,7 +10604,7 @@
10604
10604
  "immutable": true,
10605
10605
  "locationInModule": {
10606
10606
  "filename": "lib/tools/browser.ts",
10607
- "line": 577
10607
+ "line": 584
10608
10608
  },
10609
10609
  "name": "roleArn",
10610
10610
  "type": {
@@ -10621,7 +10621,7 @@
10621
10621
  "immutable": true,
10622
10622
  "locationInModule": {
10623
10623
  "filename": "lib/tools/browser.ts",
10624
- "line": 592
10624
+ "line": 599
10625
10625
  },
10626
10626
  "name": "createdAt",
10627
10627
  "optional": true,
@@ -10639,7 +10639,7 @@
10639
10639
  "immutable": true,
10640
10640
  "locationInModule": {
10641
10641
  "filename": "lib/tools/browser.ts",
10642
- "line": 582
10642
+ "line": 589
10643
10643
  },
10644
10644
  "name": "lastUpdatedAt",
10645
10645
  "optional": true,
@@ -10657,7 +10657,7 @@
10657
10657
  "immutable": true,
10658
10658
  "locationInModule": {
10659
10659
  "filename": "lib/tools/browser.ts",
10660
- "line": 598
10660
+ "line": 605
10661
10661
  },
10662
10662
  "name": "securityGroups",
10663
10663
  "optional": true,
@@ -10680,7 +10680,7 @@
10680
10680
  "immutable": true,
10681
10681
  "locationInModule": {
10682
10682
  "filename": "lib/tools/browser.ts",
10683
- "line": 587
10683
+ "line": 594
10684
10684
  },
10685
10685
  "name": "status",
10686
10686
  "optional": true,
@@ -10735,13 +10735,14 @@
10735
10735
  "methods": [
10736
10736
  {
10737
10737
  "docs": {
10738
+ "remarks": "[disable-awslint:no-grants]",
10738
10739
  "returns": "An IAM Grant object representing the granted permissions",
10739
10740
  "stability": "experimental",
10740
10741
  "summary": "Grants IAM actions to the IAM Principal."
10741
10742
  },
10742
10743
  "locationInModule": {
10743
10744
  "filename": "lib/tools/browser.ts",
10744
- "line": 242
10745
+ "line": 245
10745
10746
  },
10746
10747
  "name": "grant",
10747
10748
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.IBrowserCustom",
@@ -10776,14 +10777,14 @@
10776
10777
  {
10777
10778
  "docs": {
10778
10779
  "default": "- Default grant configuration:\n- actions: ['bedrock-agentcore:GetBrowser', 'bedrock-agentcore:GetBrowserSession'] on this.browserArn\n- actions: ['bedrock-agentcore:ListBrowsers', 'bedrock-agentcore:ListBrowserSessions'] on all resources (*)",
10779
- "remarks": "This includes both read permissions on the specific browser and list permissions on all browsers.",
10780
+ "remarks": "This includes both read permissions on the specific browser and list permissions on all browsers.\n\n[disable-awslint:no-grants]",
10780
10781
  "returns": "An IAM Grant object representing the granted permissions",
10781
10782
  "stability": "experimental",
10782
10783
  "summary": "Grant read permissions on this browser to an IAM principal."
10783
10784
  },
10784
10785
  "locationInModule": {
10785
10786
  "filename": "lib/tools/browser.ts",
10786
- "line": 260
10787
+ "line": 265
10787
10788
  },
10788
10789
  "name": "grantRead",
10789
10790
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.IBrowserCustom",
@@ -10807,13 +10808,14 @@
10807
10808
  {
10808
10809
  "docs": {
10809
10810
  "default": "- Default grant configuration:\n- actions: ['bedrock-agentcore:StartBrowserSession', 'bedrock-agentcore:UpdateBrowserStream', 'bedrock-agentcore:StopBrowserSession']\n- resourceArns: [this.browserArn]",
10811
+ "remarks": "[disable-awslint:no-grants]",
10810
10812
  "returns": "An IAM Grant object representing the granted permissions",
10811
10813
  "stability": "experimental",
10812
10814
  "summary": "Grant invoke permissions on this browser to an IAM principal."
10813
10815
  },
10814
10816
  "locationInModule": {
10815
10817
  "filename": "lib/tools/browser.ts",
10816
- "line": 284
10818
+ "line": 291
10817
10819
  },
10818
10820
  "name": "grantUse",
10819
10821
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.IBrowserCustom",
@@ -10842,7 +10844,7 @@
10842
10844
  },
10843
10845
  "locationInModule": {
10844
10846
  "filename": "lib/tools/browser.ts",
10845
- "line": 300
10847
+ "line": 307
10846
10848
  },
10847
10849
  "name": "metric",
10848
10850
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.IBrowserCustom",
@@ -10887,7 +10889,7 @@
10887
10889
  },
10888
10890
  "locationInModule": {
10889
10891
  "filename": "lib/tools/browser.ts",
10890
- "line": 366
10892
+ "line": 373
10891
10893
  },
10892
10894
  "name": "metricErrorsForApiOperation",
10893
10895
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.IBrowserCustom",
@@ -10924,7 +10926,7 @@
10924
10926
  },
10925
10927
  "locationInModule": {
10926
10928
  "filename": "lib/tools/browser.ts",
10927
- "line": 320
10929
+ "line": 327
10928
10930
  },
10929
10931
  "name": "metricForApiOperation",
10930
10932
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.IBrowserCustom",
@@ -10967,7 +10969,7 @@
10967
10969
  },
10968
10970
  "locationInModule": {
10969
10971
  "filename": "lib/tools/browser.ts",
10970
- "line": 350
10972
+ "line": 357
10971
10973
  },
10972
10974
  "name": "metricInvocationsForApiOperation",
10973
10975
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.IBrowserCustom",
@@ -11004,7 +11006,7 @@
11004
11006
  },
11005
11007
  "locationInModule": {
11006
11008
  "filename": "lib/tools/browser.ts",
11007
- "line": 337
11009
+ "line": 344
11008
11010
  },
11009
11011
  "name": "metricLatencyForApiOperation",
11010
11012
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.IBrowserCustom",
@@ -11041,7 +11043,7 @@
11041
11043
  },
11042
11044
  "locationInModule": {
11043
11045
  "filename": "lib/tools/browser.ts",
11044
- "line": 418
11046
+ "line": 425
11045
11047
  },
11046
11048
  "name": "metricSessionDuration",
11047
11049
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.IBrowserCustom",
@@ -11072,7 +11074,7 @@
11072
11074
  },
11073
11075
  "locationInModule": {
11074
11076
  "filename": "lib/tools/browser.ts",
11075
- "line": 392
11077
+ "line": 399
11076
11078
  },
11077
11079
  "name": "metricSystemErrorsForApiOperation",
11078
11080
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.IBrowserCustom",
@@ -11109,7 +11111,7 @@
11109
11111
  },
11110
11112
  "locationInModule": {
11111
11113
  "filename": "lib/tools/browser.ts",
11112
- "line": 431
11114
+ "line": 438
11113
11115
  },
11114
11116
  "name": "metricTakeOverCount",
11115
11117
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.IBrowserCustom",
@@ -11140,7 +11142,7 @@
11140
11142
  },
11141
11143
  "locationInModule": {
11142
11144
  "filename": "lib/tools/browser.ts",
11143
- "line": 457
11145
+ "line": 464
11144
11146
  },
11145
11147
  "name": "metricTakeOverDuration",
11146
11148
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.IBrowserCustom",
@@ -11171,7 +11173,7 @@
11171
11173
  },
11172
11174
  "locationInModule": {
11173
11175
  "filename": "lib/tools/browser.ts",
11174
- "line": 444
11176
+ "line": 451
11175
11177
  },
11176
11178
  "name": "metricTakeOverReleaseCount",
11177
11179
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.IBrowserCustom",
@@ -11202,7 +11204,7 @@
11202
11204
  },
11203
11205
  "locationInModule": {
11204
11206
  "filename": "lib/tools/browser.ts",
11205
- "line": 379
11207
+ "line": 386
11206
11208
  },
11207
11209
  "name": "metricThrottlesForApiOperation",
11208
11210
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.IBrowserCustom",
@@ -11239,7 +11241,7 @@
11239
11241
  },
11240
11242
  "locationInModule": {
11241
11243
  "filename": "lib/tools/browser.ts",
11242
- "line": 405
11244
+ "line": 412
11243
11245
  },
11244
11246
  "name": "metricUserErrorsForApiOperation",
11245
11247
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.IBrowserCustom",
@@ -11426,7 +11428,7 @@
11426
11428
  "kind": "interface",
11427
11429
  "locationInModule": {
11428
11430
  "filename": "lib/tools/browser.ts",
11429
- "line": 503
11431
+ "line": 510
11430
11432
  },
11431
11433
  "name": "BrowserCustomProps",
11432
11434
  "properties": [
@@ -11442,7 +11444,7 @@
11442
11444
  "immutable": true,
11443
11445
  "locationInModule": {
11444
11446
  "filename": "lib/tools/browser.ts",
11445
- "line": 511
11447
+ "line": 518
11446
11448
  },
11447
11449
  "name": "browserCustomName",
11448
11450
  "type": {
@@ -11460,7 +11462,7 @@
11460
11462
  "immutable": true,
11461
11463
  "locationInModule": {
11462
11464
  "filename": "lib/tools/browser.ts",
11463
- "line": 558
11465
+ "line": 565
11464
11466
  },
11465
11467
  "name": "browserSigning",
11466
11468
  "optional": true,
@@ -11481,7 +11483,7 @@
11481
11483
  "immutable": true,
11482
11484
  "locationInModule": {
11483
11485
  "filename": "lib/tools/browser.ts",
11484
- "line": 520
11486
+ "line": 527
11485
11487
  },
11486
11488
  "name": "description",
11487
11489
  "optional": true,
@@ -11502,7 +11504,7 @@
11502
11504
  "immutable": true,
11503
11505
  "locationInModule": {
11504
11506
  "filename": "lib/tools/browser.ts",
11505
- "line": 541
11507
+ "line": 548
11506
11508
  },
11507
11509
  "name": "executionRole",
11508
11510
  "optional": true,
@@ -11523,7 +11525,7 @@
11523
11525
  "immutable": true,
11524
11526
  "locationInModule": {
11525
11527
  "filename": "lib/tools/browser.ts",
11526
- "line": 527
11528
+ "line": 534
11527
11529
  },
11528
11530
  "name": "networkConfiguration",
11529
11531
  "optional": true,
@@ -11544,7 +11546,7 @@
11544
11546
  "immutable": true,
11545
11547
  "locationInModule": {
11546
11548
  "filename": "lib/tools/browser.ts",
11547
- "line": 534
11549
+ "line": 541
11548
11550
  },
11549
11551
  "name": "recordingConfig",
11550
11552
  "optional": true,
@@ -11565,7 +11567,7 @@
11565
11567
  "immutable": true,
11566
11568
  "locationInModule": {
11567
11569
  "filename": "lib/tools/browser.ts",
11568
- "line": 550
11570
+ "line": 557
11569
11571
  },
11570
11572
  "name": "tags",
11571
11573
  "optional": true,
@@ -11750,7 +11752,7 @@
11750
11752
  },
11751
11753
  "locationInModule": {
11752
11754
  "filename": "lib/tools/code-interpreter.ts",
11753
- "line": 621
11755
+ "line": 630
11754
11756
  },
11755
11757
  "parameters": [
11756
11758
  {
@@ -11776,7 +11778,7 @@
11776
11778
  "kind": "class",
11777
11779
  "locationInModule": {
11778
11780
  "filename": "lib/tools/code-interpreter.ts",
11779
- "line": 515
11781
+ "line": 524
11780
11782
  },
11781
11783
  "methods": [
11782
11784
  {
@@ -11787,7 +11789,7 @@
11787
11789
  },
11788
11790
  "locationInModule": {
11789
11791
  "filename": "lib/tools/code-interpreter.ts",
11790
- "line": 531
11792
+ "line": 540
11791
11793
  },
11792
11794
  "name": "fromCodeInterpreterCustomAttributes",
11793
11795
  "parameters": [
@@ -11838,7 +11840,7 @@
11838
11840
  "immutable": true,
11839
11841
  "locationInModule": {
11840
11842
  "filename": "lib/tools/code-interpreter.ts",
11841
- "line": 518
11843
+ "line": 527
11842
11844
  },
11843
11845
  "name": "PROPERTY_INJECTION_ID",
11844
11846
  "static": true,
@@ -11857,7 +11859,7 @@
11857
11859
  "immutable": true,
11858
11860
  "locationInModule": {
11859
11861
  "filename": "lib/tools/code-interpreter.ts",
11860
- "line": 563
11862
+ "line": 572
11861
11863
  },
11862
11864
  "name": "codeInterpreterArn",
11863
11865
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.CodeInterpreterCustomBase",
@@ -11876,7 +11878,7 @@
11876
11878
  "immutable": true,
11877
11879
  "locationInModule": {
11878
11880
  "filename": "lib/tools/code-interpreter.ts",
11879
- "line": 568
11881
+ "line": 577
11880
11882
  },
11881
11883
  "name": "codeInterpreterId",
11882
11884
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.CodeInterpreterCustomBase",
@@ -11892,7 +11894,7 @@
11892
11894
  "immutable": true,
11893
11895
  "locationInModule": {
11894
11896
  "filename": "lib/tools/code-interpreter.ts",
11895
- "line": 604
11897
+ "line": 613
11896
11898
  },
11897
11899
  "name": "executionRole",
11898
11900
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.CodeInterpreterCustomBase",
@@ -11908,7 +11910,7 @@
11908
11910
  "immutable": true,
11909
11911
  "locationInModule": {
11910
11912
  "filename": "lib/tools/code-interpreter.ts",
11911
- "line": 608
11913
+ "line": 617
11912
11914
  },
11913
11915
  "name": "grantPrincipal",
11914
11916
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.CodeInterpreterCustomBase",
@@ -11924,7 +11926,7 @@
11924
11926
  "immutable": true,
11925
11927
  "locationInModule": {
11926
11928
  "filename": "lib/tools/code-interpreter.ts",
11927
- "line": 572
11929
+ "line": 581
11928
11930
  },
11929
11931
  "name": "name",
11930
11932
  "type": {
@@ -11939,7 +11941,7 @@
11939
11941
  "immutable": true,
11940
11942
  "locationInModule": {
11941
11943
  "filename": "lib/tools/code-interpreter.ts",
11942
- "line": 580
11944
+ "line": 589
11943
11945
  },
11944
11946
  "name": "networkConfiguration",
11945
11947
  "type": {
@@ -11957,7 +11959,7 @@
11957
11959
  "immutable": true,
11958
11960
  "locationInModule": {
11959
11961
  "filename": "lib/tools/code-interpreter.ts",
11960
- "line": 590
11962
+ "line": 599
11961
11963
  },
11962
11964
  "name": "createdAt",
11963
11965
  "optional": true,
@@ -11974,7 +11976,7 @@
11974
11976
  "immutable": true,
11975
11977
  "locationInModule": {
11976
11978
  "filename": "lib/tools/code-interpreter.ts",
11977
- "line": 576
11979
+ "line": 585
11978
11980
  },
11979
11981
  "name": "description",
11980
11982
  "optional": true,
@@ -11993,7 +11995,7 @@
11993
11995
  "immutable": true,
11994
11996
  "locationInModule": {
11995
11997
  "filename": "lib/tools/code-interpreter.ts",
11996
- "line": 600
11998
+ "line": 609
11997
11999
  },
11998
12000
  "name": "failureReason",
11999
12001
  "optional": true,
@@ -12012,7 +12014,7 @@
12012
12014
  "immutable": true,
12013
12015
  "locationInModule": {
12014
12016
  "filename": "lib/tools/code-interpreter.ts",
12015
- "line": 595
12017
+ "line": 604
12016
12018
  },
12017
12019
  "name": "lastUpdatedAt",
12018
12020
  "optional": true,
@@ -12032,7 +12034,7 @@
12032
12034
  "immutable": true,
12033
12035
  "locationInModule": {
12034
12036
  "filename": "lib/tools/code-interpreter.ts",
12035
- "line": 585
12037
+ "line": 594
12036
12038
  },
12037
12039
  "name": "status",
12038
12040
  "optional": true,
@@ -12050,7 +12052,7 @@
12050
12052
  "immutable": true,
12051
12053
  "locationInModule": {
12052
12054
  "filename": "lib/tools/code-interpreter.ts",
12053
- "line": 614
12055
+ "line": 623
12054
12056
  },
12055
12057
  "name": "tags",
12056
12058
  "optional": true,
@@ -12081,7 +12083,7 @@
12081
12083
  "kind": "interface",
12082
12084
  "locationInModule": {
12083
12085
  "filename": "lib/tools/code-interpreter.ts",
12084
- "line": 471
12086
+ "line": 480
12085
12087
  },
12086
12088
  "name": "CodeInterpreterCustomAttributes",
12087
12089
  "properties": [
@@ -12097,7 +12099,7 @@
12097
12099
  "immutable": true,
12098
12100
  "locationInModule": {
12099
12101
  "filename": "lib/tools/code-interpreter.ts",
12100
- "line": 476
12102
+ "line": 485
12101
12103
  },
12102
12104
  "name": "codeInterpreterArn",
12103
12105
  "type": {
@@ -12116,7 +12118,7 @@
12116
12118
  "immutable": true,
12117
12119
  "locationInModule": {
12118
12120
  "filename": "lib/tools/code-interpreter.ts",
12119
- "line": 481
12121
+ "line": 490
12120
12122
  },
12121
12123
  "name": "roleArn",
12122
12124
  "type": {
@@ -12133,7 +12135,7 @@
12133
12135
  "immutable": true,
12134
12136
  "locationInModule": {
12135
12137
  "filename": "lib/tools/code-interpreter.ts",
12136
- "line": 496
12138
+ "line": 505
12137
12139
  },
12138
12140
  "name": "createdAt",
12139
12141
  "optional": true,
@@ -12151,7 +12153,7 @@
12151
12153
  "immutable": true,
12152
12154
  "locationInModule": {
12153
12155
  "filename": "lib/tools/code-interpreter.ts",
12154
- "line": 486
12156
+ "line": 495
12155
12157
  },
12156
12158
  "name": "lastUpdatedAt",
12157
12159
  "optional": true,
@@ -12169,7 +12171,7 @@
12169
12171
  "immutable": true,
12170
12172
  "locationInModule": {
12171
12173
  "filename": "lib/tools/code-interpreter.ts",
12172
- "line": 502
12174
+ "line": 511
12173
12175
  },
12174
12176
  "name": "securityGroups",
12175
12177
  "optional": true,
@@ -12192,7 +12194,7 @@
12192
12194
  "immutable": true,
12193
12195
  "locationInModule": {
12194
12196
  "filename": "lib/tools/code-interpreter.ts",
12195
- "line": 491
12197
+ "line": 500
12196
12198
  },
12197
12199
  "name": "status",
12198
12200
  "optional": true,
@@ -12247,13 +12249,14 @@
12247
12249
  "methods": [
12248
12250
  {
12249
12251
  "docs": {
12252
+ "remarks": "[disable-awslint:no-grants]",
12250
12253
  "returns": "An IAM Grant object representing the granted permissions",
12251
12254
  "stability": "experimental",
12252
12255
  "summary": "Grants IAM actions to the IAM Principal."
12253
12256
  },
12254
12257
  "locationInModule": {
12255
12258
  "filename": "lib/tools/code-interpreter.ts",
12256
- "line": 207
12259
+ "line": 210
12257
12260
  },
12258
12261
  "name": "grant",
12259
12262
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.ICodeInterpreterCustom",
@@ -12288,13 +12291,14 @@
12288
12291
  {
12289
12292
  "docs": {
12290
12293
  "default": "- Default grant configuration:\n- actions: ['bedrock-agentcore:InvokeCodeInterpreter']\n- resourceArns: [this.codeInterpreterArn]",
12294
+ "remarks": "[disable-awslint:no-grants]",
12291
12295
  "returns": "An IAM Grant object representing the granted permissions",
12292
12296
  "stability": "experimental",
12293
12297
  "summary": "Grant invoke permissions on this code interpreter to an IAM principal."
12294
12298
  },
12295
12299
  "locationInModule": {
12296
12300
  "filename": "lib/tools/code-interpreter.ts",
12297
- "line": 265
12301
+ "line": 274
12298
12302
  },
12299
12303
  "name": "grantInvoke",
12300
12304
  "parameters": [
@@ -12317,14 +12321,14 @@
12317
12321
  {
12318
12322
  "docs": {
12319
12323
  "default": "- Default grant configuration:\n- actions: ['bedrock-agentcore:GetCodeInterpreter', 'bedrock-agentcore:GetCodeInterpreterSession'] on this.codeInterpreterArn\n- actions: ['bedrock-agentcore:ListCodeInterpreters', 'bedrock-agentcore:ListCodeInterpreterSessions'] on all resources (*)",
12320
- "remarks": "This includes both read permissions on the specific code interpreter and list permissions on all code interpreters.",
12324
+ "remarks": "This includes both read permissions on the specific code interpreter and list permissions on all code interpreters.\n\n[disable-awslint:no-grants]",
12321
12325
  "returns": "An IAM Grant object representing the granted permissions",
12322
12326
  "stability": "experimental",
12323
12327
  "summary": "Grant read permissions on this code interpreter to an IAM principal."
12324
12328
  },
12325
12329
  "locationInModule": {
12326
12330
  "filename": "lib/tools/code-interpreter.ts",
12327
- "line": 225
12331
+ "line": 230
12328
12332
  },
12329
12333
  "name": "grantRead",
12330
12334
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.ICodeInterpreterCustom",
@@ -12348,13 +12352,14 @@
12348
12352
  {
12349
12353
  "docs": {
12350
12354
  "default": "- Default grant configuration:\n- actions: ['bedrock-agentcore:StartCodeInterpreterSession', 'bedrock-agentcore:InvokeCodeInterpreter', 'bedrock-agentcore:StopCodeInterpreterSession']\n- resourceArns: [this.codeInterpreterArn]",
12355
+ "remarks": "[disable-awslint:no-grants]",
12351
12356
  "returns": "An IAM Grant object representing the granted permissions",
12352
12357
  "stability": "experimental",
12353
12358
  "summary": "Grant invoke permissions on this code interpreter to an IAM principal."
12354
12359
  },
12355
12360
  "locationInModule": {
12356
12361
  "filename": "lib/tools/code-interpreter.ts",
12357
- "line": 249
12362
+ "line": 256
12358
12363
  },
12359
12364
  "name": "grantUse",
12360
12365
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.ICodeInterpreterCustom",
@@ -12383,7 +12388,7 @@
12383
12388
  },
12384
12389
  "locationInModule": {
12385
12390
  "filename": "lib/tools/code-interpreter.ts",
12386
- "line": 278
12391
+ "line": 287
12387
12392
  },
12388
12393
  "name": "metric",
12389
12394
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.ICodeInterpreterCustom",
@@ -12428,7 +12433,7 @@
12428
12433
  },
12429
12434
  "locationInModule": {
12430
12435
  "filename": "lib/tools/code-interpreter.ts",
12431
- "line": 344
12436
+ "line": 353
12432
12437
  },
12433
12438
  "name": "metricErrorsForApiOperation",
12434
12439
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.ICodeInterpreterCustom",
@@ -12465,7 +12470,7 @@
12465
12470
  },
12466
12471
  "locationInModule": {
12467
12472
  "filename": "lib/tools/code-interpreter.ts",
12468
- "line": 298
12473
+ "line": 307
12469
12474
  },
12470
12475
  "name": "metricForApiOperation",
12471
12476
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.ICodeInterpreterCustom",
@@ -12508,7 +12513,7 @@
12508
12513
  },
12509
12514
  "locationInModule": {
12510
12515
  "filename": "lib/tools/code-interpreter.ts",
12511
- "line": 328
12516
+ "line": 337
12512
12517
  },
12513
12518
  "name": "metricInvocationsForApiOperation",
12514
12519
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.ICodeInterpreterCustom",
@@ -12545,7 +12550,7 @@
12545
12550
  },
12546
12551
  "locationInModule": {
12547
12552
  "filename": "lib/tools/code-interpreter.ts",
12548
- "line": 315
12553
+ "line": 324
12549
12554
  },
12550
12555
  "name": "metricLatencyForApiOperation",
12551
12556
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.ICodeInterpreterCustom",
@@ -12582,7 +12587,7 @@
12582
12587
  },
12583
12588
  "locationInModule": {
12584
12589
  "filename": "lib/tools/code-interpreter.ts",
12585
- "line": 396
12590
+ "line": 405
12586
12591
  },
12587
12592
  "name": "metricSessionDuration",
12588
12593
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.ICodeInterpreterCustom",
@@ -12613,7 +12618,7 @@
12613
12618
  },
12614
12619
  "locationInModule": {
12615
12620
  "filename": "lib/tools/code-interpreter.ts",
12616
- "line": 370
12621
+ "line": 379
12617
12622
  },
12618
12623
  "name": "metricSystemErrorsForApiOperation",
12619
12624
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.ICodeInterpreterCustom",
@@ -12650,7 +12655,7 @@
12650
12655
  },
12651
12656
  "locationInModule": {
12652
12657
  "filename": "lib/tools/code-interpreter.ts",
12653
- "line": 357
12658
+ "line": 366
12654
12659
  },
12655
12660
  "name": "metricThrottlesForApiOperation",
12656
12661
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.ICodeInterpreterCustom",
@@ -12687,7 +12692,7 @@
12687
12692
  },
12688
12693
  "locationInModule": {
12689
12694
  "filename": "lib/tools/code-interpreter.ts",
12690
- "line": 383
12695
+ "line": 392
12691
12696
  },
12692
12697
  "name": "metricUserErrorsForApiOperation",
12693
12698
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.ICodeInterpreterCustom",
@@ -12874,7 +12879,7 @@
12874
12879
  "kind": "interface",
12875
12880
  "locationInModule": {
12876
12881
  "filename": "lib/tools/code-interpreter.ts",
12877
- "line": 421
12882
+ "line": 430
12878
12883
  },
12879
12884
  "name": "CodeInterpreterCustomProps",
12880
12885
  "properties": [
@@ -12890,7 +12895,7 @@
12890
12895
  "immutable": true,
12891
12896
  "locationInModule": {
12892
12897
  "filename": "lib/tools/code-interpreter.ts",
12893
- "line": 429
12898
+ "line": 438
12894
12899
  },
12895
12900
  "name": "codeInterpreterCustomName",
12896
12901
  "type": {
@@ -12910,7 +12915,7 @@
12910
12915
  "immutable": true,
12911
12916
  "locationInModule": {
12912
12917
  "filename": "lib/tools/code-interpreter.ts",
12913
- "line": 438
12918
+ "line": 447
12914
12919
  },
12915
12920
  "name": "description",
12916
12921
  "optional": true,
@@ -12931,7 +12936,7 @@
12931
12936
  "immutable": true,
12932
12937
  "locationInModule": {
12933
12938
  "filename": "lib/tools/code-interpreter.ts",
12934
- "line": 446
12939
+ "line": 455
12935
12940
  },
12936
12941
  "name": "executionRole",
12937
12942
  "optional": true,
@@ -12952,7 +12957,7 @@
12952
12957
  "immutable": true,
12953
12958
  "locationInModule": {
12954
12959
  "filename": "lib/tools/code-interpreter.ts",
12955
- "line": 453
12960
+ "line": 462
12956
12961
  },
12957
12962
  "name": "networkConfiguration",
12958
12963
  "optional": true,
@@ -12973,7 +12978,7 @@
12973
12978
  "immutable": true,
12974
12979
  "locationInModule": {
12975
12980
  "filename": "lib/tools/code-interpreter.ts",
12976
- "line": 462
12981
+ "line": 471
12977
12982
  },
12978
12983
  "name": "tags",
12979
12984
  "optional": true,
@@ -13403,7 +13408,7 @@
13403
13408
  },
13404
13409
  "locationInModule": {
13405
13410
  "filename": "lib/gateway/gateway.ts",
13406
- "line": 392
13411
+ "line": 414
13407
13412
  },
13408
13413
  "parameters": [
13409
13414
  {
@@ -13487,7 +13492,7 @@
13487
13492
  },
13488
13493
  "locationInModule": {
13489
13494
  "filename": "lib/gateway/gateway.ts",
13490
- "line": 454
13495
+ "line": 483
13491
13496
  },
13492
13497
  "name": "addLambdaTarget",
13493
13498
  "parameters": [
@@ -13525,7 +13530,7 @@
13525
13530
  },
13526
13531
  "locationInModule": {
13527
13532
  "filename": "lib/gateway/gateway.ts",
13528
- "line": 540
13533
+ "line": 569
13529
13534
  },
13530
13535
  "name": "addMcpServerTarget",
13531
13536
  "parameters": [
@@ -13562,7 +13567,7 @@
13562
13567
  },
13563
13568
  "locationInModule": {
13564
13569
  "filename": "lib/gateway/gateway.ts",
13565
- "line": 485
13570
+ "line": 514
13566
13571
  },
13567
13572
  "name": "addOpenApiTarget",
13568
13573
  "parameters": [
@@ -13599,7 +13604,7 @@
13599
13604
  },
13600
13605
  "locationInModule": {
13601
13606
  "filename": "lib/gateway/gateway.ts",
13602
- "line": 510
13607
+ "line": 539
13603
13608
  },
13604
13609
  "name": "addSmithyTarget",
13605
13610
  "parameters": [
@@ -13841,6 +13846,28 @@
13841
13846
  "fqn": "aws-cdk-lib.aws_kms.IKey"
13842
13847
  }
13843
13848
  },
13849
+ {
13850
+ "docs": {
13851
+ "remarks": "Only available when using the default Cognito authorizer.",
13852
+ "stability": "experimental",
13853
+ "summary": "The OAuth2 scope strings for client credentials flow."
13854
+ },
13855
+ "immutable": true,
13856
+ "locationInModule": {
13857
+ "filename": "lib/gateway/gateway.ts",
13858
+ "line": 412
13859
+ },
13860
+ "name": "oauthScopes",
13861
+ "optional": true,
13862
+ "type": {
13863
+ "collection": {
13864
+ "elementtype": {
13865
+ "primitive": "string"
13866
+ },
13867
+ "kind": "array"
13868
+ }
13869
+ }
13870
+ },
13844
13871
  {
13845
13872
  "docs": {
13846
13873
  "custom": {
@@ -13907,6 +13934,23 @@
13907
13934
  }
13908
13935
  }
13909
13936
  },
13937
+ {
13938
+ "docs": {
13939
+ "remarks": "Only available when using the default Cognito authorizer.",
13940
+ "stability": "experimental",
13941
+ "summary": "The OAuth2 token endpoint URL for client credentials flow."
13942
+ },
13943
+ "immutable": true,
13944
+ "locationInModule": {
13945
+ "filename": "lib/gateway/gateway.ts",
13946
+ "line": 406
13947
+ },
13948
+ "name": "tokenEndpointUrl",
13949
+ "optional": true,
13950
+ "type": {
13951
+ "primitive": "string"
13952
+ }
13953
+ },
13910
13954
  {
13911
13955
  "docs": {
13912
13956
  "custom": {
@@ -13927,6 +13971,21 @@
13927
13971
  "primitive": "string"
13928
13972
  }
13929
13973
  },
13974
+ {
13975
+ "docs": {
13976
+ "stability": "experimental",
13977
+ "summary": "The Cognito Resource Server created for the gateway (if using default Cognito authorizer)."
13978
+ },
13979
+ "locationInModule": {
13980
+ "filename": "lib/gateway/gateway.ts",
13981
+ "line": 400
13982
+ },
13983
+ "name": "resourceServer",
13984
+ "optional": true,
13985
+ "type": {
13986
+ "fqn": "aws-cdk-lib.aws_cognito.IUserPoolResourceServer"
13987
+ }
13988
+ },
13930
13989
  {
13931
13990
  "docs": {
13932
13991
  "stability": "experimental",
@@ -13956,6 +14015,21 @@
13956
14015
  "type": {
13957
14016
  "fqn": "aws-cdk-lib.aws_cognito.IUserPoolClient"
13958
14017
  }
14018
+ },
14019
+ {
14020
+ "docs": {
14021
+ "stability": "experimental",
14022
+ "summary": "The Cognito User Pool Domain created for the gateway (if using default Cognito authorizer)."
14023
+ },
14024
+ "locationInModule": {
14025
+ "filename": "lib/gateway/gateway.ts",
14026
+ "line": 395
14027
+ },
14028
+ "name": "userPoolDomain",
14029
+ "optional": true,
14030
+ "type": {
14031
+ "fqn": "aws-cdk-lib.aws_cognito.IUserPoolDomain"
14032
+ }
13959
14033
  }
13960
14034
  ],
13961
14035
  "symbolId": "lib/gateway/gateway:Gateway"
@@ -14222,12 +14296,13 @@
14222
14296
  "methods": [
14223
14297
  {
14224
14298
  "docs": {
14299
+ "remarks": "[disable-awslint:no-grants]",
14225
14300
  "stability": "experimental",
14226
14301
  "summary": "Grants IAM actions to the IAM Principal."
14227
14302
  },
14228
14303
  "locationInModule": {
14229
14304
  "filename": "lib/gateway/gateway-base.ts",
14230
- "line": 258
14305
+ "line": 260
14231
14306
  },
14232
14307
  "name": "grant",
14233
14308
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.IGateway",
@@ -14261,12 +14336,13 @@
14261
14336
  },
14262
14337
  {
14263
14338
  "docs": {
14339
+ "remarks": "[disable-awslint:no-grants]",
14264
14340
  "stability": "experimental",
14265
14341
  "summary": "Grants permission to invoke this Gateway."
14266
14342
  },
14267
14343
  "locationInModule": {
14268
14344
  "filename": "lib/gateway/gateway-base.ts",
14269
- "line": 297
14345
+ "line": 305
14270
14346
  },
14271
14347
  "name": "grantInvoke",
14272
14348
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.IGateway",
@@ -14289,12 +14365,13 @@
14289
14365
  },
14290
14366
  {
14291
14367
  "docs": {
14368
+ "remarks": "[disable-awslint:no-grants]",
14292
14369
  "stability": "experimental",
14293
14370
  "summary": "Grants `Create`, `Update`, and `Delete` actions on the Gateway."
14294
14371
  },
14295
14372
  "locationInModule": {
14296
14373
  "filename": "lib/gateway/gateway-base.ts",
14297
- "line": 288
14374
+ "line": 294
14298
14375
  },
14299
14376
  "name": "grantManage",
14300
14377
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.IGateway",
@@ -14317,12 +14394,13 @@
14317
14394
  },
14318
14395
  {
14319
14396
  "docs": {
14397
+ "remarks": "[disable-awslint:no-grants]",
14320
14398
  "stability": "experimental",
14321
14399
  "summary": "Grants `Get` and `List` actions on the Gateway."
14322
14400
  },
14323
14401
  "locationInModule": {
14324
14402
  "filename": "lib/gateway/gateway-base.ts",
14325
- "line": 271
14403
+ "line": 275
14326
14404
  },
14327
14405
  "name": "grantRead",
14328
14406
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.IGateway",
@@ -14351,7 +14429,7 @@
14351
14429
  },
14352
14430
  "locationInModule": {
14353
14431
  "filename": "lib/gateway/gateway-base.ts",
14354
- "line": 314
14432
+ "line": 322
14355
14433
  },
14356
14434
  "name": "metric",
14357
14435
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.IGateway",
@@ -14404,7 +14482,7 @@
14404
14482
  },
14405
14483
  "locationInModule": {
14406
14484
  "filename": "lib/gateway/gateway-base.ts",
14407
- "line": 368
14485
+ "line": 376
14408
14486
  },
14409
14487
  "name": "metricDuration",
14410
14488
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.IGateway",
@@ -14430,7 +14508,7 @@
14430
14508
  },
14431
14509
  "locationInModule": {
14432
14510
  "filename": "lib/gateway/gateway-base.ts",
14433
- "line": 327
14511
+ "line": 335
14434
14512
  },
14435
14513
  "name": "metricInvocations",
14436
14514
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.IGateway",
@@ -14457,7 +14535,7 @@
14457
14535
  },
14458
14536
  "locationInModule": {
14459
14537
  "filename": "lib/gateway/gateway-base.ts",
14460
- "line": 358
14538
+ "line": 366
14461
14539
  },
14462
14540
  "name": "metricLatency",
14463
14541
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.IGateway",
@@ -14483,7 +14561,7 @@
14483
14561
  },
14484
14562
  "locationInModule": {
14485
14563
  "filename": "lib/gateway/gateway-base.ts",
14486
- "line": 341
14564
+ "line": 349
14487
14565
  },
14488
14566
  "name": "metricSystemErrors",
14489
14567
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.IGateway",
@@ -14510,7 +14588,7 @@
14510
14588
  },
14511
14589
  "locationInModule": {
14512
14590
  "filename": "lib/gateway/gateway-base.ts",
14513
- "line": 378
14591
+ "line": 386
14514
14592
  },
14515
14593
  "name": "metricTargetExecutionTime",
14516
14594
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.IGateway",
@@ -14536,7 +14614,7 @@
14536
14614
  },
14537
14615
  "locationInModule": {
14538
14616
  "filename": "lib/gateway/gateway-base.ts",
14539
- "line": 385
14617
+ "line": 393
14540
14618
  },
14541
14619
  "name": "metricTargetType",
14542
14620
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.IGateway",
@@ -14568,7 +14646,7 @@
14568
14646
  },
14569
14647
  "locationInModule": {
14570
14648
  "filename": "lib/gateway/gateway-base.ts",
14571
- "line": 334
14649
+ "line": 342
14572
14650
  },
14573
14651
  "name": "metricThrottles",
14574
14652
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.IGateway",
@@ -14594,7 +14672,7 @@
14594
14672
  },
14595
14673
  "locationInModule": {
14596
14674
  "filename": "lib/gateway/gateway-base.ts",
14597
- "line": 348
14675
+ "line": 356
14598
14676
  },
14599
14677
  "name": "metricUserErrors",
14600
14678
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.IGateway",
@@ -15515,13 +15593,13 @@
15515
15593
  },
15516
15594
  {
15517
15595
  "docs": {
15518
- "remarks": "This method grants the `SynchronizeGatewayTargets` permission, which is primarily\nneeded for MCP Server targets when you need to refresh the tool catalog after the\nMCP server's tools have changed.",
15596
+ "remarks": "This method grants the `SynchronizeGatewayTargets` permission, which is primarily\nneeded for MCP Server targets when you need to refresh the tool catalog after the\nMCP server's tools have changed.\n\n[disable-awslint:no-grants]",
15519
15597
  "stability": "experimental",
15520
15598
  "summary": "Grants permission to synchronize this gateway's targets."
15521
15599
  },
15522
15600
  "locationInModule": {
15523
15601
  "filename": "lib/gateway/targets/target.ts",
15524
- "line": 501
15602
+ "line": 503
15525
15603
  },
15526
15604
  "name": "grantSync",
15527
15605
  "parameters": [
@@ -15978,12 +16056,13 @@
15978
16056
  "methods": [
15979
16057
  {
15980
16058
  "docs": {
16059
+ "remarks": "[disable-awslint:no-grants]",
15981
16060
  "stability": "experimental",
15982
16061
  "summary": "Grants IAM actions to the IAM Principal."
15983
16062
  },
15984
16063
  "locationInModule": {
15985
16064
  "filename": "lib/gateway/targets/target-base.ts",
15986
- "line": 160
16065
+ "line": 162
15987
16066
  },
15988
16067
  "name": "grant",
15989
16068
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.IGatewayTarget",
@@ -16017,12 +16096,13 @@
16017
16096
  },
16018
16097
  {
16019
16098
  "docs": {
16099
+ "remarks": "[disable-awslint:no-grants]",
16020
16100
  "stability": "experimental",
16021
16101
  "summary": "Grants `Create`, `Update`, and `Delete` actions on the Gateway Target."
16022
16102
  },
16023
16103
  "locationInModule": {
16024
16104
  "filename": "lib/gateway/targets/target-base.ts",
16025
- "line": 190
16105
+ "line": 196
16026
16106
  },
16027
16107
  "name": "grantManage",
16028
16108
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.IGatewayTarget",
@@ -16045,12 +16125,13 @@
16045
16125
  },
16046
16126
  {
16047
16127
  "docs": {
16128
+ "remarks": "[disable-awslint:no-grants]",
16048
16129
  "stability": "experimental",
16049
16130
  "summary": "Grants `Get` and `List` actions on the Gateway Target."
16050
16131
  },
16051
16132
  "locationInModule": {
16052
16133
  "filename": "lib/gateway/targets/target-base.ts",
16053
- "line": 173
16134
+ "line": 177
16054
16135
  },
16055
16136
  "name": "grantRead",
16056
16137
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.IGatewayTarget",
@@ -21272,13 +21353,14 @@
21272
21353
  "methods": [
21273
21354
  {
21274
21355
  "docs": {
21356
+ "remarks": "[disable-awslint:no-grants]",
21275
21357
  "returns": "The Grant object for chaining",
21276
21358
  "stability": "experimental",
21277
21359
  "summary": "Grants the necessary permissions to the role."
21278
21360
  },
21279
21361
  "locationInModule": {
21280
21362
  "filename": "lib/memory/strategies/managed-strategy.ts",
21281
- "line": 210
21363
+ "line": 213
21282
21364
  },
21283
21365
  "name": "grant",
21284
21366
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.IMemoryStrategy",
@@ -22053,7 +22135,7 @@
22053
22135
  },
22054
22136
  "locationInModule": {
22055
22137
  "filename": "lib/memory/memory.ts",
22056
- "line": 652
22138
+ "line": 673
22057
22139
  },
22058
22140
  "parameters": [
22059
22141
  {
@@ -22079,7 +22161,7 @@
22079
22161
  "kind": "class",
22080
22162
  "locationInModule": {
22081
22163
  "filename": "lib/memory/memory.ts",
22082
- "line": 540
22164
+ "line": 561
22083
22165
  },
22084
22166
  "methods": [
22085
22167
  {
@@ -22090,7 +22172,7 @@
22090
22172
  },
22091
22173
  "locationInModule": {
22092
22174
  "filename": "lib/memory/memory.ts",
22093
- "line": 556
22175
+ "line": 577
22094
22176
  },
22095
22177
  "name": "fromMemoryAttributes",
22096
22178
  "parameters": [
@@ -22137,7 +22219,7 @@
22137
22219
  },
22138
22220
  "locationInModule": {
22139
22221
  "filename": "lib/memory/memory.ts",
22140
- "line": 734
22222
+ "line": 755
22141
22223
  },
22142
22224
  "name": "addMemoryStrategy",
22143
22225
  "parameters": [
@@ -22161,7 +22243,7 @@
22161
22243
  "immutable": true,
22162
22244
  "locationInModule": {
22163
22245
  "filename": "lib/memory/memory.ts",
22164
- "line": 543
22246
+ "line": 564
22165
22247
  },
22166
22248
  "name": "PROPERTY_INJECTION_ID",
22167
22249
  "static": true,
@@ -22177,7 +22259,7 @@
22177
22259
  "immutable": true,
22178
22260
  "locationInModule": {
22179
22261
  "filename": "lib/memory/memory.ts",
22180
- "line": 634
22262
+ "line": 655
22181
22263
  },
22182
22264
  "name": "grantPrincipal",
22183
22265
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.MemoryBase",
@@ -22196,7 +22278,7 @@
22196
22278
  "immutable": true,
22197
22279
  "locationInModule": {
22198
22280
  "filename": "lib/memory/memory.ts",
22199
- "line": 585
22281
+ "line": 606
22200
22282
  },
22201
22283
  "name": "memoryArn",
22202
22284
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.MemoryBase",
@@ -22215,7 +22297,7 @@
22215
22297
  "immutable": true,
22216
22298
  "locationInModule": {
22217
22299
  "filename": "lib/memory/memory.ts",
22218
- "line": 595
22300
+ "line": 616
22219
22301
  },
22220
22302
  "name": "memoryId",
22221
22303
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.MemoryBase",
@@ -22234,7 +22316,7 @@
22234
22316
  "immutable": true,
22235
22317
  "locationInModule": {
22236
22318
  "filename": "lib/memory/memory.ts",
22237
- "line": 590
22319
+ "line": 611
22238
22320
  },
22239
22321
  "name": "memoryName",
22240
22322
  "type": {
@@ -22252,7 +22334,7 @@
22252
22334
  "immutable": true,
22253
22335
  "locationInModule": {
22254
22336
  "filename": "lib/memory/memory.ts",
22255
- "line": 643
22337
+ "line": 664
22256
22338
  },
22257
22339
  "name": "memoryStrategies",
22258
22340
  "type": {
@@ -22272,7 +22354,7 @@
22272
22354
  "immutable": true,
22273
22355
  "locationInModule": {
22274
22356
  "filename": "lib/memory/memory.ts",
22275
- "line": 620
22357
+ "line": 641
22276
22358
  },
22277
22359
  "name": "createdAt",
22278
22360
  "optional": true,
@@ -22289,7 +22371,7 @@
22289
22371
  "immutable": true,
22290
22372
  "locationInModule": {
22291
22373
  "filename": "lib/memory/memory.ts",
22292
- "line": 608
22374
+ "line": 629
22293
22375
  },
22294
22376
  "name": "description",
22295
22377
  "optional": true,
@@ -22305,7 +22387,7 @@
22305
22387
  "immutable": true,
22306
22388
  "locationInModule": {
22307
22389
  "filename": "lib/memory/memory.ts",
22308
- "line": 612
22390
+ "line": 633
22309
22391
  },
22310
22392
  "name": "executionRole",
22311
22393
  "optional": true,
@@ -22322,7 +22404,7 @@
22322
22404
  "immutable": true,
22323
22405
  "locationInModule": {
22324
22406
  "filename": "lib/memory/memory.ts",
22325
- "line": 599
22407
+ "line": 620
22326
22408
  },
22327
22409
  "name": "expirationDuration",
22328
22410
  "optional": true,
@@ -22341,7 +22423,7 @@
22341
22423
  "immutable": true,
22342
22424
  "locationInModule": {
22343
22425
  "filename": "lib/memory/memory.ts",
22344
- "line": 604
22426
+ "line": 625
22345
22427
  },
22346
22428
  "name": "failureReason",
22347
22429
  "optional": true,
@@ -22357,7 +22439,7 @@
22357
22439
  "immutable": true,
22358
22440
  "locationInModule": {
22359
22441
  "filename": "lib/memory/memory.ts",
22360
- "line": 638
22442
+ "line": 659
22361
22443
  },
22362
22444
  "name": "kmsKey",
22363
22445
  "optional": true,
@@ -22374,7 +22456,7 @@
22374
22456
  "immutable": true,
22375
22457
  "locationInModule": {
22376
22458
  "filename": "lib/memory/memory.ts",
22377
- "line": 616
22459
+ "line": 637
22378
22460
  },
22379
22461
  "name": "status",
22380
22462
  "optional": true,
@@ -22392,7 +22474,7 @@
22392
22474
  "immutable": true,
22393
22475
  "locationInModule": {
22394
22476
  "filename": "lib/memory/memory.ts",
22395
- "line": 630
22477
+ "line": 651
22396
22478
  },
22397
22479
  "name": "tags",
22398
22480
  "optional": true,
@@ -22413,7 +22495,7 @@
22413
22495
  "immutable": true,
22414
22496
  "locationInModule": {
22415
22497
  "filename": "lib/memory/memory.ts",
22416
- "line": 624
22498
+ "line": 645
22417
22499
  },
22418
22500
  "name": "updatedAt",
22419
22501
  "optional": true,
@@ -22440,7 +22522,7 @@
22440
22522
  "kind": "interface",
22441
22523
  "locationInModule": {
22442
22524
  "filename": "lib/memory/memory.ts",
22443
- "line": 496
22525
+ "line": 517
22444
22526
  },
22445
22527
  "name": "MemoryAttributes",
22446
22528
  "properties": [
@@ -22456,7 +22538,7 @@
22456
22538
  "immutable": true,
22457
22539
  "locationInModule": {
22458
22540
  "filename": "lib/memory/memory.ts",
22459
- "line": 501
22541
+ "line": 522
22460
22542
  },
22461
22543
  "name": "memoryArn",
22462
22544
  "type": {
@@ -22475,7 +22557,7 @@
22475
22557
  "immutable": true,
22476
22558
  "locationInModule": {
22477
22559
  "filename": "lib/memory/memory.ts",
22478
- "line": 506
22560
+ "line": 527
22479
22561
  },
22480
22562
  "name": "roleArn",
22481
22563
  "type": {
@@ -22492,7 +22574,7 @@
22492
22574
  "immutable": true,
22493
22575
  "locationInModule": {
22494
22576
  "filename": "lib/memory/memory.ts",
22495
- "line": 526
22577
+ "line": 547
22496
22578
  },
22497
22579
  "name": "createdAt",
22498
22580
  "optional": true,
@@ -22510,7 +22592,7 @@
22510
22592
  "immutable": true,
22511
22593
  "locationInModule": {
22512
22594
  "filename": "lib/memory/memory.ts",
22513
- "line": 516
22595
+ "line": 537
22514
22596
  },
22515
22597
  "name": "kmsKeyArn",
22516
22598
  "optional": true,
@@ -22528,7 +22610,7 @@
22528
22610
  "immutable": true,
22529
22611
  "locationInModule": {
22530
22612
  "filename": "lib/memory/memory.ts",
22531
- "line": 521
22613
+ "line": 542
22532
22614
  },
22533
22615
  "name": "status",
22534
22616
  "optional": true,
@@ -22546,7 +22628,7 @@
22546
22628
  "immutable": true,
22547
22629
  "locationInModule": {
22548
22630
  "filename": "lib/memory/memory.ts",
22549
- "line": 511
22631
+ "line": 532
22550
22632
  },
22551
22633
  "name": "updatedAt",
22552
22634
  "optional": true,
@@ -22601,13 +22683,14 @@
22601
22683
  "methods": [
22602
22684
  {
22603
22685
  "docs": {
22686
+ "remarks": "[disable-awslint:no-grants]",
22604
22687
  "returns": "An IAM Grant object representing the granted permissions",
22605
22688
  "stability": "experimental",
22606
22689
  "summary": "Grants IAM actions to the IAM Principal."
22607
22690
  },
22608
22691
  "locationInModule": {
22609
22692
  "filename": "lib/memory/memory.ts",
22610
- "line": 212
22693
+ "line": 215
22611
22694
  },
22612
22695
  "name": "grant",
22613
22696
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.IMemory",
@@ -22642,13 +22725,14 @@
22642
22725
  {
22643
22726
  "docs": {
22644
22727
  "default": "- Default grant configuration:\n- actions: ['bedrock-agentcore:CreateMemory',\n'bedrock-agentcore:GetMemory',\n'bedrock-agentcore:DeleteMemory',\n'bedrock-agentcore:UpdateMemory'] on this.memoryArn",
22728
+ "remarks": "[disable-awslint:no-grants]",
22645
22729
  "returns": "An IAM Grant object representing the granted permissions",
22646
22730
  "stability": "experimental",
22647
22731
  "summary": "Grant the given principal identity permissions to manage the control plane of this memory."
22648
22732
  },
22649
22733
  "locationInModule": {
22650
22734
  "filename": "lib/memory/memory.ts",
22651
- "line": 323
22735
+ "line": 342
22652
22736
  },
22653
22737
  "name": "grantAdmin",
22654
22738
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.IMemory",
@@ -22672,14 +22756,14 @@
22672
22756
  {
22673
22757
  "docs": {
22674
22758
  "default": "- Default grant configuration:\n- actions: ['bedrock-agentcore:DeleteEvent',\n'bedrock-agentcore:DeleteMemoryRecord'] on this.memoryArn",
22675
- "remarks": "Both Short-Term Memory (STM) and Long-Term Memory (LTM).",
22759
+ "remarks": "Both Short-Term Memory (STM) and Long-Term Memory (LTM).\n\n[disable-awslint:no-grants]",
22676
22760
  "returns": "An IAM Grant object representing the granted permissions",
22677
22761
  "stability": "experimental",
22678
22762
  "summary": "Grant the given principal identity permissions to delete content on this memory."
22679
22763
  },
22680
22764
  "locationInModule": {
22681
22765
  "filename": "lib/memory/memory.ts",
22682
- "line": 287
22766
+ "line": 300
22683
22767
  },
22684
22768
  "name": "grantDelete",
22685
22769
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.IMemory",
@@ -22703,13 +22787,14 @@
22703
22787
  {
22704
22788
  "docs": {
22705
22789
  "default": "- Default grant configuration:\n- actions: ['bedrock-agentcore:DeleteMemoryRecord'] on this.memoryArn",
22790
+ "remarks": "[disable-awslint:no-grants]",
22706
22791
  "returns": "An IAM Grant object representing the granted permissions",
22707
22792
  "stability": "experimental",
22708
22793
  "summary": "Grant the given principal identity permissions to delete Long-Term Memory (LTM) content on this memory."
22709
22794
  },
22710
22795
  "locationInModule": {
22711
22796
  "filename": "lib/memory/memory.ts",
22712
- "line": 309
22797
+ "line": 326
22713
22798
  },
22714
22799
  "name": "grantDeleteLongTermMemory",
22715
22800
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.IMemory",
@@ -22733,13 +22818,14 @@
22733
22818
  {
22734
22819
  "docs": {
22735
22820
  "default": "- Default grant configuration:\n- actions: ['bedrock-agentcore:DeleteEvent'] on this.memoryArn",
22821
+ "remarks": "[disable-awslint:no-grants]",
22736
22822
  "returns": "An IAM Grant object representing the granted permissions",
22737
22823
  "stability": "experimental",
22738
22824
  "summary": "Grant the given principal identity permissions to delete Short-Term Memory (STM) content on this memory."
22739
22825
  },
22740
22826
  "locationInModule": {
22741
22827
  "filename": "lib/memory/memory.ts",
22742
- "line": 298
22828
+ "line": 313
22743
22829
  },
22744
22830
  "name": "grantDeleteShortTermMemory",
22745
22831
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.IMemory",
@@ -22763,13 +22849,14 @@
22763
22849
  {
22764
22850
  "docs": {
22765
22851
  "default": "- Default grant configuration:\n- actions: ['bedrock-agentcore:CreateEvent',\n'bedrock-agentcore:GetEvent',\n'bedrock-agentcore:DeleteEvent',\n'bedrock-agentcore:GetMemoryRecord',\n'bedrock-agentcore:RetrieveMemoryRecords',\n'bedrock-agentcore:ListMemoryRecords',\n'bedrock-agentcore:ListActors',\n'bedrock-agentcore:ListSessions',\n'bedrock-agentcore:CreateMemory',\n'bedrock-agentcore:GetMemory',\n'bedrock-agentcore:DeleteMemory',\n'bedrock-agentcore:UpdateMemory'] on this.memoryArn",
22852
+ "remarks": "[disable-awslint:no-grants]",
22766
22853
  "returns": "An IAM Grant object representing the granted permissions",
22767
22854
  "stability": "experimental",
22768
22855
  "summary": "Grant the given principal identity permissions to do every action on this memory."
22769
22856
  },
22770
22857
  "locationInModule": {
22771
22858
  "filename": "lib/memory/memory.ts",
22772
- "line": 345
22859
+ "line": 366
22773
22860
  },
22774
22861
  "name": "grantFullAccess",
22775
22862
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.IMemory",
@@ -22793,14 +22880,14 @@
22793
22880
  {
22794
22881
  "docs": {
22795
22882
  "default": "- Default grant configuration:\n- actions: ['bedrock-agentcore:GetMemoryRecord',\n'bedrock-agentcore:RetrieveMemoryRecords',\n'bedrock-agentcore:ListMemoryRecords',\n'bedrock-agentcore:ListActors',\n'bedrock-agentcore:ListSessions] on this.memoryArn",
22796
- "remarks": "Both Short-Term Memory (STM) and Long-Term Memory (LTM).",
22883
+ "remarks": "Both Short-Term Memory (STM) and Long-Term Memory (LTM).\n\n[disable-awslint:no-grants]",
22797
22884
  "returns": "An IAM Grant object representing the granted permissions",
22798
22885
  "stability": "experimental",
22799
22886
  "summary": "Grant the given principal identity permissions to read the contents of this memory."
22800
22887
  },
22801
22888
  "locationInModule": {
22802
22889
  "filename": "lib/memory/memory.ts",
22803
- "line": 244
22890
+ "line": 251
22804
22891
  },
22805
22892
  "name": "grantRead",
22806
22893
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.IMemory",
@@ -22824,13 +22911,14 @@
22824
22911
  {
22825
22912
  "docs": {
22826
22913
  "default": "- Default grant configuration:\n- actions: ['bedrock-agentcore:GetMemoryRecord',\n'bedrock-agentcore:RetrieveMemoryRecords',\n'bedrock-agentcore:ListMemoryRecords',\n'bedrock-agentcore:ListActors',\n'bedrock-agentcore:ListSessions',] on this.memoryArn",
22914
+ "remarks": "[disable-awslint:no-grants]",
22827
22915
  "returns": "An IAM Grant object representing the granted permissions",
22828
22916
  "stability": "experimental",
22829
22917
  "summary": "Grant the given principal identity permissions to read the Long-Term Memory (LTM) contents of this memory."
22830
22918
  },
22831
22919
  "locationInModule": {
22832
22920
  "filename": "lib/memory/memory.ts",
22833
- "line": 273
22921
+ "line": 284
22834
22922
  },
22835
22923
  "name": "grantReadLongTermMemory",
22836
22924
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.IMemory",
@@ -22854,13 +22942,14 @@
22854
22942
  {
22855
22943
  "docs": {
22856
22944
  "default": "- Default grant configuration:\n- actions: ['bedrock-agentcore:GetEvent',\n'bedrock-agentcore:ListEvents',\n'bedrock-agentcore:ListActors',\n'bedrock-agentcore:ListSessions',] on this.memoryArn",
22945
+ "remarks": "[disable-awslint:no-grants]",
22857
22946
  "returns": "An IAM Grant object representing the granted permissions",
22858
22947
  "stability": "experimental",
22859
22948
  "summary": "Grant the given principal identity permissions to read the Short-Term Memory (STM) contents of this memory."
22860
22949
  },
22861
22950
  "locationInModule": {
22862
22951
  "filename": "lib/memory/memory.ts",
22863
- "line": 258
22952
+ "line": 267
22864
22953
  },
22865
22954
  "name": "grantReadShortTermMemory",
22866
22955
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.IMemory",
@@ -22884,13 +22973,14 @@
22884
22973
  {
22885
22974
  "docs": {
22886
22975
  "default": "- Default grant configuration:\n- actions: ['bedrock-agentcore:CreateEvent'] on this.memoryArn",
22976
+ "remarks": "[disable-awslint:no-grants]",
22887
22977
  "returns": "An IAM Grant object representing the granted permissions",
22888
22978
  "stability": "experimental",
22889
22979
  "summary": "Grant the given principal identity permissions to write content to short-term memory."
22890
22980
  },
22891
22981
  "locationInModule": {
22892
22982
  "filename": "lib/memory/memory.ts",
22893
- "line": 228
22983
+ "line": 233
22894
22984
  },
22895
22985
  "name": "grantWrite",
22896
22986
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.IMemory",
@@ -22919,7 +23009,7 @@
22919
23009
  },
22920
23010
  "locationInModule": {
22921
23011
  "filename": "lib/memory/memory.ts",
22922
- "line": 358
23012
+ "line": 379
22923
23013
  },
22924
23014
  "name": "metric",
22925
23015
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.IMemory",
@@ -22962,7 +23052,7 @@
22962
23052
  },
22963
23053
  "locationInModule": {
22964
23054
  "filename": "lib/memory/memory.ts",
22965
- "line": 403
23055
+ "line": 424
22966
23056
  },
22967
23057
  "name": "metricErrorsForApiOperation",
22968
23058
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.IMemory",
@@ -22994,7 +23084,7 @@
22994
23084
  },
22995
23085
  "locationInModule": {
22996
23086
  "filename": "lib/memory/memory.ts",
22997
- "line": 409
23087
+ "line": 430
22998
23088
  },
22999
23089
  "name": "metricEventCreationCount",
23000
23090
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.IMemory",
@@ -23020,7 +23110,7 @@
23020
23110
  },
23021
23111
  "locationInModule": {
23022
23112
  "filename": "lib/memory/memory.ts",
23023
- "line": 370
23113
+ "line": 391
23024
23114
  },
23025
23115
  "name": "metricForApiOperation",
23026
23116
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.IMemory",
@@ -23058,7 +23148,7 @@
23058
23148
  },
23059
23149
  "locationInModule": {
23060
23150
  "filename": "lib/memory/memory.ts",
23061
- "line": 394
23151
+ "line": 415
23062
23152
  },
23063
23153
  "name": "metricInvocationsForApiOperation",
23064
23154
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.IMemory",
@@ -23091,7 +23181,7 @@
23091
23181
  },
23092
23182
  "locationInModule": {
23093
23183
  "filename": "lib/memory/memory.ts",
23094
- "line": 387
23184
+ "line": 408
23095
23185
  },
23096
23186
  "name": "metricLatencyForApiOperation",
23097
23187
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.IMemory",
@@ -23123,7 +23213,7 @@
23123
23213
  },
23124
23214
  "locationInModule": {
23125
23215
  "filename": "lib/memory/memory.ts",
23126
- "line": 416
23216
+ "line": 437
23127
23217
  },
23128
23218
  "name": "metricMemoryRecordCreationCount",
23129
23219
  "parameters": [
@@ -23303,7 +23393,7 @@
23303
23393
  "kind": "interface",
23304
23394
  "locationInModule": {
23305
23395
  "filename": "lib/memory/memory.ts",
23306
- "line": 441
23396
+ "line": 462
23307
23397
  },
23308
23398
  "name": "MemoryProps",
23309
23399
  "properties": [
@@ -23316,7 +23406,7 @@
23316
23406
  "immutable": true,
23317
23407
  "locationInModule": {
23318
23408
  "filename": "lib/memory/memory.ts",
23319
- "line": 448
23409
+ "line": 469
23320
23410
  },
23321
23411
  "name": "memoryName",
23322
23412
  "type": {
@@ -23333,7 +23423,7 @@
23333
23423
  "immutable": true,
23334
23424
  "locationInModule": {
23335
23425
  "filename": "lib/memory/memory.ts",
23336
- "line": 462
23426
+ "line": 483
23337
23427
  },
23338
23428
  "name": "description",
23339
23429
  "optional": true,
@@ -23351,7 +23441,7 @@
23351
23441
  "immutable": true,
23352
23442
  "locationInModule": {
23353
23443
  "filename": "lib/memory/memory.ts",
23354
- "line": 480
23444
+ "line": 501
23355
23445
  },
23356
23446
  "name": "executionRole",
23357
23447
  "optional": true,
@@ -23370,7 +23460,7 @@
23370
23460
  "immutable": true,
23371
23461
  "locationInModule": {
23372
23462
  "filename": "lib/memory/memory.ts",
23373
- "line": 455
23463
+ "line": 476
23374
23464
  },
23375
23465
  "name": "expirationDuration",
23376
23466
  "optional": true,
@@ -23388,7 +23478,7 @@
23388
23478
  "immutable": true,
23389
23479
  "locationInModule": {
23390
23480
  "filename": "lib/memory/memory.ts",
23391
- "line": 467
23481
+ "line": 488
23392
23482
  },
23393
23483
  "name": "kmsKey",
23394
23484
  "optional": true,
@@ -23406,7 +23496,7 @@
23406
23496
  "immutable": true,
23407
23497
  "locationInModule": {
23408
23498
  "filename": "lib/memory/memory.ts",
23409
- "line": 473
23499
+ "line": 494
23410
23500
  },
23411
23501
  "name": "memoryStrategies",
23412
23502
  "optional": true,
@@ -23429,7 +23519,7 @@
23429
23519
  "immutable": true,
23430
23520
  "locationInModule": {
23431
23521
  "filename": "lib/memory/memory.ts",
23432
- "line": 487
23522
+ "line": 508
23433
23523
  },
23434
23524
  "name": "tags",
23435
23525
  "optional": true,
@@ -24253,7 +24343,7 @@
24253
24343
  "kind": "interface",
24254
24344
  "locationInModule": {
24255
24345
  "filename": "lib/tools/browser.ts",
24256
- "line": 483
24346
+ "line": 490
24257
24347
  },
24258
24348
  "name": "RecordingConfig",
24259
24349
  "properties": [
@@ -24267,7 +24357,7 @@
24267
24357
  "immutable": true,
24268
24358
  "locationInModule": {
24269
24359
  "filename": "lib/tools/browser.ts",
24270
- "line": 488
24360
+ "line": 495
24271
24361
  },
24272
24362
  "name": "enabled",
24273
24363
  "optional": true,
@@ -24285,7 +24375,7 @@
24285
24375
  "immutable": true,
24286
24376
  "locationInModule": {
24287
24377
  "filename": "lib/tools/browser.ts",
24288
- "line": 494
24378
+ "line": 501
24289
24379
  },
24290
24380
  "name": "s3Location",
24291
24381
  "optional": true,
@@ -24973,7 +25063,7 @@
24973
25063
  },
24974
25064
  "locationInModule": {
24975
25065
  "filename": "lib/runtime/runtime-base.ts",
24976
- "line": 247
25066
+ "line": 249
24977
25067
  },
24978
25068
  "name": "addToRolePolicy",
24979
25069
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.IBedrockAgentRuntime",
@@ -24996,13 +25086,14 @@
24996
25086
  },
24997
25087
  {
24998
25088
  "docs": {
25089
+ "remarks": "[disable-awslint:no-grants]",
24999
25090
  "returns": "The Grant object for chaining",
25000
25091
  "stability": "experimental",
25001
25092
  "summary": "Grant the runtime specific actions on AWS resources."
25002
25093
  },
25003
25094
  "locationInModule": {
25004
25095
  "filename": "lib/runtime/runtime-base.ts",
25005
- "line": 233
25096
+ "line": 235
25006
25097
  },
25007
25098
  "name": "grant",
25008
25099
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.IBedrockAgentRuntime",
@@ -25044,12 +25135,13 @@
25044
25135
  },
25045
25136
  {
25046
25137
  "docs": {
25138
+ "remarks": "[disable-awslint:no-grants]",
25047
25139
  "stability": "experimental",
25048
25140
  "summary": "Permits an IAM principal to invoke this runtime both directly and on behalf of users Grants both bedrock-agentcore:InvokeAgentRuntime and bedrock-agentcore:InvokeAgentRuntimeForUser permissions."
25049
25141
  },
25050
25142
  "locationInModule": {
25051
25143
  "filename": "lib/runtime/runtime-base.ts",
25052
- "line": 284
25144
+ "line": 295
25053
25145
  },
25054
25146
  "name": "grantInvoke",
25055
25147
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.IBedrockAgentRuntime",
@@ -25072,12 +25164,13 @@
25072
25164
  },
25073
25165
  {
25074
25166
  "docs": {
25167
+ "remarks": "[disable-awslint:no-grants]",
25075
25168
  "stability": "experimental",
25076
25169
  "summary": "Permits an IAM principal to invoke this runtime Grants the bedrock-agentcore:InvokeAgentRuntime permission."
25077
25170
  },
25078
25171
  "locationInModule": {
25079
25172
  "filename": "lib/runtime/runtime-base.ts",
25080
- "line": 257
25173
+ "line": 262
25081
25174
  },
25082
25175
  "name": "grantInvokeRuntime",
25083
25176
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.IBedrockAgentRuntime",
@@ -25100,12 +25193,13 @@
25100
25193
  },
25101
25194
  {
25102
25195
  "docs": {
25196
+ "remarks": "[disable-awslint:no-grants]",
25103
25197
  "stability": "experimental",
25104
25198
  "summary": "Permits an IAM principal to invoke this runtime on behalf of a user Grants the bedrock-agentcore:InvokeAgentRuntimeForUser permission Required when using the X-Amzn-Bedrock-AgentCore-Runtime-User-Id header."
25105
25199
  },
25106
25200
  "locationInModule": {
25107
25201
  "filename": "lib/runtime/runtime-base.ts",
25108
- "line": 271
25202
+ "line": 279
25109
25203
  },
25110
25204
  "name": "grantInvokeRuntimeForUser",
25111
25205
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.IBedrockAgentRuntime",
@@ -25134,7 +25228,7 @@
25134
25228
  },
25135
25229
  "locationInModule": {
25136
25230
  "filename": "lib/runtime/runtime-base.ts",
25137
- "line": 301
25231
+ "line": 312
25138
25232
  },
25139
25233
  "name": "metric",
25140
25234
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.IBedrockAgentRuntime",
@@ -25177,7 +25271,7 @@
25177
25271
  },
25178
25272
  "locationInModule": {
25179
25273
  "filename": "lib/runtime/runtime-base.ts",
25180
- "line": 314
25274
+ "line": 325
25181
25275
  },
25182
25276
  "name": "metricInvocations",
25183
25277
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.IBedrockAgentRuntime",
@@ -25203,7 +25297,7 @@
25203
25297
  },
25204
25298
  "locationInModule": {
25205
25299
  "filename": "lib/runtime/runtime-base.ts",
25206
- "line": 321
25300
+ "line": 332
25207
25301
  },
25208
25302
  "name": "metricInvocationsAggregated",
25209
25303
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.IBedrockAgentRuntime",
@@ -25230,7 +25324,7 @@
25230
25324
  },
25231
25325
  "locationInModule": {
25232
25326
  "filename": "lib/runtime/runtime-base.ts",
25233
- "line": 352
25327
+ "line": 363
25234
25328
  },
25235
25329
  "name": "metricLatency",
25236
25330
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.IBedrockAgentRuntime",
@@ -25256,7 +25350,7 @@
25256
25350
  },
25257
25351
  "locationInModule": {
25258
25352
  "filename": "lib/runtime/runtime-base.ts",
25259
- "line": 366
25353
+ "line": 377
25260
25354
  },
25261
25355
  "name": "metricSessionCount",
25262
25356
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.IBedrockAgentRuntime",
@@ -25282,7 +25376,7 @@
25282
25376
  },
25283
25377
  "locationInModule": {
25284
25378
  "filename": "lib/runtime/runtime-base.ts",
25285
- "line": 373
25379
+ "line": 384
25286
25380
  },
25287
25381
  "name": "metricSessionsAggregated",
25288
25382
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.IBedrockAgentRuntime",
@@ -25308,7 +25402,7 @@
25308
25402
  },
25309
25403
  "locationInModule": {
25310
25404
  "filename": "lib/runtime/runtime-base.ts",
25311
- "line": 335
25405
+ "line": 346
25312
25406
  },
25313
25407
  "name": "metricSystemErrors",
25314
25408
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.IBedrockAgentRuntime",
@@ -25334,7 +25428,7 @@
25334
25428
  },
25335
25429
  "locationInModule": {
25336
25430
  "filename": "lib/runtime/runtime-base.ts",
25337
- "line": 328
25431
+ "line": 339
25338
25432
  },
25339
25433
  "name": "metricThrottles",
25340
25434
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.IBedrockAgentRuntime",
@@ -25360,7 +25454,7 @@
25360
25454
  },
25361
25455
  "locationInModule": {
25362
25456
  "filename": "lib/runtime/runtime-base.ts",
25363
- "line": 359
25457
+ "line": 370
25364
25458
  },
25365
25459
  "name": "metricTotalErrors",
25366
25460
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.IBedrockAgentRuntime",
@@ -25386,7 +25480,7 @@
25386
25480
  },
25387
25481
  "locationInModule": {
25388
25482
  "filename": "lib/runtime/runtime-base.ts",
25389
- "line": 342
25483
+ "line": 353
25390
25484
  },
25391
25485
  "name": "metricUserErrors",
25392
25486
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.IBedrockAgentRuntime",
@@ -27223,13 +27317,14 @@
27223
27317
  "methods": [
27224
27318
  {
27225
27319
  "docs": {
27320
+ "remarks": "[disable-awslint:no-grants]",
27226
27321
  "returns": "The Grant object for chaining",
27227
27322
  "stability": "experimental",
27228
27323
  "summary": "Grants the necessary permissions to the role."
27229
27324
  },
27230
27325
  "locationInModule": {
27231
27326
  "filename": "lib/memory/strategies/self-managed-strategy.ts",
27232
- "line": 226
27327
+ "line": 229
27233
27328
  },
27234
27329
  "name": "grant",
27235
27330
  "overrides": "@aws-cdk/aws-bedrock-agentcore-alpha.IMemoryStrategy",
@@ -28178,6 +28273,6 @@
28178
28273
  "symbolId": "lib/network/network-configuration:VpcConfigProps"
28179
28274
  }
28180
28275
  },
28181
- "version": "2.234.0-alpha.0",
28276
+ "version": "2.235.0-alpha.0",
28182
28277
  "fingerprint": "**********"
28183
28278
  }