@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,345 @@
|
|
|
1
|
+
import * as iam from 'aws-cdk-lib/aws-iam';
|
|
2
|
+
import { IFunction } from 'aws-cdk-lib/aws-lambda';
|
|
3
|
+
import { Construct } from 'constructs';
|
|
4
|
+
import { IGateway } from '../gateway-base';
|
|
5
|
+
import { ApiSchema } from './schema/api-schema';
|
|
6
|
+
import { ToolSchema } from './schema/tool-schema';
|
|
7
|
+
import { GatewayTargetBase, GatewayTargetProtocolType, IGatewayTarget, IMcpGatewayTarget, McpTargetType } from './target-base';
|
|
8
|
+
import { ITargetConfiguration } from './target-configuration';
|
|
9
|
+
import { ICredentialProviderConfig } from '../outbound-auth/credential-provider';
|
|
10
|
+
/******************************************************************************
|
|
11
|
+
* Props
|
|
12
|
+
*****************************************************************************/
|
|
13
|
+
/**
|
|
14
|
+
* Common properties for all Gateway Target types
|
|
15
|
+
*/
|
|
16
|
+
export interface GatewayTargetCommonProps {
|
|
17
|
+
/**
|
|
18
|
+
* The name of the gateway target
|
|
19
|
+
* The name must be unique within the gateway
|
|
20
|
+
* Pattern: ^([0-9a-zA-Z][-]?){1,100}$
|
|
21
|
+
*/
|
|
22
|
+
readonly gatewayTargetName: string;
|
|
23
|
+
/**
|
|
24
|
+
* Optional description for the gateway target
|
|
25
|
+
* The description can have up to 200 characters
|
|
26
|
+
* @default - No description
|
|
27
|
+
*/
|
|
28
|
+
readonly description?: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Properties for creating a Gateway Target resource
|
|
32
|
+
*/
|
|
33
|
+
export interface GatewayTargetProps extends GatewayTargetCommonProps {
|
|
34
|
+
/**
|
|
35
|
+
* The gateway this target belongs to
|
|
36
|
+
*/
|
|
37
|
+
readonly gateway: IGateway;
|
|
38
|
+
/**
|
|
39
|
+
* The target configuration (Lambda, OpenAPI, or Smithy)
|
|
40
|
+
* Use one of the configuration helper classes:
|
|
41
|
+
* - LambdaTargetConfiguration.create()
|
|
42
|
+
* - OpenApiTargetConfiguration.create()
|
|
43
|
+
* - SmithyTargetConfiguration.create()
|
|
44
|
+
*/
|
|
45
|
+
readonly targetConfiguration: ITargetConfiguration;
|
|
46
|
+
/**
|
|
47
|
+
* Credential providers for authentication
|
|
48
|
+
* @default - [GatewayCredentialProvider.fromIamRole()]
|
|
49
|
+
*/
|
|
50
|
+
readonly credentialProviderConfigurations?: ICredentialProviderConfig[];
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Properties for creating a Lambda-based Gateway Target
|
|
54
|
+
* Convenience interface for the most common use case
|
|
55
|
+
*/
|
|
56
|
+
export interface GatewayTargetLambdaProps extends GatewayTargetCommonProps {
|
|
57
|
+
/**
|
|
58
|
+
* The gateway this target belongs to
|
|
59
|
+
*/
|
|
60
|
+
readonly gateway: IGateway;
|
|
61
|
+
/**
|
|
62
|
+
* The Lambda function to associate with this target
|
|
63
|
+
*/
|
|
64
|
+
readonly lambdaFunction: IFunction;
|
|
65
|
+
/**
|
|
66
|
+
* The tool schema defining the available tools
|
|
67
|
+
*/
|
|
68
|
+
readonly toolSchema: ToolSchema;
|
|
69
|
+
/**
|
|
70
|
+
* Credential providers for authentication
|
|
71
|
+
* Lambda targets only support IAM role authentication
|
|
72
|
+
* @default - [GatewayCredentialProvider.fromIamRole()]
|
|
73
|
+
*/
|
|
74
|
+
readonly credentialProviderConfigurations?: ICredentialProviderConfig[];
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Properties for creating an OpenAPI-based Gateway Target
|
|
78
|
+
*/
|
|
79
|
+
export interface GatewayTargetOpenApiProps extends GatewayTargetCommonProps {
|
|
80
|
+
/**
|
|
81
|
+
* The gateway this target belongs to
|
|
82
|
+
*/
|
|
83
|
+
readonly gateway: IGateway;
|
|
84
|
+
/**
|
|
85
|
+
* The OpenAPI schema defining the API
|
|
86
|
+
*/
|
|
87
|
+
readonly apiSchema: ApiSchema;
|
|
88
|
+
/**
|
|
89
|
+
* Whether to validate the OpenAPI schema (only applies to inline schemas)
|
|
90
|
+
* Note: Validation is only performed for inline schemas during CDK synthesis.
|
|
91
|
+
* S3 and asset-based schemas cannot be validated at synthesis time.
|
|
92
|
+
* @default true
|
|
93
|
+
*/
|
|
94
|
+
readonly validateOpenApiSchema?: boolean;
|
|
95
|
+
/**
|
|
96
|
+
* Credential providers for authentication
|
|
97
|
+
* OpenAPI targets support API key and OAuth authentication (not IAM)
|
|
98
|
+
* @default: If not provided, defaults to IAM role which will fail at runtime
|
|
99
|
+
*/
|
|
100
|
+
readonly credentialProviderConfigurations?: ICredentialProviderConfig[];
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Properties for creating a Smithy-based Gateway Target
|
|
104
|
+
*/
|
|
105
|
+
export interface GatewayTargetSmithyProps extends GatewayTargetCommonProps {
|
|
106
|
+
/**
|
|
107
|
+
* The gateway this target belongs to
|
|
108
|
+
*/
|
|
109
|
+
readonly gateway: IGateway;
|
|
110
|
+
/**
|
|
111
|
+
* The Smithy model defining the API
|
|
112
|
+
*/
|
|
113
|
+
readonly smithyModel: ApiSchema;
|
|
114
|
+
/**
|
|
115
|
+
* Credential providers for authentication
|
|
116
|
+
* Smithy targets only support IAM role authentication
|
|
117
|
+
* @default - [GatewayCredentialProvider.fromIamRole()]
|
|
118
|
+
*/
|
|
119
|
+
readonly credentialProviderConfigurations?: ICredentialProviderConfig[];
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Properties for creating an MCP Server-based Gateway Target
|
|
123
|
+
*/
|
|
124
|
+
export interface GatewayTargetMcpServerProps extends GatewayTargetCommonProps {
|
|
125
|
+
/**
|
|
126
|
+
* The gateway this target belongs to
|
|
127
|
+
*/
|
|
128
|
+
readonly gateway: IGateway;
|
|
129
|
+
/**
|
|
130
|
+
* The HTTPS endpoint URL of the MCP server
|
|
131
|
+
*
|
|
132
|
+
* The endpoint must:
|
|
133
|
+
* - Use HTTPS protocol
|
|
134
|
+
* - Be properly URL-encoded
|
|
135
|
+
* - Point to an MCP server that implements tool capabilities
|
|
136
|
+
*/
|
|
137
|
+
readonly endpoint: string;
|
|
138
|
+
/**
|
|
139
|
+
* Credential providers for authentication
|
|
140
|
+
*/
|
|
141
|
+
readonly credentialProviderConfigurations: ICredentialProviderConfig[];
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Attributes for importing an existing Gateway Target
|
|
145
|
+
*/
|
|
146
|
+
export interface GatewayTargetAttributes {
|
|
147
|
+
/**
|
|
148
|
+
* The ARN of the gateway target
|
|
149
|
+
*/
|
|
150
|
+
readonly targetArn: string;
|
|
151
|
+
/**
|
|
152
|
+
* The ID of the gateway target
|
|
153
|
+
*/
|
|
154
|
+
readonly targetId: string;
|
|
155
|
+
/**
|
|
156
|
+
* The name of the gateway target
|
|
157
|
+
*/
|
|
158
|
+
readonly gatewayTargetName: string;
|
|
159
|
+
/**
|
|
160
|
+
* The gateway this target belongs to
|
|
161
|
+
*/
|
|
162
|
+
readonly gateway: IGateway;
|
|
163
|
+
/**
|
|
164
|
+
* Optional status of the target
|
|
165
|
+
* @default - No status
|
|
166
|
+
*/
|
|
167
|
+
readonly status?: string;
|
|
168
|
+
/**
|
|
169
|
+
* Optional creation timestamp
|
|
170
|
+
* @default - No creation timestamp
|
|
171
|
+
*/
|
|
172
|
+
readonly createdAt?: string;
|
|
173
|
+
/**
|
|
174
|
+
* Optional last update timestamp
|
|
175
|
+
* @default - No update timestamp
|
|
176
|
+
*/
|
|
177
|
+
readonly updatedAt?: string;
|
|
178
|
+
}
|
|
179
|
+
/******************************************************************************
|
|
180
|
+
* Class
|
|
181
|
+
*****************************************************************************/
|
|
182
|
+
/**
|
|
183
|
+
*
|
|
184
|
+
* Defines tools that your gateway will host. Supports multiple target types:
|
|
185
|
+
* - Lambda: Wraps a Lambda function as MCP tools
|
|
186
|
+
* - OpenAPI: Exposes an OpenAPI/REST API as MCP tools
|
|
187
|
+
* - Smithy: Exposes a Smithy-modeled API as MCP tools
|
|
188
|
+
*
|
|
189
|
+
* @resource AWS::BedrockAgentCore::GatewayTarget
|
|
190
|
+
* @see https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/gateway-building-adding-targets.html
|
|
191
|
+
*/
|
|
192
|
+
export declare class GatewayTarget extends GatewayTargetBase implements IMcpGatewayTarget {
|
|
193
|
+
/** Uniquely identifies this class. */
|
|
194
|
+
static readonly PROPERTY_INJECTION_ID: string;
|
|
195
|
+
/**
|
|
196
|
+
* Import an existing Gateway Target using its attributes
|
|
197
|
+
* This allows you to reference a Gateway Target that was created outside of CDK
|
|
198
|
+
*
|
|
199
|
+
* @param scope The construct scope
|
|
200
|
+
* @param id The construct id
|
|
201
|
+
* @param attrs The attributes of the existing Gateway Target
|
|
202
|
+
* @returns An IGatewayTarget instance representing the imported target
|
|
203
|
+
*/
|
|
204
|
+
static fromGatewayTargetAttributes(scope: Construct, id: string, attrs: GatewayTargetAttributes): IGatewayTarget;
|
|
205
|
+
/**
|
|
206
|
+
* Create a Lambda-based MCP target
|
|
207
|
+
* Convenience method for creating a target that wraps a Lambda function
|
|
208
|
+
*
|
|
209
|
+
* @param scope The construct scope
|
|
210
|
+
* @param id The construct id
|
|
211
|
+
* @param props The properties for the Lambda target
|
|
212
|
+
* @returns A new GatewayTarget instance
|
|
213
|
+
*/
|
|
214
|
+
static forLambda(scope: Construct, id: string, props: GatewayTargetLambdaProps): GatewayTarget;
|
|
215
|
+
/**
|
|
216
|
+
* Create an OpenAPI-based MCP target
|
|
217
|
+
* Convenience method for creating a target that exposes an OpenAPI/REST API
|
|
218
|
+
*
|
|
219
|
+
* @param scope The construct scope
|
|
220
|
+
* @param id The construct id
|
|
221
|
+
* @param props The properties for the OpenAPI target
|
|
222
|
+
* @returns A new GatewayTarget instance
|
|
223
|
+
*
|
|
224
|
+
*/
|
|
225
|
+
static forOpenApi(scope: Construct, id: string, props: GatewayTargetOpenApiProps): GatewayTarget;
|
|
226
|
+
/**
|
|
227
|
+
* Create a Smithy-based MCP target
|
|
228
|
+
* Convenience method for creating a target that exposes a Smithy-modeled API
|
|
229
|
+
*
|
|
230
|
+
* @param scope The construct scope
|
|
231
|
+
* @param id The construct id
|
|
232
|
+
* @param props The properties for the Smithy target
|
|
233
|
+
* @returns A new GatewayTarget instance
|
|
234
|
+
*/
|
|
235
|
+
static forSmithy(scope: Construct, id: string, props: GatewayTargetSmithyProps): GatewayTarget;
|
|
236
|
+
/**
|
|
237
|
+
* Create an MCP Server-based target
|
|
238
|
+
* Convenience method for creating a target that connects to an external MCP server
|
|
239
|
+
*
|
|
240
|
+
* @param scope The construct scope
|
|
241
|
+
* @param id The construct id
|
|
242
|
+
* @param props The properties for the MCP server target
|
|
243
|
+
* @returns A new GatewayTarget instance
|
|
244
|
+
* @see https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/gateway-target-MCPservers.html
|
|
245
|
+
*/
|
|
246
|
+
static forMcpServer(scope: Construct, id: string, props: GatewayTargetMcpServerProps): GatewayTarget;
|
|
247
|
+
/**
|
|
248
|
+
* The ARN of the gateway target
|
|
249
|
+
* @attribute
|
|
250
|
+
*/
|
|
251
|
+
readonly targetArn: string;
|
|
252
|
+
/**
|
|
253
|
+
* The unique identifier of the gateway target
|
|
254
|
+
* @attribute
|
|
255
|
+
*/
|
|
256
|
+
readonly targetId: string;
|
|
257
|
+
/**
|
|
258
|
+
* The name of the gateway target
|
|
259
|
+
*/
|
|
260
|
+
readonly name: string;
|
|
261
|
+
/**
|
|
262
|
+
* Optional description for the gateway target
|
|
263
|
+
*/
|
|
264
|
+
readonly description: string | undefined;
|
|
265
|
+
/**
|
|
266
|
+
* The gateway this target belongs to
|
|
267
|
+
*/
|
|
268
|
+
readonly gateway: IGateway;
|
|
269
|
+
/**
|
|
270
|
+
* The credential providers for this target
|
|
271
|
+
*/
|
|
272
|
+
readonly credentialProviderConfigurations: ICredentialProviderConfig[] | undefined;
|
|
273
|
+
/**
|
|
274
|
+
* The protocol type (always MCP for now)
|
|
275
|
+
*/
|
|
276
|
+
readonly targetProtocolType = GatewayTargetProtocolType.MCP;
|
|
277
|
+
/**
|
|
278
|
+
* The specific MCP target type (Lambda, OpenAPI, Smithy, or MCP Server)
|
|
279
|
+
*/
|
|
280
|
+
readonly targetType: McpTargetType;
|
|
281
|
+
/**
|
|
282
|
+
* The status of the gateway target
|
|
283
|
+
* @attribute
|
|
284
|
+
*/
|
|
285
|
+
readonly status?: string | undefined;
|
|
286
|
+
/**
|
|
287
|
+
* The status reasons for the gateway target
|
|
288
|
+
* @attribute
|
|
289
|
+
*/
|
|
290
|
+
readonly statusReasons?: string[];
|
|
291
|
+
/**
|
|
292
|
+
* Timestamp when the gateway target was created
|
|
293
|
+
* @attribute
|
|
294
|
+
*/
|
|
295
|
+
readonly createdAt?: string | undefined;
|
|
296
|
+
/**
|
|
297
|
+
* Timestamp when the gateway target was last updated
|
|
298
|
+
* @attribute
|
|
299
|
+
*/
|
|
300
|
+
readonly updatedAt?: string | undefined;
|
|
301
|
+
private readonly targetResource;
|
|
302
|
+
private readonly targetConfiguration;
|
|
303
|
+
constructor(scope: Construct, id: string, props: GatewayTargetProps);
|
|
304
|
+
/**
|
|
305
|
+
* Grants permission to synchronize this gateway's targets
|
|
306
|
+
*
|
|
307
|
+
* This method grants the `SynchronizeGatewayTargets` permission, which is primarily
|
|
308
|
+
* needed for MCP Server targets when you need to refresh the tool catalog after the
|
|
309
|
+
* MCP server's tools have changed.
|
|
310
|
+
*/
|
|
311
|
+
grantSync(grantee: iam.IGrantable): iam.Grant;
|
|
312
|
+
/**
|
|
313
|
+
* Determines the credential provider configurations based on target type
|
|
314
|
+
*
|
|
315
|
+
* - Lambda & Smithy: Default to IAM role if not provided
|
|
316
|
+
* - MCP Server: Return undefined if not provided (service handles NoAuth)
|
|
317
|
+
* - OpenAPI: Return as-is (must be explicitly provided)
|
|
318
|
+
*
|
|
319
|
+
* @param providedCredentials The credentials from props
|
|
320
|
+
* @returns The credential configurations to use, or undefined
|
|
321
|
+
* @internal
|
|
322
|
+
*/
|
|
323
|
+
private _getTargetSpecificCredentials;
|
|
324
|
+
/**
|
|
325
|
+
* Renders credential provider configurations for CloudFormation
|
|
326
|
+
* @internal
|
|
327
|
+
*/
|
|
328
|
+
private _renderCredentialProviderConfigurations;
|
|
329
|
+
/**
|
|
330
|
+
* Validates the gateway target name format
|
|
331
|
+
* Pattern: ^([0-9a-zA-Z][-]?){1,100}$
|
|
332
|
+
* Max length: 100 characters
|
|
333
|
+
* @param gatewayTargetName The gateway target name to validate
|
|
334
|
+
* @throws Error if the name is invalid
|
|
335
|
+
* @internal
|
|
336
|
+
*/
|
|
337
|
+
private validateGatewayTargetName;
|
|
338
|
+
/**
|
|
339
|
+
* Validates the description format
|
|
340
|
+
* Must be between 1 and 200 characters
|
|
341
|
+
* @throws Error if validation fails
|
|
342
|
+
* @internal
|
|
343
|
+
*/
|
|
344
|
+
private validateDescription;
|
|
345
|
+
}
|