Skip to content

Commit bf837dc

Browse files
author
awstools
committed
feat(client-bedrock-agent): Introducing the ability to create multiple data sources per knowledge base, specify S3 buckets as data sources from external accounts, and exposing levers to define the deletion behavior of the underlying vector store data.
1 parent ef5386c commit bf837dc

13 files changed

+148
-10
lines changed

clients/client-bedrock-agent/src/commands/CreateDataSourceCommand.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,10 @@ export interface CreateDataSourceCommandOutput extends CreateDataSourceResponse,
4949
* inclusionPrefixes: [ // S3Prefixes
5050
* "STRING_VALUE",
5151
* ],
52+
* bucketOwnerAccountId: "STRING_VALUE",
5253
* },
5354
* },
55+
* dataDeletionPolicy: "RETAIN" || "DELETE",
5456
* serverSideEncryptionConfiguration: { // ServerSideEncryptionConfiguration
5557
* kmsKeyArn: "STRING_VALUE",
5658
* },
@@ -71,7 +73,7 @@ export interface CreateDataSourceCommandOutput extends CreateDataSourceResponse,
7173
* // knowledgeBaseId: "STRING_VALUE", // required
7274
* // dataSourceId: "STRING_VALUE", // required
7375
* // name: "STRING_VALUE", // required
74-
* // status: "AVAILABLE" || "DELETING", // required
76+
* // status: "AVAILABLE" || "DELETING" || "DELETE_UNSUCCESSFUL", // required
7577
* // description: "STRING_VALUE",
7678
* // dataSourceConfiguration: { // DataSourceConfiguration
7779
* // type: "S3", // required
@@ -80,6 +82,7 @@ export interface CreateDataSourceCommandOutput extends CreateDataSourceResponse,
8082
* // inclusionPrefixes: [ // S3Prefixes
8183
* // "STRING_VALUE",
8284
* // ],
85+
* // bucketOwnerAccountId: "STRING_VALUE",
8386
* // },
8487
* // },
8588
* // serverSideEncryptionConfiguration: { // ServerSideEncryptionConfiguration
@@ -94,8 +97,12 @@ export interface CreateDataSourceCommandOutput extends CreateDataSourceResponse,
9497
* // },
9598
* // },
9699
* // },
100+
* // dataDeletionPolicy: "RETAIN" || "DELETE",
97101
* // createdAt: new Date("TIMESTAMP"), // required
98102
* // updatedAt: new Date("TIMESTAMP"), // required
103+
* // failureReasons: [ // FailureReasons
104+
* // "STRING_VALUE",
105+
* // ],
99106
* // },
100107
* // };
101108
*

clients/client-bedrock-agent/src/commands/CreateKnowledgeBaseCommand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ export interface CreateKnowledgeBaseCommandOutput extends CreateKnowledgeBaseRes
181181
* // },
182182
* // },
183183
* // },
184-
* // status: "CREATING" || "ACTIVE" || "DELETING" || "UPDATING" || "FAILED", // required
184+
* // status: "CREATING" || "ACTIVE" || "DELETING" || "UPDATING" || "FAILED" || "DELETE_UNSUCCESSFUL", // required
185185
* // createdAt: new Date("TIMESTAMP"), // required
186186
* // updatedAt: new Date("TIMESTAMP"), // required
187187
* // failureReasons: [ // FailureReasons

clients/client-bedrock-agent/src/commands/DeleteDataSourceCommand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export interface DeleteDataSourceCommandOutput extends DeleteDataSourceResponse,
4343
* // { // DeleteDataSourceResponse
4444
* // knowledgeBaseId: "STRING_VALUE", // required
4545
* // dataSourceId: "STRING_VALUE", // required
46-
* // status: "AVAILABLE" || "DELETING", // required
46+
* // status: "AVAILABLE" || "DELETING" || "DELETE_UNSUCCESSFUL", // required
4747
* // };
4848
*
4949
* ```

clients/client-bedrock-agent/src/commands/DeleteKnowledgeBaseCommand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export interface DeleteKnowledgeBaseCommandOutput extends DeleteKnowledgeBaseRes
4141
* const response = await client.send(command);
4242
* // { // DeleteKnowledgeBaseResponse
4343
* // knowledgeBaseId: "STRING_VALUE", // required
44-
* // status: "CREATING" || "ACTIVE" || "DELETING" || "UPDATING" || "FAILED", // required
44+
* // status: "CREATING" || "ACTIVE" || "DELETING" || "UPDATING" || "FAILED" || "DELETE_UNSUCCESSFUL", // required
4545
* // };
4646
*
4747
* ```

