From de21918213e870e5e056971eca84868572d1c651 Mon Sep 17 00:00:00 2001 From: awstools Date: Mon, 16 Sep 2024 18:23:01 +0000 Subject: [PATCH] feat(client-bedrock): This feature adds cross account s3 bucket and VPC support to ModelInvocation jobs. To use a cross account bucket, pass in the accountId of the bucket to s3BucketOwner in the ModelInvocationJobInputDataConfig or ModelInvocationJobOutputDataConfig. --- .../CreateModelInvocationJobCommand.ts | 10 +++++ .../commands/GetModelInvocationJobCommand.ts | 10 +++++ .../ListModelInvocationJobsCommand.ts | 10 +++++ clients/client-bedrock/src/models/models_0.ts | 41 ++++++++++++++++--- .../src/protocols/Aws_restJson1.ts | 3 ++ codegen/sdk-codegen/aws-models/bedrock.json | 40 +++++++++++++++--- 6 files changed, 103 insertions(+), 11 deletions(-) diff --git a/clients/client-bedrock/src/commands/CreateModelInvocationJobCommand.ts b/clients/client-bedrock/src/commands/CreateModelInvocationJobCommand.ts index ad9fa5dd5530e..cb2a42d9290ce 100644 --- a/clients/client-bedrock/src/commands/CreateModelInvocationJobCommand.ts +++ b/clients/client-bedrock/src/commands/CreateModelInvocationJobCommand.ts @@ -45,14 +45,24 @@ export interface CreateModelInvocationJobCommandOutput extends CreateModelInvoca * s3InputDataConfig: { // ModelInvocationJobS3InputDataConfig * s3InputFormat: "JSONL", * s3Uri: "STRING_VALUE", // required + * s3BucketOwner: "STRING_VALUE", * }, * }, * outputDataConfig: { // ModelInvocationJobOutputDataConfig Union: only one key present * s3OutputDataConfig: { // ModelInvocationJobS3OutputDataConfig * s3Uri: "STRING_VALUE", // required * s3EncryptionKeyId: "STRING_VALUE", + * s3BucketOwner: "STRING_VALUE", * }, * }, + * vpcConfig: { // VpcConfig + * subnetIds: [ // SubnetIds // required + * "STRING_VALUE", + * ], + * securityGroupIds: [ // SecurityGroupIds // required + * "STRING_VALUE", + * ], + * }, * timeoutDurationInHours: Number("int"), * tags: [ // TagList * { // Tag diff --git a/clients/client-bedrock/src/commands/GetModelInvocationJobCommand.ts b/clients/client-bedrock/src/commands/GetModelInvocationJobCommand.ts index da790b7bc0ce1..f360fd399d214 100644 --- a/clients/client-bedrock/src/commands/GetModelInvocationJobCommand.ts +++ b/clients/client-bedrock/src/commands/GetModelInvocationJobCommand.ts @@ -60,14 +60,24 @@ export interface GetModelInvocationJobCommandOutput extends GetModelInvocationJo * // s3InputDataConfig: { // ModelInvocationJobS3InputDataConfig * // s3InputFormat: "JSONL", * // s3Uri: "STRING_VALUE", // required + * // s3BucketOwner: "STRING_VALUE", * // }, * // }, * // outputDataConfig: { // ModelInvocationJobOutputDataConfig Union: only one key present * // s3OutputDataConfig: { // ModelInvocationJobS3OutputDataConfig * // s3Uri: "STRING_VALUE", // required * // s3EncryptionKeyId: "STRING_VALUE", + * // s3BucketOwner: "STRING_VALUE", * // }, * // }, + * // vpcConfig: { // VpcConfig + * // subnetIds: [ // SubnetIds // required + * // "STRING_VALUE", + * // ], + * // securityGroupIds: [ // SecurityGroupIds // required + * // "STRING_VALUE", + * // ], + * // }, * // timeoutDurationInHours: Number("int"), * // jobExpirationTime: new Date("TIMESTAMP"), * // }; diff --git a/clients/client-bedrock/src/commands/ListModelInvocationJobsCommand.ts b/clients/client-bedrock/src/commands/ListModelInvocationJobsCommand.ts index 936803bdb001f..39590fe36980d 100644 --- a/clients/client-bedrock/src/commands/ListModelInvocationJobsCommand.ts +++ b/clients/client-bedrock/src/commands/ListModelInvocationJobsCommand.ts @@ -69,14 +69,24 @@ export interface ListModelInvocationJobsCommandOutput extends ListModelInvocatio * // s3InputDataConfig: { // ModelInvocationJobS3InputDataConfig * // s3InputFormat: "JSONL", * // s3Uri: "STRING_VALUE", // required + * // s3BucketOwner: "STRING_VALUE", * // }, * // }, * // outputDataConfig: { // ModelInvocationJobOutputDataConfig Union: only one key present * // s3OutputDataConfig: { // ModelInvocationJobS3OutputDataConfig * // s3Uri: "STRING_VALUE", // required * // s3EncryptionKeyId: "STRING_VALUE", + * // s3BucketOwner: "STRING_VALUE", * // }, * // }, + * // vpcConfig: { // VpcConfig + * // subnetIds: [ // SubnetIds // required + * // "STRING_VALUE", + * // ], + * // securityGroupIds: [ // SecurityGroupIds // required + * // "STRING_VALUE", + * // ], + * // }, * // timeoutDurationInHours: Number("int"), * // jobExpirationTime: new Date("TIMESTAMP"), * // }, diff --git a/clients/client-bedrock/src/models/models_0.ts b/clients/client-bedrock/src/models/models_0.ts index 63a547fa6307b..393aedbe8b7e8 100644 --- a/clients/client-bedrock/src/models/models_0.ts +++ b/clients/client-bedrock/src/models/models_0.ts @@ -3154,18 +3154,18 @@ export namespace ModelDataSource { } /** - *

VPC configuration.

+ *

The configuration of a virtual private cloud (VPC). For more information, see Protect your data using Amazon Virtual Private Cloud and Amazon Web Services PrivateLink.

* @public */ export interface VpcConfig { /** - *

VPC configuration subnets.

+ *

An array of IDs for each subnet in the VPC to use.

* @public */ subnetIds: string[] | undefined; /** - *

VPC configuration security group Ids.

+ *

An array of IDs for each security group in the VPC to use.

* @public */ securityGroupIds: string[] | undefined; @@ -3673,7 +3673,7 @@ export const S3InputFormat = { export type S3InputFormat = (typeof S3InputFormat)[keyof typeof S3InputFormat]; /** - *

Contains the configuration of the S3 location of the output data.

+ *

Contains the configuration of the S3 location of the input data.

* @public */ export interface ModelInvocationJobS3InputDataConfig { @@ -3688,6 +3688,12 @@ export interface ModelInvocationJobS3InputDataConfig { * @public */ s3Uri: string | undefined; + + /** + *

The ID of the Amazon Web Services account that owns the S3 bucket containing the input data.

+ * @public + */ + s3BucketOwner?: string; } /** @@ -3746,6 +3752,12 @@ export interface ModelInvocationJobS3OutputDataConfig { * @public */ s3EncryptionKeyId?: string; + + /** + *

The ID of the Amazon Web Services account that owns the S3 bucket containing the output data.

+ * @public + */ + s3BucketOwner?: string; } /** @@ -3829,6 +3841,12 @@ export interface CreateModelInvocationJobRequest { */ outputDataConfig: ModelInvocationJobOutputDataConfig | undefined; + /** + *

The configuration of the Virtual Private Cloud (VPC) for the data in the batch inference job. For more information, see Protect batch inference jobs using a VPC.

+ * @public + */ + vpcConfig?: VpcConfig; + /** *

The number of hours after which to force the batch inference job to time out.

* @public @@ -3963,6 +3981,12 @@ export interface GetModelInvocationJobResponse { */ outputDataConfig: ModelInvocationJobOutputDataConfig | undefined; + /** + *

The configuration of the Virtual Private Cloud (VPC) for the data in the batch inference job. For more information, see Protect batch inference jobs using a VPC.

+ * @public + */ + vpcConfig?: VpcConfig; + /** *

The number of hours after which batch inference job was set to time out.

* @public @@ -4111,6 +4135,12 @@ export interface ModelInvocationJobSummary { */ outputDataConfig: ModelInvocationJobOutputDataConfig | undefined; + /** + *

The configuration of the Virtual Private Cloud (VPC) for the data in the batch inference job. For more information, see Protect batch inference jobs using a VPC.

+ * @public + */ + vpcConfig?: VpcConfig; + /** *

The number of hours after which the batch inference job was set to time out.

* @public @@ -5317,8 +5347,7 @@ export interface CreateModelCustomizationJobRequest { hyperParameters: Record | undefined; /** - *

VPC configuration (optional). Configuration parameters for the - * private Virtual Private Cloud (VPC) that contains the resources you are using for this job.

+ *

The configuration of the Virtual Private Cloud (VPC) that contains the resources that you're using for this job. For more information, see Protect your model customization jobs using a VPC.

* @public */ vpcConfig?: VpcConfig; diff --git a/clients/client-bedrock/src/protocols/Aws_restJson1.ts b/clients/client-bedrock/src/protocols/Aws_restJson1.ts index 0ba740a253937..5cd553b9191e1 100644 --- a/clients/client-bedrock/src/protocols/Aws_restJson1.ts +++ b/clients/client-bedrock/src/protocols/Aws_restJson1.ts @@ -445,6 +445,7 @@ export const se_CreateModelInvocationJobCommand = async ( roleArn: [], tags: (_) => _json(_), timeoutDurationInHours: [], + vpcConfig: (_) => _json(_), }) ); b.m("POST").h(headers).b(body); @@ -1808,6 +1809,7 @@ export const de_GetModelInvocationJobCommand = async ( status: __expectString, submitTime: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), timeoutDurationInHours: __expectInt32, + vpcConfig: _json, }); Object.assign(contents, doc); return contents; @@ -3028,6 +3030,7 @@ const de_ModelInvocationJobSummary = (output: any, context: __SerdeContext): Mod status: __expectString, submitTime: (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), timeoutDurationInHours: __expectInt32, + vpcConfig: _json, }) as any; }; diff --git a/codegen/sdk-codegen/aws-models/bedrock.json b/codegen/sdk-codegen/aws-models/bedrock.json index 4158b29ccc7e7..5ad7952deb856 100644 --- a/codegen/sdk-codegen/aws-models/bedrock.json +++ b/codegen/sdk-codegen/aws-models/bedrock.json @@ -1593,7 +1593,7 @@ "vpcConfig": { "target": "com.amazonaws.bedrock#VpcConfig", "traits": { - "smithy.api#documentation": "

VPC configuration (optional). Configuration parameters for the\n private Virtual Private Cloud (VPC) that contains the resources you are using for this job.

" + "smithy.api#documentation": "

The configuration of the Virtual Private Cloud (VPC) that contains the resources that you're using for this job. For more information, see Protect your model customization jobs using a VPC.

" } } }, @@ -1827,6 +1827,12 @@ "smithy.api#required": {} } }, + "vpcConfig": { + "target": "com.amazonaws.bedrock#VpcConfig", + "traits": { + "smithy.api#documentation": "

The configuration of the Virtual Private Cloud (VPC) for the data in the batch inference job. For more information, see Protect batch inference jobs using a VPC.

" + } + }, "timeoutDurationInHours": { "target": "com.amazonaws.bedrock#ModelInvocationJobTimeoutDurationInHours", "traits": { @@ -4471,6 +4477,12 @@ "smithy.api#required": {} } }, + "vpcConfig": { + "target": "com.amazonaws.bedrock#VpcConfig", + "traits": { + "smithy.api#documentation": "

The configuration of the Virtual Private Cloud (VPC) for the data in the batch inference job. For more information, see Protect batch inference jobs using a VPC.

" + } + }, "timeoutDurationInHours": { "target": "com.amazonaws.bedrock#ModelInvocationJobTimeoutDurationInHours", "traits": { @@ -8422,10 +8434,16 @@ "smithy.api#documentation": "

The S3 location of the input data.

", "smithy.api#required": {} } + }, + "s3BucketOwner": { + "target": "com.amazonaws.bedrock#AccountId", + "traits": { + "smithy.api#documentation": "

The ID of the Amazon Web Services account that owns the S3 bucket containing the input data.

" + } } }, "traits": { - "smithy.api#documentation": "

Contains the configuration of the S3 location of the output data.

" + "smithy.api#documentation": "

Contains the configuration of the S3 location of the input data.

" } }, "com.amazonaws.bedrock#ModelInvocationJobS3OutputDataConfig": { @@ -8443,6 +8461,12 @@ "traits": { "smithy.api#documentation": "

The unique identifier of the key that encrypts the S3 location of the output data.

" } + }, + "s3BucketOwner": { + "target": "com.amazonaws.bedrock#AccountId", + "traits": { + "smithy.api#documentation": "

The ID of the Amazon Web Services account that owns the S3 bucket containing the output data.

" + } } }, "traits": { @@ -8602,6 +8626,12 @@ "smithy.api#required": {} } }, + "vpcConfig": { + "target": "com.amazonaws.bedrock#VpcConfig", + "traits": { + "smithy.api#documentation": "

The configuration of the Virtual Private Cloud (VPC) for the data in the batch inference job. For more information, see Protect batch inference jobs using a VPC.

" + } + }, "timeoutDurationInHours": { "target": "com.amazonaws.bedrock#ModelInvocationJobTimeoutDurationInHours", "traits": { @@ -9940,20 +9970,20 @@ "subnetIds": { "target": "com.amazonaws.bedrock#SubnetIds", "traits": { - "smithy.api#documentation": "

VPC configuration subnets.

", + "smithy.api#documentation": "

An array of IDs for each subnet in the VPC to use.

", "smithy.api#required": {} } }, "securityGroupIds": { "target": "com.amazonaws.bedrock#SecurityGroupIds", "traits": { - "smithy.api#documentation": "

VPC configuration security group Ids.

", + "smithy.api#documentation": "

An array of IDs for each security group in the VPC to use.

", "smithy.api#required": {} } } }, "traits": { - "smithy.api#documentation": "

VPC configuration.

" + "smithy.api#documentation": "

The configuration of a virtual private cloud (VPC). For more information, see Protect your data using Amazon Virtual Private Cloud and Amazon Web Services PrivateLink.

" } } }