konokenj.cdk-api-mcp-server 0.54.0__py3-none-any.whl → 0.56.0__py3-none-any.whl

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 (25) hide show
  1. cdk_api_mcp_server/__about__.py +1 -1
  2. cdk_api_mcp_server/resources/aws-cdk/constructs/@aws-cdk/aws-bedrock-agentcore-alpha/README.md +880 -19
  3. cdk_api_mcp_server/resources/aws-cdk/constructs/@aws-cdk/aws-bedrock-alpha/README.md +2 -2
  4. cdk_api_mcp_server/resources/aws-cdk/constructs/@aws-cdk/aws-imagebuilder-alpha/README.md +387 -0
  5. cdk_api_mcp_server/resources/aws-cdk/constructs/@aws-cdk/mixins-preview/README.md +53 -33
  6. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-apigatewayv2-integrations/integ.lambda-connect-disconnect-trigger.ts +2 -2
  7. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-cognito/README.md +2 -2
  8. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-ec2/README.md +1 -1
  9. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-ecr/README.md +1 -1
  10. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-ecs/README.md +44 -4
  11. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-opensearchservice/integ.opensearch.ebs.ts +1 -1
  12. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-rds/README.md +1 -1
  13. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-rds/integ.cluster-cloudwatch-logs-exports.ts +56 -0
  14. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-route53/README.md +32 -31
  15. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-route53/integ.zone-delegation-iam-stack.ts +66 -0
  16. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-s3-deployment/integ.bucket-deployment-big-response.ts +4 -0
  17. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-s3-deployment/integ.bucket-deployment-data.ts +15 -0
  18. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/aws-s3-deployment/integ.bucket-deployment-large-file.ts +3 -0
  19. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/custom-resources/README.md +56 -0
  20. cdk_api_mcp_server/resources/aws-cdk/constructs/aws-cdk-lib/custom-resources/integ.external-id.ts +80 -0
  21. {konokenj_cdk_api_mcp_server-0.54.0.dist-info → konokenj_cdk_api_mcp_server-0.56.0.dist-info}/METADATA +2 -2
  22. {konokenj_cdk_api_mcp_server-0.54.0.dist-info → konokenj_cdk_api_mcp_server-0.56.0.dist-info}/RECORD +25 -22
  23. {konokenj_cdk_api_mcp_server-0.54.0.dist-info → konokenj_cdk_api_mcp_server-0.56.0.dist-info}/WHEEL +0 -0
  24. {konokenj_cdk_api_mcp_server-0.54.0.dist-info → konokenj_cdk_api_mcp_server-0.56.0.dist-info}/entry_points.txt +0 -0
  25. {konokenj_cdk_api_mcp_server-0.54.0.dist-info → konokenj_cdk_api_mcp_server-0.56.0.dist-info}/licenses/LICENSE.txt +0 -0
@@ -24,6 +24,8 @@
24
24
 
25
25
  This 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.
26
26
 
27
+ > **Note:** Users need to ensure their CDK deployment role has the `iam:CreateServiceLinkedRole` permission for AgentCore service-linked roles.
28
+
27
29
  ## Table of contents
28
30
 