clients/client-bedrock-agent/src/commands/GetDataSourceCommand.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export interface GetDataSourceCommandOutput extends GetDataSourceResponse, __Met
4545
* // knowledgeBaseId: "STRING_VALUE", // required
4646
* // dataSourceId: "STRING_VALUE", // required
4747
* // name: "STRING_VALUE", // required
48-
* // status: "AVAILABLE" || "DELETING", // required
48+
* // status: "AVAILABLE" || "DELETING" || "DELETE_UNSUCCESSFUL", // required
4949
* // description: "STRING_VALUE",
5050
* // dataSourceConfiguration: { // DataSourceConfiguration
5151
* // type: "S3", // required
@@ -54,6 +54,7 @@ export interface GetDataSourceCommandOutput extends GetDataSourceResponse, __Met
5454
* // inclusionPrefixes: [ // S3Prefixes
5555
* // "STRING_VALUE",
5656
* // ],
57+
* // bucketOwnerAccountId: "STRING_VALUE",
5758
* // },
5859
* // },
5960
* // serverSideEncryptionConfiguration: { // ServerSideEncryptionConfiguration
@@ -68,8 +69,12 @@ export interface GetDataSourceCommandOutput extends GetDataSourceResponse, __Met
6869
* // },
6970
* // },
7071
* // },
72+
* // dataDeletionPolicy: "RETAIN" || "DELETE",
7173
* // createdAt: new Date("TIMESTAMP"), // required
7274
* // updatedAt: new Date("TIMESTAMP"), // required
75+
* // failureReasons: [ // FailureReasons
76+
* // "STRING_VALUE",
77+
* // ],
7378
* // },
7479
* // };
7580
*

clients/client-bedrock-agent/src/commands/GetKnowledgeBaseCommand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export interface GetKnowledgeBaseCommandOutput extends GetKnowledgeBaseResponse,
9595
* // },
9696
* // },
9797
* // },
98-
* // status: "CREATING" || "ACTIVE" || "DELETING" || "UPDATING" || "FAILED", // required
98+
* // status: "CREATING" || "ACTIVE" || "DELETING" || "UPDATING" || "FAILED" || "DELETE_UNSUCCESSFUL", // required
9999
* // createdAt: new Date("TIMESTAMP"), // required
100100
* // updatedAt: new Date("TIMESTAMP"), // required
101101
* // failureReasons: [ // FailureReasons

clients/client-bedrock-agent/src/commands/ListDataSourcesCommand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export interface ListDataSourcesCommandOutput extends ListDataSourcesResponse, _
4747
* // knowledgeBaseId: "STRING_VALUE", // required
4848
* // dataSourceId: "STRING_VALUE", // required
4949
* // name: "STRING_VALUE", // required
50-
* // status: "AVAILABLE" || "DELETING", // required
50+
* // status: "AVAILABLE" || "DELETING" || "DELETE_UNSUCCESSFUL", // required
5151
* // description: "STRING_VALUE",
5252
* // updatedAt: new Date("TIMESTAMP"), // required
5353
* // },

clients/client-bedrock-agent/src/commands/ListKnowledgeBasesCommand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export interface ListKnowledgeBasesCommandOutput extends ListKnowledgeBasesRespo
4646
* // knowledgeBaseId: "STRING_VALUE", // required
4747
* // name: "STRING_VALUE", // required
4848
* // description: "STRING_VALUE",
49-
* // status: "CREATING" || "ACTIVE" || "DELETING" || "UPDATING" || "FAILED", // required
49+
* // status: "CREATING" || "ACTIVE" || "DELETING" || "UPDATING" || "FAILED" || "DELETE_UNSUCCESSFUL", // required
5050
* // updatedAt: new Date("TIMESTAMP"), // required
5151
* // },
5252
* // ],

