@aws-cdk/aws-bedrock-agentcore-alpha 2.238.0-alpha.0 → 2.239.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 +1451 -298
- package/.jsii.tabl.json.gz +0 -0
- package/.warnings.jsii.js +119 -1
- package/README.md +109 -47
- package/lib/gateway/gateway-base.js +1 -1
- package/lib/gateway/gateway.d.ts +55 -0
- package/lib/gateway/gateway.js +38 -2
- package/lib/gateway/inbound-auth/authorizer.js +3 -3
- package/lib/gateway/inbound-auth/custom-claim.js +1 -1
- package/lib/gateway/interceptor.js +1 -1
- package/lib/gateway/outbound-auth/api-key.js +1 -1
- package/lib/gateway/outbound-auth/credential-provider.js +1 -1
- package/lib/gateway/protocol.js +2 -2
- package/lib/gateway/targets/schema/api-schema.js +4 -4
- package/lib/gateway/targets/schema/tool-schema.js +4 -4
- package/lib/gateway/targets/target-base.d.ts +3 -1
- package/lib/gateway/targets/target-base.js +4 -2
- package/lib/gateway/targets/target-configuration.d.ts +246 -0
- package/lib/gateway/targets/target-configuration.js +344 -8
- package/lib/gateway/targets/target.d.ts +51 -2
- package/lib/gateway/targets/target.js +46 -3
- package/lib/memory/memory-strategy.js +1 -1
- package/lib/memory/memory.js +2 -2
- package/lib/memory/strategies/managed-strategy.js +1 -1
- package/lib/memory/strategies/self-managed-strategy.js +1 -1
- package/lib/network/network-configuration.js +4 -4
- package/lib/runtime/inbound-auth/custom-claim.js +1 -1
- package/lib/runtime/inbound-auth/runtime-authorizer-configuration.js +1 -1
- package/lib/runtime/runtime-artifact.d.ts +23 -0
- package/lib/runtime/runtime-artifact.js +67 -2
- package/lib/runtime/runtime-base.js +1 -1
- package/lib/runtime/runtime-endpoint-base.js +1 -1
- package/lib/runtime/runtime-endpoint.js +1 -1
- package/lib/runtime/runtime.js +1 -1
- package/lib/tools/browser.js +2 -2
- package/lib/tools/code-interpreter.js +2 -2
- package/package.json +12 -12
- package/rosetta/default.ts-fixture +1 -0
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { IRestApi } from 'aws-cdk-lib/aws-apigateway';
|
|
1
2
|
import type { IFunction } from 'aws-cdk-lib/aws-lambda';
|
|
2
3
|
import type { Construct } from 'constructs';
|
|
3
4
|
import type { IGateway } from '../gateway-base';
|
|
@@ -228,3 +229,248 @@ export declare class McpServerTargetConfiguration extends McpTargetConfiguration
|
|
|
228
229
|
*/
|
|
229
230
|
private validateEndpoint;
|
|
230
231
|
}
|
|
232
|
+
/******************************************************************************
|
|
233
|
+
* API Gateway Target Configuration
|
|
234
|
+
*****************************************************************************/
|
|
235
|
+
/**
|
|
236
|
+
* HTTP methods supported by API Gateway
|
|
237
|
+
*/
|
|
238
|
+
export declare enum ApiGatewayHttpMethod {
|
|
239
|
+
/** GET method */
|
|
240
|
+
GET = "GET",
|
|
241
|
+
/** POST method */
|
|
242
|
+
POST = "POST",
|
|
243
|
+
/** PUT method */
|
|
244
|
+
PUT = "PUT",
|
|
245
|
+
/** DELETE method */
|
|
246
|
+
DELETE = "DELETE",
|
|
247
|
+
/** PATCH method */
|
|
248
|
+
PATCH = "PATCH",
|
|
249
|
+
/** HEAD method */
|
|
250
|
+
HEAD = "HEAD",
|
|
251
|
+
/** OPTIONS method */
|
|
252
|
+
OPTIONS = "OPTIONS"
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* Configuration for filtering API Gateway tools
|
|
256
|
+
*
|
|
257
|
+
* Tool filters allow you to select REST API operations using path and method combinations.
|
|
258
|
+
* Each filter supports two path matching strategies:
|
|
259
|
+
* - **Explicit paths**: Matches a single specific path, such as `/pets/{petId}`
|
|
260
|
+
* - **Wildcard paths**: Matches all paths starting with the specified prefix, such as `/pets/*`
|
|
261
|
+
*/
|
|
262
|
+
export interface ApiGatewayToolFilter {
|
|
263
|
+
/**
|
|
264
|
+
* The resource path to filter
|
|
265
|
+
* Can be an explicit path (e.g., `/pets/{petId}`) or a wildcard path (e.g., `/pets/*`)
|
|
266
|
+
* Must start with a forward slash
|
|
267
|
+
*/
|
|
268
|
+
readonly filterPath: string;
|
|
269
|
+
/**
|
|
270
|
+
* List of HTTP methods to include for this path
|
|
271
|
+
* Each filter specifies both a path and a list of HTTP methods
|
|
272
|
+
* Multiple filters can overlap and duplicates are automatically de-duplicated
|
|
273
|
+
*/
|
|
274
|
+
readonly methods: ApiGatewayHttpMethod[];
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* Configuration for overriding API Gateway tool metadata
|
|
278
|
+
*
|
|
279
|
+
* Tool overrides allow you to customize the tool name or description for specific operations
|
|
280
|
+
* after filtering. Each override must specify an explicit path and a single HTTP method.
|
|
281
|
+
* The override must match an operation that exists in your API and must correspond to one
|
|
282
|
+
* of the operations resolved by your filters.
|
|
283
|
+
*/
|
|
284
|
+
export interface ApiGatewayToolOverride {
|
|
285
|
+
/**
|
|
286
|
+
* The explicit resource path (no wildcards)
|
|
287
|
+
* Must match an operation that exists in your API
|
|
288
|
+
*/
|
|
289
|
+
readonly path: string;
|
|
290
|
+
/**
|
|
291
|
+
* The HTTP method for this override
|
|
292
|
+
* Must be a single method (no wildcards)
|
|
293
|
+
*/
|
|
294
|
+
readonly method: ApiGatewayHttpMethod;
|
|
295
|
+
/**
|
|
296
|
+
* The custom tool name
|
|
297
|
+
* If not provided, the operationId from the OpenAPI definition will be used
|
|
298
|
+
*/
|
|
299
|
+
readonly name: string;
|
|
300
|
+
/**
|
|
301
|
+
* Optional custom description for the tool
|
|
302
|
+
* @default - No custom description
|
|
303
|
+
*/
|
|
304
|
+
readonly description?: string;
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* Configuration for passing metadata (headers and query parameters) to the API Gateway target
|
|
308
|
+
*/
|
|
309
|
+
export interface MetadataConfiguration {
|
|
310
|
+
/**
|
|
311
|
+
* List of query parameter names to pass through to the target
|
|
312
|
+
*
|
|
313
|
+
* Constraints:
|
|
314
|
+
* - Array must contain 1-10 items
|
|
315
|
+
* - Each parameter name must be 1-40 characters
|
|
316
|
+
* - Cannot be an empty array
|
|
317
|
+
*
|
|
318
|
+
* @default - No query parameters are passed through
|
|
319
|
+
*/
|
|
320
|
+
readonly allowedQueryParameters?: string[];
|
|
321
|
+
/**
|
|
322
|
+
* List of request header names to pass through to the target
|
|
323
|
+
*
|
|
324
|
+
* Constraints:
|
|
325
|
+
* - Array must contain 1-10 items
|
|
326
|
+
* - Each header name must be 1-100 characters
|
|
327
|
+
* - Cannot be an empty array
|
|
328
|
+
*
|
|
329
|
+
* @default - No request headers are passed through
|
|
330
|
+
*/
|
|
331
|
+
readonly allowedRequestHeaders?: string[];
|
|
332
|
+
/**
|
|
333
|
+
* List of response header names to pass through from the target
|
|
334
|
+
*
|
|
335
|
+
* Constraints:
|
|
336
|
+
* - Array must contain 1-10 items
|
|
337
|
+
* - Each header name must be 1-100 characters
|
|
338
|
+
* - Cannot be an empty array
|
|
339
|
+
*
|
|
340
|
+
* @default - No response headers are passed through
|
|
341
|
+
*/
|
|
342
|
+
readonly allowedResponseHeaders?: string[];
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
* Configuration for API Gateway tools
|
|
346
|
+
*
|
|
347
|
+
* The API Gateway tool configuration defines which operations from your REST API
|
|
348
|
+
* are exposed as tools. It requires a list of tool filters to select operations
|
|
349
|
+
* to expose, and optionally accepts tool overrides to customize tool metadata.
|
|
350
|
+
*/
|
|
351
|
+
export interface ApiGatewayToolConfiguration {
|
|
352
|
+
/**
|
|
353
|
+
* List of tool filters to select operations
|
|
354
|
+
* At least one filter is required
|
|
355
|
+
*/
|
|
356
|
+
readonly toolFilters: ApiGatewayToolFilter[];
|
|
357
|
+
/**
|
|
358
|
+
* Optional list of tool overrides to customize tool metadata
|
|
359
|
+
* Each override must correspond to an operation selected by the filters
|
|
360
|
+
* @default - No tool overrides
|
|
361
|
+
*/
|
|
362
|
+
readonly toolOverrides?: ApiGatewayToolOverride[];
|
|
363
|
+
}
|
|
364
|
+
/**
|
|
365
|
+
* Properties for creating an API Gateway target configuration
|
|
366
|
+
*/
|
|
367
|
+
export interface ApiGatewayTargetConfigurationProps {
|
|
368
|
+
/**
|
|
369
|
+
* The REST API to integrate with
|
|
370
|
+
* Must be in the same account and region as the gateway
|
|
371
|
+
*/
|
|
372
|
+
readonly restApi: IRestApi;
|
|
373
|
+
/**
|
|
374
|
+
* The stage name of the REST API
|
|
375
|
+
* @default - Uses the deployment stage from the RestApi (restApi.deploymentStage.stageName)
|
|
376
|
+
*/
|
|
377
|
+
readonly stage?: string;
|
|
378
|
+
/**
|
|
379
|
+
* Tool configuration defining which operations to expose
|
|
380
|
+
*/
|
|
381
|
+
readonly apiGatewayToolConfiguration: ApiGatewayToolConfiguration;
|
|
382
|
+
/**
|
|
383
|
+
* Metadata configuration for passing headers and query parameters
|
|
384
|
+
* Allows you to pass additional context through headers and query parameters
|
|
385
|
+
* @default - No metadata configuration
|
|
386
|
+
*/
|
|
387
|
+
readonly metadataConfiguration?: MetadataConfiguration;
|
|
388
|
+
}
|
|
389
|
+
/**
|
|
390
|
+
* Configuration for API Gateway-based MCP targets
|
|
391
|
+
*
|
|
392
|
+
* This configuration connects your gateway to an Amazon API Gateway REST API stage.
|
|
393
|
+
* The gateway translates incoming MCP requests into HTTP requests to your REST API
|
|
394
|
+
* and handles response formatting.
|
|
395
|
+
*
|
|
396
|
+
* Key considerations:
|
|
397
|
+
* - API must be in the same account and region as the gateway
|
|
398
|
+
* - Only REST APIs are supported (no HTTP or WebSocket APIs)
|
|
399
|
+
* - API must use a public endpoint type
|
|
400
|
+
* - Methods with both AWS_IAM authorization and API key requirements are not supported
|
|
401
|
+
* - Proxy resources (e.g., `/pets/{proxy+}`) are not supported
|
|
402
|
+
*/
|
|
403
|
+
export declare class ApiGatewayTargetConfiguration extends McpTargetConfiguration {
|
|
404
|
+
/**
|
|
405
|
+
* Create an API Gateway target configuration
|
|
406
|
+
*
|
|
407
|
+
* @param props The configuration properties
|
|
408
|
+
* @returns A new ApiGatewayTargetConfiguration instance
|
|
409
|
+
*/
|
|
410
|
+
static create(props: ApiGatewayTargetConfigurationProps): ApiGatewayTargetConfiguration;
|
|
411
|
+
readonly targetType = McpTargetType.API_GATEWAY;
|
|
412
|
+
/**
|
|
413
|
+
* The REST API reference
|
|
414
|
+
*/
|
|
415
|
+
private readonly _restApi;
|
|
416
|
+
/**
|
|
417
|
+
* The ID of the REST API
|
|
418
|
+
*/
|
|
419
|
+
readonly restApiId: string;
|
|
420
|
+
/**
|
|
421
|
+
* The stage name of the REST API
|
|
422
|
+
*/
|
|
423
|
+
readonly stage: string;
|
|
424
|
+
/**
|
|
425
|
+
* Tool configuration for the API Gateway target
|
|
426
|
+
*/
|
|
427
|
+
readonly apiGatewayToolConfiguration: ApiGatewayToolConfiguration;
|
|
428
|
+
/**
|
|
429
|
+
* Metadata configuration for the API Gateway target
|
|
430
|
+
*/
|
|
431
|
+
readonly metadataConfiguration?: MetadataConfiguration;
|
|
432
|
+
constructor(props: ApiGatewayTargetConfigurationProps);
|
|
433
|
+
/**
|
|
434
|
+
* Binds this configuration to a construct scope
|
|
435
|
+
* Sets up necessary permissions for the gateway to access the API Gateway
|
|
436
|
+
*
|
|
437
|
+
* @param _scope The construct scope
|
|
438
|
+
* @param gateway The gateway that will use this target
|
|
439
|
+
*/
|
|
440
|
+
bind(_scope: Construct, gateway: IGateway): TargetConfigurationConfig;
|
|
441
|
+
/**
|
|
442
|
+
* Renders the MCP-specific configuration
|
|
443
|
+
*/
|
|
444
|
+
protected renderMcpConfiguration(): any;
|
|
445
|
+
/**
|
|
446
|
+
* Validates the configuration
|
|
447
|
+
* @internal
|
|
448
|
+
*/
|
|
449
|
+
private validateConfiguration;
|
|
450
|
+
/**
|
|
451
|
+
* Validates metadata configuration
|
|
452
|
+
* @internal
|
|
453
|
+
*/
|
|
454
|
+
private validateMetadataConfiguration;
|
|
455
|
+
/**
|
|
456
|
+
* Validates a metadata configuration array (query parameters or headers)
|
|
457
|
+
* @param array The array to validate
|
|
458
|
+
* @param fieldName The name of the field for error messages
|
|
459
|
+
* @param minItems Minimum number of items allowed in the array
|
|
460
|
+
* @param maxItems Maximum number of items allowed in the array
|
|
461
|
+
* @param minStringLength Minimum length for each string in the array
|
|
462
|
+
* @param maxStringLength Maximum length for each string in the array
|
|
463
|
+
* @internal
|
|
464
|
+
*/
|
|
465
|
+
private validateMetadataArray;
|
|
466
|
+
/**
|
|
467
|
+
* Validates a tool filter
|
|
468
|
+
* @internal
|
|
469
|
+
*/
|
|
470
|
+
private validateToolFilter;
|
|
471
|
+
/**
|
|
472
|
+
* Validates a tool override
|
|
473
|
+
* @internal
|
|
474
|
+
*/
|
|
475
|
+
private validateToolOverride;
|
|
476
|
+
}
|