29
31
  - [AgentCore Runtime](#agentcore-runtime)
@@ -45,12 +47,87 @@ This construct library facilitates the deployment of Bedrock AgentCore primitive
45
47
  - [Code Interpreter Network Modes](#code-interpreter-network-modes)
46
48
  - [Basic Code Interpreter Creation](#basic-code-interpreter-creation)
47
49
  - [Code Interpreter IAM permissions](#code-interpreter-iam-permissions)
50
+ - [Gateway](#gateway)
51
+ - [Gateway Properties](#gateway-properties)
52
+ - [Basic Gateway Creation](#basic-gateway-creation)
53
+ - [Protocol configuration](#protocol-configuration)
54
+ - [Inbound authorization](#inbound-authorization)
55
+ - [Gateway with KMS Encryption](#gateway-with-kms-encryption)
56
+ - [Gateway with Custom Execution Role](#gateway-with-custom-execution-role)
57
+ - [Gateway IAM Permissions](#gateway-iam-permissions)
58
+ - [Gateway Target](#gateway-target)
59
+ - [Gateway Target Properties](#gateway-target-properties)
60
+ - [Targets types](#targets-types)
61
+ - [Outbound auth](#outbound-auth)
62
+ - [Api schema](#api-schema-for-openapi-and-smithy-target)
63
+ - [Basic Gateway Target Creation](#basic-gateway-target-creation)
64
+ - [Using addTarget methods (Recommended)](#using-addtarget-methods-recommended)
65
+ - [Using static factory methods](#using-static-factory-methods)
66
+ - [Lambda Target with Tool Schema](#tools-schema-for-lambda-target)
67
+ - [Smithy Model Target with OAuth](#api-schema-for-openapi-and-smithy-target)
68
+ - [Gateway Target IAM Permissions](#gateway-target-iam-permissions)
48
69
  - [Memory](#memory)
49
70
  - [Memory properties](#memory-properties)
50
71
  - [Basic Memory Creation](#basic-memory-creation)
51
72
  - [LTM Memory Extraction Stategies](#ltm-memory-extraction-stategies)
52
73
  - [Memory Strategy Methods](#memory-strategy-methods)
53
-
74
+ - [Amazon Bedrock AgentCore Construct Library](#amazon-bedrock-agentcore-construct-library)
75
+ - [Table of contents](#table-of-contents)
76
+ - [AgentCore Runtime](#agentcore-runtime)
77
+ - [Runtime Endpoints](#runtime-endpoints)
78
+ - [AgentCore Runtime Properties](#agentcore-runtime-properties)
79
+ - [Runtime Endpoint Properties](#runtime-endpoint-properties)
80
+ - [Creating a Runtime](#creating-a-runtime)
81
+ - [Option 1: Use an existing image in ECR](#option-1-use-an-existing-image-in-ecr)
82
+ - [Option 2: Use a local asset](#option-2-use-a-local-asset)
83
+ - [Granting Permissions to Invoke Bedrock Models or Inference Profiles](#granting-permissions-to-invoke-bedrock-models-or-inference-profiles)
84
+ - [Runtime Versioning](#runtime-versioning)
85
+ - [Managing Endpoints and Versions](#managing-endpoints-and-versions)
86
+ - [Step 1: Initial Deployment](#step-1-initial-deployment)
87
+ - [Step 2: Creating Custom Endpoints](#step-2-creating-custom-endpoints)
88
+ - [Step 3: Runtime Update Deployment](#step-3-runtime-update-deployment)
89
+ - [Step 4: Testing with Staging Endpoints](#step-4-testing-with-staging-endpoints)
90
+ - [Step 5: Promoting to Production](#step-5-promoting-to-production)
91
+ - [Creating Standalone Runtime Endpoints](#creating-standalone-runtime-endpoints)
92
+ - [Example: Creating an endpoint for an existing runtime](#example-creating-an-endpoint-for-an-existing-runtime)
93
+ - [Runtime Authentication Configuration](#runtime-authentication-configuration)
94
+ - [IAM Authentication (Default)](#iam-authentication-default)
95
+ - [Cognito Authentication](#cognito-authentication)
96
+ - [JWT Authentication](#jwt-authentication)
97
+ - [OAuth Authentication](#oauth-authentication)
98
+ - [Using a Custom IAM Role](#using-a-custom-iam-role)
99
+ - [Runtime Network Configuration](#runtime-network-configuration)
100
+ - [Public Network Mode (Default)](#public-network-mode-default)
101
+ - [VPC Network Mode](#vpc-network-mode)
102
+ - [Managing Security Groups with VPC Configuration](#managing-security-groups-with-vpc-configuration)
103
+ - [Browser](#browser)
104
+ - [Browser Network modes](#browser-network-modes)
105
+ - [Browser Properties](#browser-properties)
106
+ - [Basic Browser Creation](#basic-browser-creation)
107
+ - [Browser with Tags](#browser-with-tags)
108
+ - [Browser with VPC](#browser-with-vpc)
109
+ - [Browser with Recording Configuration](#browser-with-recording-configuration)
110
+ - [Browser with Custom Execution Role](#browser-with-custom-execution-role)
111
+ - [Browser with S3 Recording and Permissions](#browser-with-s3-recording-and-permissions)
112
+ - [Browser IAM Permissions](#browser-iam-permissions)
113
+ - [Code Interpreter](#code-interpreter)
114
+ - [Code Interpreter Network Modes](#code-interpreter-network-modes)
115
+ - [Code Interpreter Properties](#code-interpreter-properties)
116
+ - [Basic Code Interpreter Creation](#basic-code-interpreter-creation)
117
+ - [Code Interpreter with VPC](#code-interpreter-with-vpc)
118
+ - [Code Interpreter with Sandbox Network Mode](#code-interpreter-with-sandbox-network-mode)
119
+ - [Code Interpreter with Custom Execution Role](#code-interpreter-with-custom-execution-role)
120
+ - [Code Interpreter IAM Permissions](#code-interpreter-iam-permissions)
121
+ - [Code interpreter with tags](#code-interpreter-with-tags)
122
+ - [Memory](#memory)
123
+ - [Memory Properties](#memory-properties)
124
+ - [Basic Memory Creation](#basic-memory-creation)
125
+ - [LTM Memory Extraction Stategies](#ltm-memory-extraction-stategies)
126
+ - [Memory with Built-in Strategies](#memory-with-built-in-strategies)
127
+ - [Memory with custom Strategies](#memory-with-custom-strategies)
128
+ - [Memory with Custom Execution Role](#memory-with-custom-execution-role)
129
+ - [Memory with self-managed Strategies](#memory-with-self-managed-strategies)
130
+ - [Memory Strategy Methods](#memory-strategy-methods)
54
131
 
55
132
  ## AgentCore Runtime
56
133
 
@@ -118,27 +195,11 @@ const runtime = new agentcore.Runtime(this, "MyAgentRuntime", {
118
195
  });
119
196
  ```
120
197
 
121
- To grant the runtime permission to invoke a Bedrock model or inference profile:
122
-
123
- ```typescript fixture=default
124
- // Note: This example uses @aws-cdk/aws-bedrock-alpha which must be installed separately
125
- declare const runtime: agentcore.Runtime;
126
-
127
- // Create a cross-region inference profile for Claude 3.7 Sonnet
128
- const inferenceProfile = bedrock.CrossRegionInferenceProfile.fromConfig({
129
- geoRegion: bedrock.CrossRegionInferenceProfileRegion.US,
130
- model: bedrock.BedrockFoundationModel.ANTHROPIC_CLAUDE_3_7_SONNET_V1_0
131
- });
132
-
133
- // Grant the runtime permission to invoke the inference profile
134
- inferenceProfile.grantInvoke(runtime);
135
- ```
136
-
137
198
  #### Option 2: Use a local asset
138
199
 
139
200
  Reference a local directory containing a Dockerfile.
140
201
  Images are built from a local Docker context directory (with a Dockerfile), uploaded to Amazon Elastic Container Registry (ECR)
141
- by the CDK toolkit,and can be naturally referenced in your CDK app .
202
+ by the CDK toolkit,and can be naturally referenced in your CDK app.
142
203
 
143
204
  ```typescript
144
205
  const agentRuntimeArtifact = agentcore.AgentRuntimeArtifact.fromAsset(
@@ -151,6 +212,30 @@ const runtime = new agentcore.Runtime(this, "MyAgentRuntime", {
151
212
  });
152
213
  ```
153
214
 
215
+ ### Granting Permissions to Invoke Bedrock Models or Inference Profiles
216
+
217
+ To grant the runtime permissions to invoke Bedrock models or inference profiles:
218
+
219
+ ```typescript fixture=default
220
+ // Note: This example uses @aws-cdk/aws-bedrock-alpha which must be installed separately
221
+ declare const runtime: agentcore.Runtime;
222
+
223
+ // Define the Bedrock Foundation Model
224
+ const model = bedrock.BedrockFoundationModel.ANTHROPIC_CLAUDE_3_7_SONNET_V1_0;
225
+
226
+ // Grant the runtime permissions to invoke the model
227
+ model.grantInvoke(runtime);
228
+
229
+ // Create a cross-region inference profile for Claude 3.7 Sonnet
230
+ const inferenceProfile = bedrock.CrossRegionInferenceProfile.fromConfig({
231
+ geoRegion: bedrock.CrossRegionInferenceProfileRegion.US,
232
+ model: bedrock.BedrockFoundationModel.ANTHROPIC_CLAUDE_3_7_SONNET_V1_0
233
+ });
234
+
235
+ // Grant the runtime permissions to invoke the inference profile
236
+ inferenceProfile.grantInvoke(runtime);
237
+ ```
238
+
154
239
  ### Runtime Versioning
155
240
 
156
241
  Amazon Bedrock AgentCore automatically manages runtime versioning to ensure safe deployments and rollback capabilities.
@@ -418,6 +503,7 @@ const runtime = new agentcore.Runtime(this, "MyAgentRuntime", {
418
503
  // securityGroups: [mySecurityGroup],
419
504
  }),
420
505
  });
506
+
421
507
  ```
422
508
 
423
509
  #### Managing Security Groups with VPC Configuration
@@ -803,6 +889,781 @@ const codeInterpreter = new agentcore.CodeInterpreterCustom(this, "MyCodeInterpr
803
889
  });
804
890
  ```
805
891
 
892
+ ## Gateway
893
+
894
+ The Gateway construct provides a way to create Amazon Bedrock Agent Core Gateways, which serve as integration points between agents and external services.
895
+
896
+ ### Gateway Properties
897
+
898
+ | Name | Type | Required | Description |
899
+ |------|------|----------|-------------|
900
+ | `gatewayName` | `string` | Yes | The name of the gateway. Valid characters are a-z, A-Z, 0-9, _ (underscore) and - (hyphen). Maximum 100 characters |
901
+ | `description` | `string` | No | Optional description for the gateway. Maximum 200 characters |
902
+ | `protocolConfiguration` | `IGatewayProtocolConfig` | No | The protocol configuration for the gateway. Defaults to MCP protocol |
903
+ | `authorizerConfiguration` | `IGatewayAuthorizerConfig` | No | The authorizer configuration for the gateway. Defaults to Cognito |
904
+ | `exceptionLevel` | `GatewayExceptionLevel` | No | The verbosity of exception messages. Use DEBUG mode to see granular exception messages |
905
+ | `kmsKey` | `kms.IKey` | No | The AWS KMS key used to encrypt data associated with the gateway |
906
+ | `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 |
907
+ | `tags` | `{ [key: string]: string }` | No | Tags for the gateway. A list of key:value pairs of tags to apply to this Gateway resource |
908
+
909
+ ### Basic Gateway Creation
910
+
911
+ The protocol configuration defaults to MCP and the inbound auth configuration uses Cognito (it is automatically created on your behalf).
912
+
913
+ ```typescript fixture=default
914
+ // Create a basic gateway with default MCP protocol and Cognito authorizer
915
+ const gateway = new agentcore.Gateway(this, "MyGateway", {
916
+ gatewayName: "my-gateway",
917
+ });
918
+ ```
919
+
920
+ ### Protocol configuration
921
+
922
+ Currently MCP is the only protocol available. To configure it, use the `protocol` property with `McpProtocolConfiguration`:
923
+
924
+ - Instructions: Guidance for how to use the gateway with your tools
925
+ - Semantic search: Smart tool discovery that finds the right tools without typical limits. It improves accuracy by finding relevant tools based on context
926
+ - Supported versions: Which MCP protocol versions the gateway can use
927
+
928
+ ```typescript fixture=default
929
+ const gateway = new agentcore.Gateway(this, "MyGateway", {
930
+ gatewayName: "my-gateway",
931
+ protocolConfiguration: new agentcore.McpProtocolConfiguration({
932
+ instructions: "Use this gateway to connect to external MCP tools",
933
+ searchType: agentcore.McpGatewaySearchType.SEMANTIC,
934
+ supportedVersions: [agentcore.MCPProtocolVersion.MCP_2025_03_26],
935
+ }),
936
+ });
937
+ ```
938
+
939
+ ### Inbound authorization
940
+
941
+ Before you create your gateway, you must set up inbound authorization. Inbound authorization validates users who attempt to access targets through
942
+ your AgentCore gateway. By default, if not provided, the construct will create and configure Cognito as the default identity provider
943
+ (inbound Auth setup). AgentCore supports the following types of inbound authorization:
944
+
945
+ **JSON Web Token (JWT)** – A secure and compact token used for authorization. After creating the JWT, you specify it as the authorization
946
+ configuration when you create the gateway. You can create a JWT with any of the identity providers at Provider setup and configuration.
947
+
948
+ You can configure a custom authorization provider using the `inboundAuthorizer` property with `GatewayAuthorizer.usingCustomJwt()`.
949
+ You need to specify an OAuth discovery server and client IDs/audiences when you create the gateway. You can specify the following:
950
+
951
+ - Discovery Url — String that must match the pattern ^.+/\.well-known/openid-configuration$ for OpenID Connect discovery URLs
952
+ - At least one of the below options depending on the chosen identity provider.
953
+ - Allowed audiences — List of allowed audiences for JWT tokens
954
+ - Allowed clients — List of allowed client identifiers
955
+
956
+ ```typescript fixture=default
957
+ const gateway = new agentcore.Gateway(this, "MyGateway", {
958
+ gatewayName: "my-gateway",
959
+ authorizerConfiguration: agentcore.GatewayAuthorizer.usingCustomJwt({
960
+ discoveryUrl: "https://auth.example.com/.well-known/openid-configuration",
961
+ allowedAudience: ["my-app"],
962
+ allowedClients: ["my-client-id"],
963
+ }),
964
+ });
965
+ ```
966
+
967
+ **IAM** – Authorizes through the credentials of the AWS IAM identity trying to access the gateway.
968
+
969
+ ```typescript fixture=default
970
+ const gateway = new agentcore.Gateway(this, "MyGateway", {
971
+ gatewayName: "my-gateway",
972
+ authorizerConfiguration: agentcore.GatewayAuthorizer.usingAwsIam(),
973
+ });
974
+
975
+ // Grant access to a Lambda function's role
976
+ const lambdaRole = new iam.Role(this, "LambdaRole", {
977
+ assumedBy: new iam.ServicePrincipal("lambda.amazonaws.com"),
978
+ });
979
+
980
+ // The Lambda needs permission to invoke the gateway
981
+ gateway.grantInvoke(lambdaRole);
982
+ ```
983
+
984
+ ### Gateway with KMS Encryption
985
+
986
+ You can provide a KMS key, and configure the authorizer as well as the protocol configuration.
987
+
988
+ ```typescript fixture=default
989
+ // Create a KMS key for encryption
990
+ const encryptionKey = new kms.Key(this, "GatewayEncryptionKey", {
991
+ enableKeyRotation: true,
992
+ description: "KMS key for gateway encryption",
993
+ });
994
+
995
+ // Create gateway with KMS encryption
996
+ const gateway = new agentcore.Gateway(this, "MyGateway", {
997
+ gatewayName: "my-encrypted-gateway",
998
+ description: "Gateway with KMS encryption",
999
+ protocolConfiguration: new agentcore.McpProtocolConfiguration({
1000
+ instructions: "Use this gateway to connect to external MCP tools",
1001
+ searchType: agentcore.McpGatewaySearchType.SEMANTIC,
1002
+ supportedVersions: [agentcore.MCPProtocolVersion.MCP_2025_03_26],
1003
+ }),
1004
+ authorizerConfiguration: agentcore.GatewayAuthorizer.usingCustomJwt({
1005
+ discoveryUrl: "https://auth.example.com/.well-known/openid-configuration",
1006
+ allowedAudience: ["my-app"],
1007
+ allowedClients: ["my-client-id"],
1008
+ }),
1009
+ kmsKey: encryptionKey,
1010
+ exceptionLevel: agentcore.GatewayExceptionLevel.DEBUG,
1011
+ });
1012
+ ```
1013
+
1014
+ ### Gateway with Custom Execution Role
1015
+
1016
+ ```typescript fixture=default
1017
+ // Create a custom execution role
1018
+ const executionRole = new iam.Role(this, "GatewayExecutionRole", {
1019
+ assumedBy: new iam.ServicePrincipal("bedrock-agentcore.amazonaws.com"),
1020
+ managedPolicies: [
1021
+ iam.ManagedPolicy.fromAwsManagedPolicyName("AmazonBedrockAgentCoreGatewayExecutionRolePolicy"),
1022
+ ],
1023
+ });
1024
+
1025
+ // Create gateway with custom execution role
1026
+ const gateway = new agentcore.Gateway(this, "MyGateway", {
1027
+ gatewayName: "my-gateway",
1028
+ description: "Gateway with custom execution role",
1029
+ protocolConfiguration: new agentcore.McpProtocolConfiguration({
1030
+ instructions: "Use this gateway to connect to external MCP tools",
1031
+ searchType: agentcore.McpGatewaySearchType.SEMANTIC,
1032
+ supportedVersions: [agentcore.MCPProtocolVersion.MCP_2025_03_26],
1033
+ }),
1034
+ authorizerConfiguration: agentcore.GatewayAuthorizer.usingCustomJwt({
1035
+ discoveryUrl: "https://auth.example.com/.well-known/openid-configuration",
1036
+ allowedAudience: ["my-app"],
1037
+ allowedClients: ["my-client-id"],
1038
+ }),
1039
+ role: executionRole,
1040
+ });
1041
+ ```
1042
+
1043
+ ### Gateway IAM Permissions
1044
+
1045
+ The Gateway construct provides convenient methods for granting IAM permissions:
1046
+
1047
+ ```typescript fixture=default
1048
+ // Create a gateway
1049
+ const gateway = new agentcore.Gateway(this, "MyGateway", {
1050
+ gatewayName: "my-gateway",
1051
+ description: "Gateway for external service integration",
1052
+ protocolConfiguration: new agentcore.McpProtocolConfiguration({
1053
+ instructions: "Use this gateway to connect to external MCP tools",
1054
+ searchType: agentcore.McpGatewaySearchType.SEMANTIC,
1055
+ supportedVersions: [agentcore.MCPProtocolVersion.MCP_2025_03_26],
1056
+ }),
1057
+ authorizerConfiguration: agentcore.GatewayAuthorizer.usingCustomJwt({
1058
+ discoveryUrl: "https://auth.example.com/.well-known/openid-configuration",
1059
+ allowedAudience: ["my-app"],
1060
+ allowedClients: ["my-client-id"],
1061
+ }),
1062
+ });
1063
+
1064
+ // Create a role that needs access to the gateway
1065
+ const userRole = new iam.Role(this, "UserRole", {
1066
+ assumedBy: new iam.ServicePrincipal("lambda.amazonaws.com"),
1067
+ });
1068
+
1069
+ // Grant read permissions (Get and List actions)
1070
+ gateway.grantRead(userRole);
1071
+
1072
+ // Grant manage permissions (Create, Update, Delete actions)
1073
+ gateway.grantManage(userRole);
1074
+
1075
+ // Grant specific custom permissions
1076
+ gateway.grant(userRole, "bedrock-agentcore:GetGateway");
1077
+ ```
1078
+
1079
+ ## Gateway Target
1080
+
1081
+ After Creating gateways, you can add targets which define the tools that your gateway will host. Gateway supports multiple target
1082
+ types including Lambda functions and API specifications (either OpenAPI schemas or Smithy models). Gateway allows you to attach multiple
1083
+ targets to a Gateway and you can change the targets / tools attached to a gateway at any point. Each target can have its own
1084
+ credential provider attached enabling you to securely access targets whether they need IAM, API Key, or OAuth credentials.
1085
+
1086
+ ### Gateway Target Properties
1087
+
1088
+ | Name | Type | Required | Description |
1089
+ |------|------|----------|-------------|
1090
+ | `gatewayTargetName` | `string` | Yes | The name of the gateway target. Valid characters are a-z, A-Z, 0-9, _ (underscore) and - (hyphen) |
1091
+ | `description` | `string` | No | Optional description for the gateway target. Maximum 200 characters |
1092
+ | `gateway` | `IGateway` | Yes | The gateway this target belongs to |
1093
+ | `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). |
1094
+ | `credentialProviderConfigurations` | `IGatewayCredentialProvider[]` | No | Credential providers for authentication. Defaults to `[GatewayCredentialProvider.fromIamRole()]`. Use `GatewayCredentialProvider.fromApiKeyIdentityArn()`, `GatewayCredentialProvider.fromOauthIdentityArn()`, or `GatewayCredentialProvider.fromIamRole()` |
1095
+ | `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> |
1096
+
1097
+ This approach gives you full control over the configuration but is typically not necessary for most use cases.
1098
+
1099
+ ### Targets types
1100
+
1101
+ You can create the following targets types:
1102
+
1103
+ **Lambda Target**: Lambda targets allow you to connect your gateway to AWS Lambda functions that implement your tools. This is useful
1104
+ when you want to execute custom code in response to tool invocations.
1105
+
1106
+ - Supports GATEWAY_IAM_ROLE credential provider only
1107
+ - Ideal for custom serverless function integration
1108
+ - Need tool schema (tool schema is a blueprint that describes the functions your Lambda provides to AI agents).
1109
+ The construct provide [3 ways to upload a tool schema to Lambda target](#tools-schema-for-lambda-target)
1110
+ - When using the default IAM authentication (no `credentialProviderConfigurations` specified),
1111
+ the construct automatocally grants the gateway role permission to invoke your Lambda function (`lambda:InvokeFunction`).
1112
+
1113
+ **OpenAPI Schema Target** : OpenAPI widely used standard for describing RESTful APIs. Gateway supports OpenAPI 3.0
1114
+ specifications for defining API targets. It connects to REST APIs using OpenAPI specifications
1115
+
1116
+ - Supports OAUTH and API_KEY credential providers (Do not support IAM, you must provide `credentialProviderConfigurations`)
1117
+ - Ideal for integrating with external REST services
1118
+ - Need API schema. The construct provide [3 ways to upload a API schema to OpenAPI target](#api-schema-for-openapi-and-smithy-target)
1119
+
1120
+ **Smithy Model Target** : Smithy is a language for defining services and software development kits (SDKs). Smithy models provide
1121
+ a more structured approach to defining APIs compared to OpenAPI, and are particularly useful for connecting to AWS services.
1122
+ AgentCore Gateway supports built-in AWS service models only. It connects to services using Smithy model definitions
1123
+
1124
+ - Supports OAUTH and API_KEY credential providers
1125
+ - Ideal for AWS service integrations
1126
+ - Need API schema. The construct provide 3 ways to upload a API schema to Smity target
1127
+ - When using the default IAM authentication (no `credentialProviderConfigurations` specified), The construct only
1128
+ grants permission to read the Smithy schema file from S3. You MUST manually grant permissions for the gateway
1129
+ role to invoke the actual Smithy API endpoints
1130
+
1131
+ > Note: For Smithy model targets that access AWS services, your Gateway's execution role needs permissions to access those services.
1132
+ For example, for a DynamoDB target, your execution role needs permissions to perform DynamoDB operations.
1133
+ This is not managed by the construct due to the large number of options. Please refer to
1134
+ [Smithy Model Permission](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/gateway-prerequisites-permissions.html) for example.
1135
+
1136
+ **MCP Server Target**: Model Context Protocol (MCP) servers provide external tools, data access, and custom functions for AI agents.
1137
+ MCP servers enable agents to interact with external systems and services through a standardized protocol. Gateway automatically
1138
+ discovers and indexes available tools from MCP servers through synchronization.
1139
+
1140
+ **Key Features:**
1141
+
1142
+ - Requires explicit authentication configuration (OAuth2 recommended, empty array for NoAuth)
1143
+ - Ideal for connecting to external MCP-compliant servers
1144
+ - The endpoint must use HTTPS protocol
1145
+ - Supported MCP protocol versions: 2025-06-18, 2025-03-26
1146
+ - Automatic tool discovery through synchronization
1147
+
1148
+ **Synchronization Behavior:**
1149
+
1150
+ MCP Server targets require synchronization to discover and index available tools:
1151
+
1152
+ - **Implicit Synchronization (Automatic)**: Tool discovery happens automatically during:
1153
+ - Target creation (`CreateGatewayTarget`)
1154
+ - Target updates (`UpdateGatewayTarget`)
1155
+ - The Gateway calls the MCP server's `tools/list` endpoint and indexes tools without user intervention
1156
+
1157
+ - **Explicit Synchronization (Manual)**: When the MCP server's tools change independently (new tools added, schemas modified, tools removed):
1158
+ - The Gateway's tool catalog becomes stale
1159
+ - Call the `SynchronizeGatewayTargets` API to refresh the catalog
1160
+ - Use the `grantSync()` method to grant permissions to Lambda functions, CI/CD pipelines, or scheduled tasks that will trigger synchronization
1161
+
1162
+ **Authentication & Permissions:**
1163
+
1164
+ When using OAuth2, the Gateway service role automatically receives:
1165
+
1166
+ - `bedrock-agentcore:GetWorkloadAccessToken`
1167
+ - `bedrock-agentcore:GetResourceOauth2Token`
1168
+ - `secretsmanager:GetSecretValue`
1169
+ - KMS decrypt (if secrets are encrypted)
1170
+
1171
+ For explicit synchronization, use `grantSync()` to grant `bedrock-agentcore:SynchronizeGatewayTargets` permission to your operator roles.
1172
+
1173
+ > For more information, refer to the [MCP Server Target documentation](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/gateway-target-MCPservers.html).
1174
+
1175
+ ### Understanding Tool Naming
1176
+
1177
+ When 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.
1178
+
1179
+ **Naming Pattern:**
1180
+
1181
+ **Example:**
1182
+
1183
+ If 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`.
1184
+
1185
+ **Important Considerations:**
1186
+
1187
+ - **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.
1188
+ - **For MCP Server Targets**: The MCP server receives tool calls with the prefixed name from the gateway.
1189
+ - **For OpenAPI/Smithy Targets**: The gateway handles the prefix automatically when mapping to API operations based on the `operationId`.
1190
+
1191
+ This naming convention ensures that:
1192
+
1193
+ - Tools from different targets don't collide even if they have the same name
1194
+ - Agents can access tools from multiple targets through a single gateway
1195
+ - Tool names remain unique in the unified tool catalog
1196
+
1197
+ For more details, see the [Gateway Tool Naming Documentation](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/gateway-tool-naming.html).
1198
+
1199
+ ### Tools schema For Lambda target
1200
+
1201
+ The lambda target need tools schema to understand the fuunction lambda provides. You can upload the tool schema by following 3 ways:
1202
+
1203
+ - From a local asset file
1204
+
1205
+ ```typescript
1206
+ const toolSchema = agentcore.ToolSchema.fromLocalAsset(
1207
+ path.join(__dirname, "schemas", "my-tool-schema.json")
1208
+ );
1209
+ ```
1210
+
1211
+ - From an existing S3 file:
1212
+
1213
+ ```typescript
1214
+
1215
+ const toolSchema = agentcore.ToolSchema.fromS3File(
1216
+ s3.Bucket.fromBucketName(this, "SchemasBucket", "my-schemas-bucket"),
1217
+ "tools/complex-tool-schema.json",
1218
+ "123456789012"
1219
+ );
1220
+ ```
1221
+
1222
+ - From Inline:
1223
+
1224
+ ```typescript
1225
+ const toolSchema = agentcore.ToolSchema.fromInline([{
1226
+ name: "hello_world",
1227
+ description: "A simple hello world tool",
1228
+ inputSchema: {
1229
+ type: agentcore.SchemaDefinitionType.OBJECT,
1230
+ properties: {
1231
+ name: {
1232
+ type: agentcore.SchemaDefinitionType.STRING,
1233
+ description: "The name to greet",
1234
+ },
1235
+ },
1236
+ required: ["name"],
1237
+ },
1238
+ }]);
1239
+
1240
+ ```
1241
+
1242
+ ### Api schema For OpenAPI and Smithy target
1243
+
1244
+ The OpenAPI and Smithy target need API Schema. The Gateway construct provide three ways to upload API schema for your target:
1245
+
1246
+ - From a local asset file (requires binding to scope):
1247
+
1248
+ ```typescript fixture=default
1249
+ // When using ApiSchema.fromLocalAsset, you must bind the schema to a scope
1250
+ const schema = agentcore.ApiSchema.fromLocalAsset(path.join(__dirname, "mySchema.yml"));
1251
+
1252
+ schema.bind(this);
1253
+ ```
1254
+
1255
+ - From an inline schema:
1256
+
1257
+ ```typescript fixture=default
1258
+ const inlineSchema = agentcore.ApiSchema.fromInline(`
1259
+ openapi: 3.0.3
1260
+ info:
1261
+ title: Library API
1262
+ version: 1.0.0
1263
+ paths:
1264
+ /search:
1265
+ get:
1266
+ summary: Search for books
1267
+ operationId: searchBooks
1268
+ parameters:
1269
+ - name: query
1270
+ in: query
1271
+ required: true
1272
+ schema:
1273
+ type: string
1274
+ `);
1275
+ ```
1276
+
1277
+ - From an existing S3 file:
1278
+
1279
+ ```typescript fixture=default
1280
+ const bucket = s3.Bucket.fromBucketName(this, "ExistingBucket", "my-schema-bucket");
1281
+ const s3Schema = agentcore.ApiSchema.fromS3File(bucket, "schemas/action-group.yaml");
1282
+ ```
1283
+
1284
+ ### Outbound auth
1285
+
1286
+ Outbound authorization lets Amazon Bedrock AgentCore gateways securely access gateway targets on behalf of users authenticated
1287
+ and authorized during Inbound Auth.
1288
+
1289
+ AgentCore Gateway supports the following types of outbound authorization:
1290
+
1291
+ **IAM-based outbound authorization** – The gateway uses its execution role to authenticate with AWS services. This is the default
1292
+ and most common approach for Lambda targets and AWS service integrations.
1293
+
1294
+ **2-legged OAuth (OAuth 2LO)** – Use OAuth 2.0 two-legged flow (2LO) for targets that require OAuth authentication.
1295
+ The gateway authenticates on its own behalf, not on behalf of a user.
1296
+
1297
+ **API key** – Use the AgentCore service/AWS console to generate an API key to authenticate access to the gateway target.
1298
+
1299
+ **Note > You need to set up the outbound identity before you can create a gateway target.
1300
+
1301
+ ### Basic Gateway Target Creation
1302
+
1303
+ You can create targets in two ways: using the static factory methods on `GatewayTarget` or using the convenient `addTarget` methods on the gateway instance.
1304
+
1305
+ #### Using addTarget methods (Recommended)
1306
+
1307
+ Below are the examples on how you can create Lambda , Smity and OpenAPI target using `addTarget` method.
1308
+
1309
+ ```typescript fixture=default
1310
+ // Create a gateway first
1311
+ const gateway = new agentcore.Gateway(this, "MyGateway", {
1312
+ gatewayName: "my-gateway",
1313
+ });
1314
+
1315
+ const lambdaFunction = new lambda.Function(this, "MyFunction", {
1316
+ runtime: lambda.Runtime.NODEJS_22_X,
1317
+ handler: "index.handler",
1318
+ code: lambda.Code.fromInline(`
1319
+ exports.handler = async (event) => {
1320
+ return {
1321
+ statusCode: 200,
1322
+ body: JSON.stringify({ message: 'Hello from Lambda!' })
1323
+ };
1324
+ };
1325
+ `),
1326
+ });
1327
+
1328
+ const lambdaTarget = gateway.addLambdaTarget("MyLambdaTarget", {
1329
+ gatewayTargetName: "my-lambda-target",
1330
+ description: "Lambda function target",
1331
+ lambdaFunction: lambdaFunction,
1332
+ toolSchema: agentcore.ToolSchema.fromInline([
1333
+ {
1334
+ name: "hello_world",
1335
+ description: "A simple hello world tool",
1336
+ inputSchema: {
1337
+ type: agentcore.SchemaDefinitionType.OBJECT,
1338
+ properties: {
1339
+ name: {
1340
+ type: agentcore.SchemaDefinitionType.STRING,
1341
+ description: "The name to greet",
1342
+ },
1343
+ },
1344
+ required: ["name"],
1345
+ },
1346
+ },
1347
+ ]),
1348
+ });
1349
+ ```
1350
+
1351
+ - OpenAPI Target
1352
+
1353
+ ``` typescript
1354
+ const gateway = new agentcore.Gateway(this, "MyGateway", {
1355
+ gatewayName: "my-gateway",
1356
+ });
1357
+
1358
+ // These ARNs are returned when creating the API key credential provider via Console or API
1359
+ const apiKeyProviderArn = "arn:aws:bedrock-agentcore:us-east-1:123456789012:token-vault/abc123/apikeycredentialprovider/my-apikey"
1360
+ const apiKeySecretArn = "arn:aws:secretsmanager:us-east-1:123456789012:secret:my-apikey-secret-abc123"
1361
+
1362
+ const bucket = s3.Bucket.fromBucketName(this, "ExistingBucket", "my-schema-bucket");
1363
+ const s3mySchema = agentcore.ApiSchema.fromS3File(bucket, "schemas/myschema.yaml");
1364
+
1365
+ // Add an OpenAPI target directly to the gateway
1366
+ const target = gateway.addOpenApiTarget("MyTarget", {
1367
+ gatewayTargetName: "my-api-target",
1368
+ description: "Target for external API integration",
1369
+ apiSchema: s3mySchema,
1370
+ credentialProviderConfigurations: [
1371
+ agentcore.GatewayCredentialProvider.fromApiKeyIdentityArn({
1372
+ providerArn: apiKeyProviderArn,
1373
+ secretArn: apiKeySecretArn,
1374
+ credentialLocation: agentcore.ApiKeyCredentialLocation.header({
1375
+ credentialParameterName: "X-API-Key",
1376
+ }),
1377
+ }),
1378
+ ],
1379
+ });
1380
+
1381
+ // This make sure your s3 bucket is available before target
1382
+ target.node.addDependency(bucket);
1383
+ ```
1384
+
1385
+ - Smithy Target
1386
+
1387
+ ```typescript fixture=default
1388
+
1389
+ const gateway = new agentcore.Gateway(this, "MyGateway", {
1390
+ gatewayName: "my-gateway",
1391
+ });
1392
+
1393
+ const smithySchema = agentcore.ApiSchema.fromLocalAsset(
1394
+ path.join(__dirname, "models", "smithy-model.json")
1395
+ );
1396
+ smithySchema.bind(this);
1397
+
1398
+ const smithyTarget = gateway.addSmithyTarget("MySmithyTarget", {
1399
+ gatewayTargetName: "my-smithy-target",
1400
+ description: "Smithy model target",
1401
+ smithyModel: smithySchema,
1402
+
1403
+ });
1404
+ ```
1405
+
1406
+ - MCP Server Target
1407
+
1408
+ ```typescript fixture=default
1409
+ const gateway = new agentcore.Gateway(this, "MyGateway", {
1410
+ gatewayName: "my-gateway",
1411
+ });
1412
+
1413
+ // OAuth2 authentication (recommended)
1414
+ // Note: Create the OAuth provider using AWS console or Identity L2 construct when available
1415
+ const oauthProviderArn = "arn:aws:bedrock-agentcore:us-east-1:123456789012:token-vault/abc123/oauth2credentialprovider/my-oauth";
1416
+ const oauthSecretArn = "arn:aws:secretsmanager:us-east-1:123456789012:secret:my-oauth-secret-abc123";
1417
+
1418
+ // Add an MCP server target directly to the gateway
1419
+ const mcpTarget = gateway.addMcpServerTarget("MyMcpServer", {
1420
+ gatewayTargetName: "my-mcp-server",
1421
+ description: "External MCP server integration",
1422
+ endpoint: "https://my-mcp-server.example.com",
1423
+ credentialProviderConfigurations: [
1424
+ agentcore.GatewayCredentialProvider.fromOauthIdentityArn({
1425
+ providerArn: oauthProviderArn,
1426
+ secretArn: oauthSecretArn,
1427
+ scopes:['mcp-runtime-server/invoke']
1428
+ }),
1429
+ ],
1430
+ });
1431
+
1432
+ // Grant sync permission to a Lambda function that will trigger synchronization
1433
+ const syncFunction = new lambda.Function(this, "SyncFunction", {
1434
+ runtime: lambda.Runtime.PYTHON_3_12,
1435
+ handler: "index.handler",
1436
+ code: lambda.Code.fromInline(`
1437
+ import boto3
1438
+
1439
+ def handler(event, context):
1440
+ client = boto3.client('bedrock-agentcore')
1441
+ response = client.synchronize_gateway_targets(
1442
+ gatewayIdentifier=event['gatewayId'],
1443
+ targetIds=[event['targetId']]
1444
+ )
1445
+ return response
1446
+ `),
1447
+ });
1448
+
1449
+ mcpTarget.grantSync(syncFunction);
1450
+ ```
1451
+
1452
+ #### Using static factory methods
1453
+
1454
+ Create Gateway target using static convienence method.
1455
+
1456
+ - Lambda Target
1457
+
1458
+ ```typescript fixture=default
1459
+ const gateway = new agentcore.Gateway(this, "MyGateway", {
1460
+ gatewayName: "my-gateway",
1461
+ });
1462
+
1463
+ const lambdaFunction = new lambda.Function(this, "MyFunction", {
1464
+ runtime: lambda.Runtime.NODEJS_22_X,
1465
+ handler: "index.handler",
1466
+ code: lambda.Code.fromInline(`
1467
+ exports.handler = async (event) => {
1468
+ return {
1469
+ statusCode: 200,
1470
+ body: JSON.stringify({ message: 'Hello from Lambda!' })
1471
+ };
1472
+ };
1473
+ `),
1474
+ });
1475
+
1476
+ // Create a gateway target with Lambda and tool schema
1477
+ const target = agentcore.GatewayTarget.forLambda(this, "MyLambdaTarget", {
1478
+ gatewayTargetName: "my-lambda-target",
1479
+ description: "Target for Lambda function integration",
1480
+ gateway: gateway,
1481
+ lambdaFunction: lambdaFunction,
1482
+ toolSchema: agentcore.ToolSchema.fromLocalAsset(
1483
+ path.join(__dirname, "schemas", "my-tool-schema.json")
1484
+ ),
1485
+ });
1486
+ ```
1487
+
1488
+ - OpenAPI Target
1489
+
1490
+ ```typescript fixture=default
1491
+
1492
+ const gateway = new agentcore.Gateway(this, "MyGateway", {
1493
+ gatewayName: "my-gateway",
1494
+ });
1495
+
1496
+ // outbound auth (Use AWS console to create it, Once Identity L2 construct is available you can use it to create identity)
1497
+ const apiKeyIdentityArn = "arn:aws:bedrock-agentcore:us-east-1:123456789012:token-vault/abc123/apikeycredentialprovider/my-apikey"
1498
+ const apiKeySecretArn = "arn:aws:secretsmanager:us-east-1:123456789012:secret:my-apikey-secret-abc123"
1499
+
1500
+ const opneapiSchema = agentcore.ApiSchema.fromLocalAsset(path.join(__dirname, "mySchema.yml"));
1501
+ opneapiSchema.bind(this);
1502
+
1503
+ // Create a gateway target with OpenAPI Schema
1504
+ const target = agentcore.GatewayTarget.forOpenApi(this, "MyTarget", {
1505
+ gatewayTargetName: "my-api-target",
1506
+ description: "Target for external API integration",
1507
+ gateway: gateway, // Note: you need to pass the gateway reference
1508
+ apiSchema: opneapiSchema,
1509
+ credentialProviderConfigurations: [
1510
+ agentcore.GatewayCredentialProvider.fromApiKeyIdentityArn({
1511
+ providerArn: apiKeyIdentityArn,
1512
+ secretArn: apiKeySecretArn
1513
+ }),
1514
+ ],
1515
+ });
1516
+
1517
+ ```
1518
+
1519
+ - Smithy Target
1520
+
1521
+ ```typescript fixture=default
1522
+
1523
+ const gateway = new agentcore.Gateway(this, "MyGateway", {
1524
+ gatewayName: "my-gateway",
1525
+ });
1526
+
1527
+ const smithySchema = agentcore.ApiSchema.fromLocalAsset(
1528
+ path.join(__dirname, "models", "smithy-model.json")
1529
+ );
1530
+ smithySchema.bind(this);
1531
+
1532
+ // Create a gateway target with Smithy Model and OAuth
1533
+ const target = agentcore.GatewayTarget.forSmithy(this, "MySmithyTarget", {
1534
+ gatewayTargetName: "my-smithy-target",
1535
+ description: "Target for Smithy model integration",
1536
+ gateway: gateway,
1537
+ smithyModel: smithySchema,
1538
+ });
1539
+
1540
+ ```
1541
+
1542
+ - MCP Server Target
1543
+
1544
+ ```typescript fixture=default
1545
+ const gateway = new agentcore.Gateway(this, "MyGateway", {
1546
+ gatewayName: "my-gateway",
1547
+ });
1548
+
1549
+ // OAuth2 authentication (recommended)
1550
+ // Note: Create the OAuth provider using AWS console or Identity L2 construct when available
1551
+ const oauthProviderArn = "arn:aws:bedrock-agentcore:us-east-1:123456789012:token-vault/abc123/oauth2credentialprovider/my-oauth";
1552
+ const oauthSecretArn = "arn:aws:secretsmanager:us-east-1:123456789012:secret:my-oauth-secret-abc123";
1553
+
1554
+ // Create a gateway target with MCP Server
1555
+ const mcpTarget = agentcore.GatewayTarget.forMcpServer(this, "MyMcpServer", {
1556
+ gatewayTargetName: "my-mcp-server",
1557
+ description: "External MCP server integration",
1558
+ gateway: gateway,
1559
+ endpoint: "https://my-mcp-server.example.com",
1560
+ credentialProviderConfigurations: [
1561
+ agentcore.GatewayCredentialProvider.fromOauthIdentityArn({
1562
+ providerArn: oauthProviderArn,
1563
+ secretArn: oauthSecretArn,
1564
+ scopes:['mcp-runtime-server/invoke']
1565
+ }),
1566
+ ],
1567
+ });
1568
+ ```
1569
+
1570
+ ### Advanced Usage: Direct Configuration for gateway target
1571
+
1572
+ For 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.
1573
+
1574
+ #### Configuration Factory Methods
1575
+
1576
+ Each target type has a corresponding configuration class with a static `create()` method:
1577
+
1578
+ - **Lambda**: `LambdaTargetConfiguration.create(lambdaFunction, toolSchema)`
1579
+ - **OpenAPI**: `OpenApiTargetConfiguration.create(apiSchema, validateSchema?)`
1580
+ - **Smithy**: `SmithyTargetConfiguration.create(smithyModel)`
1581
+
1582
+ #### Example: Lambda Target with Custom Configuration
1583
+
1584
+ ```typescript
1585
+ const gateway = new agentcore.Gateway(this, "MyGateway", {
1586
+ gatewayName: "my-gateway",
1587
+ });
1588
+
1589
+ const myLambdaFunction = new lambda.Function(this, "MyFunction", {
1590
+ runtime: lambda.Runtime.NODEJS_22_X,
1591
+ handler: "index.handler",
1592
+ code: lambda.Code.fromInline(`
1593
+ exports.handler = async (event) => ({ statusCode: 200 });
1594
+ `),
1595
+ });
1596
+
1597
+ const myToolSchema = agentcore.ToolSchema.fromInline([{
1598
+ name: "my_tool",
1599
+ description: "My custom tool",
1600
+ inputSchema: {
1601
+ type: agentcore.SchemaDefinitionType.OBJECT,
1602
+ properties: {},
1603
+ },
1604
+ }]);
1605
+
1606
+ // Create a custom Lambda configuration
1607
+ const customConfig = agentcore.LambdaTargetConfiguration.create(
1608
+ myLambdaFunction,
1609
+ myToolSchema
1610
+ );
1611
+
1612
+ // Use the GatewayTarget constructor directly
1613
+ const target = new agentcore.GatewayTarget(this, "AdvancedTarget", {
1614
+ gateway: gateway,
1615
+ gatewayTargetName: "advanced-target",
1616
+ targetConfiguration: customConfig, // Manually created configuration
1617
+ credentialProviderConfigurations: [
1618
+ agentcore.GatewayCredentialProvider.fromIamRole()
1619
+ ]
1620
+ });
1621
+ ```
1622
+
1623
+ This 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.
1624
+
1625
+ ### Gateway Target IAM Permissions
1626
+
1627
+ The Gateway Target construct provides convenient methods for granting IAM permissions:
1628
+
1629
+ ```typescript fixture=default
1630
+ // Create a gateway and target
1631
+ const gateway = new agentcore.Gateway(this, "MyGateway", {
1632
+ gatewayName: "my-gateway",
1633
+ });
1634
+
1635
+ const smithySchema = agentcore.ApiSchema.fromLocalAsset(
1636
+ path.join(__dirname, "models", "smithy-model.json")
1637
+ );
1638
+ smithySchema.bind(this);
1639
+
1640
+ // Create a gateway target with Smithy Model and OAuth
1641
+ const target = agentcore.GatewayTarget.forSmithy(this, "MySmithyTarget", {
1642
+ gatewayTargetName: "my-smithy-target",
1643
+ description: "Target for Smithy model integration",
1644
+ gateway: gateway,
1645
+ smithyModel: smithySchema,
1646
+ });
1647
+
1648
+ // Create a role that needs access to the gateway target
1649
+ const userRole = new iam.Role(this, "UserRole", {
1650
+ assumedBy: new iam.ServicePrincipal("lambda.amazonaws.com"),
1651
+ });
1652
+
1653
+ // Grant read permissions (Get and List actions)
1654
+ target.grantRead(userRole);
1655
+
1656
+ // Grant manage permissions (Create, Update, Delete actions)
1657
+ target.grantManage(userRole);
1658
+
1659
+ // Grant specific custom permissions
1660
+ target.grant(userRole, "bedrock-agentcore:GetGatewayTarget");
1661
+
1662
+
1663
+ // Grants permission to invoke this Gateway
1664
+ gateway.grantInvoke(userRole);
1665
+ ```
1666
+
806
1667
  ## Memory
807
1668
 
808
1669
  Memory 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.
@@ -1050,7 +1911,7 @@ const memory = new agentcore.Memory(this, "MyMemory", {
1050
1911
 
1051
1912
  ### Memory with self-managed Strategies
1052
1913
 
1053
- A self-managed strategy in Amazon Bedrock AgentCore Memory gives you complete control over your memory extraction and consolidation pipelines.
1914
+ A self-managed strategy in Amazon Bedrock AgentCore Memory gives you complete control over your memory extraction and consolidation pipelines.
1054
1915
  With a self-managed strategy, you can build custom memory processing workflows while leveraging Amazon Bedrock AgentCore for storage and retrieval.
1055
1916
 
1056
1917
  For 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).