clients/client-bedrock-agent/src/commands/UpdateDataSourceCommand.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,10 @@ export interface UpdateDataSourceCommandOutput extends UpdateDataSourceResponse,
4949
* inclusionPrefixes: [ // S3Prefixes
5050
* "STRING_VALUE",
5151
* ],
52+
* bucketOwnerAccountId: "STRING_VALUE",
5253
* },
5354
* },
55+
* dataDeletionPolicy: "RETAIN" || "DELETE",
5456
* serverSideEncryptionConfiguration: { // ServerSideEncryptionConfiguration
5557
* kmsKeyArn: "STRING_VALUE",
5658
* },
@@ -71,7 +73,7 @@ export interface UpdateDataSourceCommandOutput extends UpdateDataSourceResponse,
7173
* // knowledgeBaseId: "STRING_VALUE", // required
7274
* // dataSourceId: "STRING_VALUE", // required
7375
* // name: "STRING_VALUE", // required
74-
* // status: "AVAILABLE" || "DELETING", // required
76+
* // status: "AVAILABLE" || "DELETING" || "DELETE_UNSUCCESSFUL", // required
7577
* // description: "STRING_VALUE",
7678
* // dataSourceConfiguration: { // DataSourceConfiguration
7779
* // type: "S3", // required
@@ -80,6 +82,7 @@ export interface UpdateDataSourceCommandOutput extends UpdateDataSourceResponse,
8082
* // inclusionPrefixes: [ // S3Prefixes
8183
* // "STRING_VALUE",
8284
* // ],
85+
* // bucketOwnerAccountId: "STRING_VALUE",
8386
* // },
8487
* // },
8588
* // serverSideEncryptionConfiguration: { // ServerSideEncryptionConfiguration
@@ -94,8 +97,12 @@ export interface UpdateDataSourceCommandOutput extends UpdateDataSourceResponse,
9497
* // },
9598
* // },
9699
* // },
100+
* // dataDeletionPolicy: "RETAIN" || "DELETE",
97101
* // createdAt: new Date("TIMESTAMP"), // required
98102
* // updatedAt: new Date("TIMESTAMP"), // required
103+
* // failureReasons: [ // FailureReasons
104+
* // "STRING_VALUE",
105+
* // ],
99106
* // },
100107
* // };
101108
*

clients/client-bedrock-agent/src/commands/UpdateKnowledgeBaseCommand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ export interface UpdateKnowledgeBaseCommandOutput extends UpdateKnowledgeBaseRes
166166
* // },
167167
* // },
168168
* // },
169-
* // status: "CREATING" || "ACTIVE" || "DELETING" || "UPDATING" || "FAILED", // required
169+
* // status: "CREATING" || "ACTIVE" || "DELETING" || "UPDATING" || "FAILED" || "DELETE_UNSUCCESSFUL", // required
170170
* // createdAt: new Date("TIMESTAMP"), // required
171171
* // updatedAt: new Date("TIMESTAMP"), // required
172172
* // failureReasons: [ // FailureReasons

clients/client-bedrock-agent/src/models/models_0.ts

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2190,6 +2190,20 @@ export interface UpdateAgentAliasResponse {
21902190
agentAlias: AgentAlias | undefined;
21912191
}
21922192

2193+
/**
2194+
* @public
2195+
* @enum
2196+
*/
2197+
export const DataDeletionPolicy = {
2198+
DELETE: "DELETE",
2199+
RETAIN: "RETAIN",
2200+
} as const;
2201+
2202+
/**
2203+
* @public
2204+
*/
2205+
export type DataDeletionPolicy = (typeof DataDeletionPolicy)[keyof typeof DataDeletionPolicy];
2206+
21932207
/**
21942208
* <p>Contains information about the S3 configuration of the data source.</p>
21952209
* @public
@@ -2206,6 +2220,12 @@ export interface S3DataSourceConfiguration {
22062220
* @public
22072221
*/
22082222
inclusionPrefixes?: string[];
2223+
2224+
/**
2225+
* <p>The account ID for the owner of the S3 bucket.</p>
2226+
* @public
2227+
*/
2228+
bucketOwnerAccountId?: string;
22092229
}
22102230

