@aws-cdk/aws-bedrock-agentcore-alpha 2.225.0-alpha.0 → 2.227.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.
- package/.jsii +14021 -5792
- package/.jsii.tabl.json.gz +0 -0
- package/.warnings.jsii.js +343 -1
- package/README.md +880 -19
- package/agentcore/gateway/gateway-base.d.ts +292 -0
- package/agentcore/gateway/gateway-base.js +171 -0
- package/agentcore/gateway/gateway.d.ts +383 -0
- package/agentcore/gateway/gateway.js +521 -0
- package/agentcore/gateway/inbound-auth/authorizer.d.ts +121 -0
- package/agentcore/gateway/inbound-auth/authorizer.js +133 -0
- package/agentcore/gateway/outbound-auth/api-key.d.ts +117 -0
- package/agentcore/gateway/outbound-auth/api-key.js +141 -0
- package/agentcore/gateway/outbound-auth/credential-provider.d.ts +70 -0
- package/agentcore/gateway/outbound-auth/credential-provider.js +80 -0
- package/agentcore/gateway/outbound-auth/iam-role.d.ts +28 -0
- package/agentcore/gateway/outbound-auth/iam-role.js +40 -0
- package/agentcore/gateway/outbound-auth/oauth.d.ts +80 -0
- package/agentcore/gateway/outbound-auth/oauth.js +76 -0
- package/agentcore/gateway/perms.d.ts +75 -0
- package/agentcore/gateway/perms.js +112 -0
- package/agentcore/gateway/protocol.d.ts +121 -0
- package/agentcore/gateway/protocol.js +120 -0
- package/agentcore/gateway/targets/schema/api-schema.d.ts +110 -0
- package/agentcore/gateway/targets/schema/api-schema.js +207 -0
- package/agentcore/gateway/targets/schema/base-schema.d.ts +24 -0
- package/agentcore/gateway/targets/schema/base-schema.js +12 -0
- package/agentcore/gateway/targets/schema/tool-schema.d.ts +198 -0
- package/agentcore/gateway/targets/schema/tool-schema.js +213 -0
- package/agentcore/gateway/targets/target-base.d.ts +153 -0
- package/agentcore/gateway/targets/target-base.js +81 -0
- package/agentcore/gateway/targets/target-configuration.d.ts +230 -0
- package/agentcore/gateway/targets/target-configuration.js +407 -0
- package/agentcore/gateway/targets/target.d.ts +345 -0
- package/agentcore/gateway/targets/target.js +444 -0
- package/agentcore/gateway/validation-helpers.d.ts +65 -0
- package/agentcore/gateway/validation-helpers.js +333 -0
- package/agentcore/index.d.ts +15 -0
- package/agentcore/index.js +32 -1
- package/agentcore/memory/memory-strategy.js +1 -1
- package/agentcore/memory/memory.js +6 -3
- package/agentcore/memory/strategies/managed-strategy.js +1 -1
- package/agentcore/memory/strategies/self-managed-strategy.js +1 -1
- package/agentcore/network/network-configuration.js +4 -4
- package/agentcore/runtime/runtime-artifact.js +1 -1
- package/agentcore/runtime/runtime-authorizer-configuration.d.ts +1 -1
- package/agentcore/runtime/runtime-authorizer-configuration.js +6 -5
- package/agentcore/runtime/runtime-base.js +1 -1
- package/agentcore/runtime/runtime-endpoint-base.js +1 -1
- package/agentcore/runtime/runtime-endpoint.js +1 -1
- package/agentcore/runtime/runtime.js +1 -1
- package/agentcore/tools/browser.js +2 -2
- package/agentcore/tools/code-interpreter.js +2 -2
- package/package.json +9 -9
- package/rosetta/default.ts-fixture +15 -6
|
@@ -0,0 +1,383 @@
|
|
|
1
|
+
import * as cognito from 'aws-cdk-lib/aws-cognito';
|
|
2
|
+
import * as iam from 'aws-cdk-lib/aws-iam';
|
|
3
|
+
import * as kms from 'aws-cdk-lib/aws-kms';
|
|
4
|
+
import { IFunction } from 'aws-cdk-lib/aws-lambda';
|
|
5
|
+
import { Construct } from 'constructs';
|
|
6
|
+
import { GatewayBase, GatewayExceptionLevel, IGateway } from './gateway-base';
|
|
7
|
+
import { IGatewayAuthorizerConfig } from './inbound-auth/authorizer';
|
|
8
|
+
import { ICredentialProviderConfig } from './outbound-auth/credential-provider';
|
|
9
|
+
import { IGatewayProtocolConfig } from './protocol';
|
|
10
|
+
import { ApiSchema } from './targets/schema/api-schema';
|
|
11
|
+
import { ToolSchema } from './targets/schema/tool-schema';
|
|
12
|
+
import { GatewayTarget } from './targets/target';
|
|
13
|
+
/******************************************************************************
|
|
14
|
+
* Props
|
|
15
|
+
*****************************************************************************/
|
|
16
|
+
/**
|
|
17
|
+
* Options for adding a Lambda target to a gateway
|
|
18
|
+
*/
|
|
19
|
+
export interface AddLambdaTargetOptions {
|
|
20
|
+
/**
|
|
21
|
+
* The name of the gateway target
|
|
22
|
+
* Valid characters are a-z, A-Z, 0-9, _ (underscore) and - (hyphen)
|
|
23
|
+
*/
|
|
24
|
+
readonly gatewayTargetName: string;
|
|
25
|
+
/**
|
|
26
|
+
* Optional description for the gateway target
|
|
27
|
+
* @default - No description
|
|
28
|
+
*/
|
|
29
|
+
readonly description?: string;
|
|
30
|
+
/**
|
|
31
|
+
* The Lambda function to associate with this target
|
|
32
|
+
*/
|
|
33
|
+
readonly lambdaFunction: IFunction;
|
|
34
|
+
/**
|
|
35
|
+
* The tool schema defining the available tools
|
|
36
|
+
*/
|
|
37
|
+
readonly toolSchema: ToolSchema;
|
|
38
|
+
/**
|
|
39
|
+
* Credential providers for authentication
|
|
40
|
+
* @default - [GatewayCredentialProvider.iamRole()]
|
|
41
|
+
*/
|
|
42
|
+
readonly credentialProviderConfigurations?: ICredentialProviderConfig[];
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Options for adding an OpenAPI target to a gateway
|
|
46
|
+
*/
|
|
47
|
+
export interface AddOpenApiTargetOptions {
|
|
48
|
+
/**
|
|
49
|
+
* The name of the gateway target
|
|
50
|
+
* Valid characters are a-z, A-Z, 0-9, _ (underscore) and - (hyphen)
|
|
51
|
+
*/
|
|
52
|
+
readonly gatewayTargetName: string;
|
|
53
|
+
/**
|
|
54
|
+
* Optional description for the gateway target
|
|
55
|
+
* @default - No description
|
|
56
|
+
*/
|
|
57
|
+
readonly description?: string;
|
|
58
|
+
/**
|
|
59
|
+
* The OpenAPI schema defining the API
|
|
60
|
+
*/
|
|
61
|
+
readonly apiSchema: ApiSchema;
|
|
62
|
+
/**
|
|
63
|
+
* Whether to validate the OpenAPI schema or not
|
|
64
|
+
* Note: Validation is only performed for inline and asset-based schema and during CDK synthesis.
|
|
65
|
+
* S3 schemas cannot be validated at synthesis time.
|
|
66
|
+
* @default true
|
|
67
|
+
*/
|
|
68
|
+
readonly validateOpenApiSchema?: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Credential providers for authentication
|
|
71
|
+
* @default - [GatewayCredentialProvider.iamRole()]
|
|
72
|
+
*/
|
|
73
|
+
readonly credentialProviderConfigurations?: ICredentialProviderConfig[];
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Options for adding a Smithy target to a gateway
|
|
77
|
+
*/
|
|
78
|
+
export interface AddSmithyTargetOptions {
|
|
79
|
+
/**
|
|
80
|
+
* The name of the gateway target
|
|
81
|
+
* Valid characters are a-z, A-Z, 0-9, _ (underscore) and - (hyphen)
|
|
82
|
+
*/
|
|
83
|
+
readonly gatewayTargetName: string;
|
|
84
|
+
/**
|
|
85
|
+
* Optional description for the gateway target
|
|
86
|
+
* @default - No description
|
|
87
|
+
*/
|
|
88
|
+
readonly description?: string;
|
|
89
|
+
/**
|
|
90
|
+
* The Smithy model defining the API
|
|
91
|
+
*/
|
|
92
|
+
readonly smithyModel: ApiSchema;
|
|
93
|
+
/**
|
|
94
|
+
* Credential providers for authentication
|
|
95
|
+
* @default - [GatewayCredentialProvider.iamRole()]
|
|
96
|
+
*/
|
|
97
|
+
readonly credentialProviderConfigurations?: ICredentialProviderConfig[];
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Options for adding an MCP Server target to a gateway
|
|
101
|
+
*/
|
|
102
|
+
export interface AddMcpServerTargetOptions {
|
|
103
|
+
/**
|
|
104
|
+
* The name of the gateway target
|
|
105
|
+
* Valid characters are a-z, A-Z, 0-9, _ (underscore) and - (hyphen)
|
|
106
|
+
*/
|
|
107
|
+
readonly gatewayTargetName: string;
|
|
108
|
+
/**
|
|
109
|
+
* Optional description for the gateway target
|
|
110
|
+
* @default - No description
|
|
111
|
+
*/
|
|
112
|
+
readonly description?: string;
|
|
113
|
+
/**
|
|
114
|
+
* The HTTPS endpoint URL of the MCP server
|
|
115
|
+
*
|
|
116
|
+
* The endpoint must:
|
|
117
|
+
* - Use HTTPS protocol
|
|
118
|
+
* - Be properly URL-encoded
|
|
119
|
+
* - Point to an MCP server that implements tool capabilities
|
|
120
|
+
*/
|
|
121
|
+
readonly endpoint: string;
|
|
122
|
+
/**
|
|
123
|
+
* Credential providers for authentication
|
|
124
|
+
*
|
|
125
|
+
* MCP servers require explicit authentication configuration.
|
|
126
|
+
* OAuth2 is strongly recommended over NoAuth.
|
|
127
|
+
*/
|
|
128
|
+
readonly credentialProviderConfigurations: ICredentialProviderConfig[];
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Properties for defining a Gateway
|
|
132
|
+
*/
|
|
133
|
+
export interface GatewayProps {
|
|
134
|
+
/**
|
|
135
|
+
* The name of the gateway
|
|
136
|
+
* Valid characters are a-z, A-Z, 0-9, _ (underscore) and - (hyphen)
|
|
137
|
+
* The name must be unique within your account
|
|
138
|
+
*/
|
|
139
|
+
readonly gatewayName: string;
|
|
140
|
+
/**
|
|
141
|
+
* Optional description for the gateway
|
|
142
|
+
* Valid characters are a-z, A-Z, 0-9, _ (underscore), - (hyphen) and spaces
|
|
143
|
+
* The description can have up to 200 characters
|
|
144
|
+
* @default - No description
|
|
145
|
+
*/
|
|
146
|
+
readonly description?: string;
|
|
147
|
+
/**
|
|
148
|
+
* The protocol configuration for the gateway
|
|
149
|
+
* @default - A default protocol configuration will be created using MCP with following params
|
|
150
|
+
* supportedVersions: [MCPProtocolVersion.MCP_2025_03_26],
|
|
151
|
+
* searchType: McpGatewaySearchType.SEMANTIC,
|
|
152
|
+
* instructions: "Default gateway to connect to external MCP tools",
|
|
153
|
+
*/
|
|
154
|
+
readonly protocolConfiguration?: IGatewayProtocolConfig;
|
|
155
|
+
/**
|
|
156
|
+
* The authorizer configuration for the gateway
|
|
157
|
+
* @default - A default authorizer will be created using Cognito
|
|
158
|
+
*/
|
|
159
|
+
readonly authorizerConfiguration?: IGatewayAuthorizerConfig;
|
|
160
|
+
/**
|
|
161
|
+
* The verbosity of exception messages
|
|
162
|
+
* Use DEBUG mode to see granular exception messages from a Gateway
|
|
163
|
+
* @default - Exception messages are sanitized for presentation to end users
|
|
164
|
+
*/
|
|
165
|
+
readonly exceptionLevel?: GatewayExceptionLevel;
|
|
166
|
+
/**
|
|
167
|
+
* The AWS KMS key used to encrypt data associated with the gateway
|
|
168
|
+
* @default - No encryption
|
|
169
|
+
*/
|
|
170
|
+
readonly kmsKey?: kms.IKey;
|
|
171
|
+
/**
|
|
172
|
+
* The IAM role that provides permissions for the gateway to access AWS services
|
|
173
|
+
* @default - A new role will be created
|
|
174
|
+
*/
|
|
175
|
+
readonly role?: iam.IRole;
|
|
176
|
+
/**
|
|
177
|
+
* Tags for the gateway
|
|
178
|
+
* A list of key:value pairs of tags to apply to this Gateway resource
|
|
179
|
+
* @default - No tags
|
|
180
|
+
*/
|
|
181
|
+
readonly tags?: {
|
|
182
|
+
[key: string]: string;
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Attributes for importing an existing Gateway
|
|
187
|
+
*/
|
|
188
|
+
export interface GatewayAttributes {
|
|
189
|
+
/**
|
|
190
|
+
* The ARN of the gateway
|
|
191
|
+
*/
|
|
192
|
+
readonly gatewayArn: string;
|
|
193
|
+
/**
|
|
194
|
+
* The ID of the gateway
|
|
195
|
+
*/
|
|
196
|
+
readonly gatewayId: string;
|
|
197
|
+
/**
|
|
198
|
+
* The name of the gateway
|
|
199
|
+
*/
|
|
200
|
+
readonly gatewayName: string;
|
|
201
|
+
/**
|
|
202
|
+
* The IAM role that provides permissions for the gateway
|
|
203
|
+
*/
|
|
204
|
+
readonly role: iam.IRole;
|
|
205
|
+
}
|
|
206
|
+
/******************************************************************************
|
|
207
|
+
* Class
|
|
208
|
+
*****************************************************************************/
|
|
209
|
+
/**
|
|
210
|
+
* Gateway resource for AWS Bedrock Agent Core.
|
|
211
|
+
* Serves as an integration point between your agent and external services.
|
|
212
|
+
*
|
|
213
|
+
* @resource AWS::BedrockAgentCore::Gateway
|
|
214
|
+
* @see https://docs.aws.amazon.com/bedrock-agentcore-control/latest/APIReference/API_CreateGateway.html
|
|
215
|
+
*/
|
|
216
|
+
export declare class Gateway extends GatewayBase {
|
|
217
|
+
/** Uniquely identifies this class. */
|
|
218
|
+
static readonly PROPERTY_INJECTION_ID: string;
|
|
219
|
+
/**
|
|
220
|
+
* Import an existing Gateway using its attributes
|
|
221
|
+
*
|
|
222
|
+
* @param scope The construct scope
|
|
223
|
+
* @param id The construct id
|
|
224
|
+
* @param attrs The attributes of the existing Gateway
|
|
225
|
+
* @returns An IGateway instance representing the imported gateway
|
|
226
|
+
*/
|
|
227
|
+
static fromGatewayAttributes(scope: Construct, id: string, attrs: GatewayAttributes): IGateway;
|
|
228
|
+
/**
|
|
229
|
+
* The ARN of the gateway
|
|
230
|
+
* @attribute
|
|
231
|
+
*/
|
|
232
|
+
readonly gatewayArn: string;
|
|
233
|
+
/**
|
|
234
|
+
* The unique identifier of the gateway
|
|
235
|
+
* @attribute
|
|
236
|
+
*/
|
|
237
|
+
readonly gatewayId: string;
|
|
238
|
+
/**
|
|
239
|
+
* The name of the gateway
|
|
240
|
+
*/
|
|
241
|
+
readonly name: string;
|
|
242
|
+
/**
|
|
243
|
+
* The description of the gateway
|
|
244
|
+
*/
|
|
245
|
+
readonly description?: string;
|
|
246
|
+
/**
|
|
247
|
+
* The protocol configuration for the gateway
|
|
248
|
+
*/
|
|
249
|
+
readonly protocolConfiguration: IGatewayProtocolConfig;
|
|
250
|
+
/**
|
|
251
|
+
* The authorizer configuration for the gateway
|
|
252
|
+
*/
|
|
253
|
+
readonly authorizerConfiguration: IGatewayAuthorizerConfig;
|
|
254
|
+
/**
|
|
255
|
+
* The exception level for the gateway
|
|
256
|
+
*/
|
|
257
|
+
readonly exceptionLevel?: GatewayExceptionLevel;
|
|
258
|
+
/**
|
|
259
|
+
* The KMS key used for encryption
|
|
260
|
+
*/
|
|
261
|
+
readonly kmsKey?: kms.IKey;
|
|
262
|
+
/**
|
|
263
|
+
* The IAM role for the gateway
|
|
264
|
+
*/
|
|
265
|
+
readonly role: iam.IRole;
|
|
266
|
+
/**
|
|
267
|
+
* The URL endpoint for the gateway
|
|
268
|
+
* @attribute
|
|
269
|
+
*/
|
|
270
|
+
readonly gatewayUrl?: string;
|
|
271
|
+
/**
|
|
272
|
+
* The status of the gateway
|
|
273
|
+
* @attribute
|
|
274
|
+
*/
|
|
275
|
+
readonly status?: string;
|
|
276
|
+
/**
|
|
277
|
+
* The status reasons for the gateway
|
|
278
|
+
* @attribute
|
|
279
|
+
*/
|
|
280
|
+
readonly statusReason?: string[];
|
|
281
|
+
/**
|
|
282
|
+
* Timestamp when the gateway was created
|
|
283
|
+
* @attribute
|
|
284
|
+
*/
|
|
285
|
+
readonly createdAt?: string;
|
|
286
|
+
/**
|
|
287
|
+
* Timestamp when the gateway was last updated
|
|
288
|
+
* @attribute
|
|
289
|
+
*/
|
|
290
|
+
readonly updatedAt?: string;
|
|
291
|
+
/**
|
|
292
|
+
* Tags applied to the gateway
|
|
293
|
+
*/
|
|
294
|
+
readonly tags?: {
|
|
295
|
+
[key: string]: string;
|
|
296
|
+
};
|
|
297
|
+
/**
|
|
298
|
+
* The Cognito User Pool created for the gateway (if using default Cognito authorizer)
|
|
299
|
+
*/
|
|
300
|
+
userPool?: cognito.IUserPool;
|
|
301
|
+
/**
|
|
302
|
+
* The Cognito User Pool Client created for the gateway (if using default Cognito authorizer)
|
|
303
|
+
*/
|
|
304
|
+
userPoolClient?: cognito.IUserPoolClient;
|
|
305
|
+
constructor(scope: Construct, id: string, props: GatewayProps);
|
|
306
|
+
/**
|
|
307
|
+
* Add a Lambda target to this gateway
|
|
308
|
+
* This is a convenience method that creates a GatewayTarget associated with this gateway
|
|
309
|
+
*
|
|
310
|
+
* @param id The construct id for the target
|
|
311
|
+
* @param props Properties for the Lambda target
|
|
312
|
+
* @returns The created GatewayTarget
|
|
313
|
+
*/
|
|
314
|
+
addLambdaTarget(id: string, props: AddLambdaTargetOptions): GatewayTarget;
|
|
315
|
+
/**
|
|
316
|
+
* Add an OpenAPI target to this gateway
|
|
317
|
+
* This is a convenience method that creates a GatewayTarget associated with this gateway
|
|
318
|
+
*
|
|
319
|
+
* @param id The construct id for the target
|
|
320
|
+
* @param props Properties for the OpenAPI target
|
|
321
|
+
* @returns The created GatewayTarget
|
|
322
|
+
*/
|
|
323
|
+
addOpenApiTarget(id: string, props: AddOpenApiTargetOptions): GatewayTarget;
|
|
324
|
+
/**
|
|
325
|
+
* Add a Smithy target to this gateway
|
|
326
|
+
* This is a convenience method that creates a GatewayTarget associated with this gateway
|
|
327
|
+
*
|
|
328
|
+
* @param id The construct id for the target
|
|
329
|
+
* @param props Properties for the Smithy target
|
|
330
|
+
* @returns The created GatewayTarget
|
|
331
|
+
*/
|
|
332
|
+
addSmithyTarget(id: string, props: AddSmithyTargetOptions): GatewayTarget;
|
|
333
|
+
/**
|
|
334
|
+
* Add an MCP server target to this gateway
|
|
335
|
+
* This is a convenience method that creates a GatewayTarget associated with this gateway
|
|
336
|
+
*
|
|
337
|
+
* @param id The construct id for the target
|
|
338
|
+
* @param props Properties for the MCP server target
|
|
339
|
+
* @returns The created GatewayTarget
|
|
340
|
+
* @see https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/gateway-target-MCPservers.html
|
|
341
|
+
*/
|
|
342
|
+
addMcpServerTarget(id: string, props: AddMcpServerTargetOptions): GatewayTarget;
|
|
343
|
+
/**
|
|
344
|
+
* Creates the service role for the gateway to assume
|
|
345
|
+
*
|
|
346
|
+
* The service role starts with minimal permissions. Additional permissions
|
|
347
|
+
* are added automatically when targets are configured:
|
|
348
|
+
* - KMS encryption: Automatically grants encrypt/decrypt permissions
|
|
349
|
+
*
|
|
350
|
+
* For other target types, manually grant permissions using standard CDK grant methods:
|
|
351
|
+
* @internal
|
|
352
|
+
*/
|
|
353
|
+
private createGatewayRole;
|
|
354
|
+
/**
|
|
355
|
+
* Validates the gateway name format
|
|
356
|
+
* Pattern: ^([0-9a-zA-Z][-]?){1,100}$
|
|
357
|
+
* Max length: 48 characters
|
|
358
|
+
* @param name The gateway name to validate
|
|
359
|
+
* @throws Error if the name is invalid
|
|
360
|
+
* @internal
|
|
361
|
+
*/
|
|
362
|
+
private validateGatewayName;
|
|
363
|
+
/**
|
|
364
|
+
* Validates the description format
|
|
365
|
+
* Max length: 200 characters
|
|
366
|
+
* @param description The description to validate
|
|
367
|
+
* @throws Error if validation fails
|
|
368
|
+
* @internal
|
|
369
|
+
*/
|
|
370
|
+
private validateDescription;
|
|
371
|
+
/**
|
|
372
|
+
* Creates a default Cognito authorizer for the gateway
|
|
373
|
+
* Provisions a Cognito User Pool and configures JWT authentication
|
|
374
|
+
* @internal
|
|
375
|
+
*/
|
|
376
|
+
private createDefaultCognitoAuthorizerConfig;
|
|
377
|
+
/**
|
|
378
|
+
* Creates a default MCP protocol configuration for the gateway
|
|
379
|
+
* Provides sensible defaults for MCP protocol settings
|
|
380
|
+
* @internal
|
|
381
|
+
*/
|
|
382
|
+
private createDefaultMcpProtocolConfiguration;
|
|
383
|
+
}
|