22112231
/**
@@ -2358,6 +2378,12 @@ export interface CreateDataSourceRequest {
23582378
*/
23592379
dataSourceConfiguration: DataSourceConfiguration | undefined;
23602380

2381+
/**
2382+
* <p>The deletion policy for the requested data source</p>
2383+
* @public
2384+
*/
2385+
dataDeletionPolicy?: DataDeletionPolicy;
2386+
23612387
/**
23622388
* <p>Contains details about the server-side encryption for the data source.</p>
23632389
* @public
@@ -2377,6 +2403,7 @@ export interface CreateDataSourceRequest {
23772403
*/
23782404
export const DataSourceStatus = {
23792405
AVAILABLE: "AVAILABLE",
2406+
DELETE_UNSUCCESSFUL: "DELETE_UNSUCCESSFUL",
23802407
DELETING: "DELETING",
23812408
} as const;
23822409

@@ -2446,6 +2473,12 @@ export interface DataSource {
24462473
*/
24472474
vectorIngestionConfiguration?: VectorIngestionConfiguration;
24482475

2476+
/**
2477+
* <p>The deletion policy for the data source.</p>
2478+
* @public
2479+
*/
2480+
dataDeletionPolicy?: DataDeletionPolicy;
2481+
24492482
/**
24502483
* <p>The time at which the data source was created.</p>
24512484
* @public
@@ -2457,6 +2490,12 @@ export interface DataSource {
24572490
* @public
24582491
*/
24592492
updatedAt: Date | undefined;
2493+
2494+
/**
2495+
* <p>The details of the failure reasons related to the data source.</p>
2496+
* @public
2497+
*/
2498+
failureReasons?: string[];
24602499
}
24612500

24622501
/**
@@ -2654,6 +2693,12 @@ export interface UpdateDataSourceRequest {
26542693
*/
26552694
dataSourceConfiguration: DataSourceConfiguration | undefined;
26562695

2696+
/**
2697+
* <p>The data deletion policy of the updated data source.</p>
2698+
* @public
2699+
*/
2700+
dataDeletionPolicy?: DataDeletionPolicy;
2701+
26572702
/**
26582703
* <p>Contains details about server-side encryption of the data source.</p>
26592704
* @public
@@ -3517,6 +3562,7 @@ export interface CreateKnowledgeBaseRequest {
35173562
export const KnowledgeBaseStatus = {
35183563
ACTIVE: "ACTIVE",
35193564
CREATING: "CREATING",
3565+
DELETE_UNSUCCESSFUL: "DELETE_UNSUCCESSFUL",
35203566
DELETING: "DELETING",
35213567
FAILED: "FAILED",
35223568
UPDATING: "UPDATING",

clients/client-bedrock-agent/src/protocols/Aws_restJson1.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,7 @@ export const se_CreateDataSourceCommand = async (
302302
body = JSON.stringify(
303303
take(input, {
304304
clientToken: [true, (_) => _ ?? generateIdempotencyToken()],
305+
dataDeletionPolicy: [],
305306
dataSourceConfiguration: (_) => _json(_),
306307
description: [],
307308
name: [],
@@ -1033,6 +1034,7 @@ export const se_UpdateDataSourceCommand = async (
10331034
let body: any;
10341035
body = JSON.stringify(
10351036
take(input, {
1037+
dataDeletionPolicy: [],
10361038
dataSourceConfiguration: (_) => _json(_),
10371039
description: [],
10381040
name: [],
@@ -2476,9 +2478,11 @@ const de_AgentVersionSummary = (output: any, context: __SerdeContext): AgentVers
24762478
const de_DataSource = (output: any, context: __SerdeContext): DataSource => {
24772479
return take(output, {
24782480
createdAt: (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
2481+
dataDeletionPolicy: __expectString,
24792482
dataSourceConfiguration: _json,
24802483
dataSourceId: __expectString,
24812484
description: __expectString,
2485+
failureReasons: _json,
24822486
knowledgeBaseId: __expectString,
24832487
name: __expectString,
24842488
serverSideEncryptionConfiguration: _json,

0 commit comments

Comments
 (0)