Skip to content

Commit de21918

Browse files
author
awstools
committed
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.
1 parent 2df520d commit de21918

File tree

6 files changed

+103
-11
lines changed

6 files changed

+103
-11
lines changed

clients/client-bedrock/src/commands/CreateModelInvocationJobCommand.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,24 @@ export interface CreateModelInvocationJobCommandOutput extends CreateModelInvoca
4545
* s3InputDataConfig: { // ModelInvocationJobS3InputDataConfig
4646
* s3InputFormat: "JSONL",
4747
* s3Uri: "STRING_VALUE", // required
48+
* s3BucketOwner: "STRING_VALUE",
4849
* },
4950
* },
5051
* outputDataConfig: { // ModelInvocationJobOutputDataConfig Union: only one key present
5152
* s3OutputDataConfig: { // ModelInvocationJobS3OutputDataConfig
5253
* s3Uri: "STRING_VALUE", // required
5354
* s3EncryptionKeyId: "STRING_VALUE",
55+
* s3BucketOwner: "STRING_VALUE",
5456
* },
5557
* },
58+
* vpcConfig: { // VpcConfig
59+
* subnetIds: [ // SubnetIds // required
60+
* "STRING_VALUE",
61+
* ],
62+
* securityGroupIds: [ // SecurityGroupIds // required
63+
* "STRING_VALUE",
64+
* ],
65+
* },
5666
* timeoutDurationInHours: Number("int"),
5767
* tags: [ // TagList
5868
* { // Tag

clients/client-bedrock/src/commands/GetModelInvocationJobCommand.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,24 @@ export interface GetModelInvocationJobCommandOutput extends GetModelInvocationJo
6060
* // s3InputDataConfig: { // ModelInvocationJobS3InputDataConfig
6161
* // s3InputFormat: "JSONL",
6262
* // s3Uri: "STRING_VALUE", // required
63+
* // s3BucketOwner: "STRING_VALUE",
6364
* // },
6465
* // },
6566
* // outputDataConfig: { // ModelInvocationJobOutputDataConfig Union: only one key present
6667
* // s3OutputDataConfig: { // ModelInvocationJobS3OutputDataConfig
6768
* // s3Uri: "STRING_VALUE", // required
6869
* // s3EncryptionKeyId: "STRING_VALUE",
70+
* // s3BucketOwner: "STRING_VALUE",
6971
* // },
7072
* // },
73+
* // vpcConfig: { // VpcConfig
74+
* // subnetIds: [ // SubnetIds // required
75+
* // "STRING_VALUE",
76+
* // ],
77+
* // securityGroupIds: [ // SecurityGroupIds // required
78+
* // "STRING_VALUE",
79+
* // ],
80+
* // },
7181
* // timeoutDurationInHours: Number("int"),
7282
* // jobExpirationTime: new Date("TIMESTAMP"),
7383
* // };

clients/client-bedrock/src/commands/ListModelInvocationJobsCommand.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,24 @@ export interface ListModelInvocationJobsCommandOutput extends ListModelInvocatio
6969
* // s3InputDataConfig: { // ModelInvocationJobS3InputDataConfig
7070
* // s3InputFormat: "JSONL",
7171
* // s3Uri: "STRING_VALUE", // required
72+
* // s3BucketOwner: "STRING_VALUE",
7273
* // },
7374
* // },
7475
* // outputDataConfig: { // ModelInvocationJobOutputDataConfig Union: only one key present
7576
* // s3OutputDataConfig: { // ModelInvocationJobS3OutputDataConfig
7677
* // s3Uri: "STRING_VALUE", // required
7778
* // s3EncryptionKeyId: "STRING_VALUE",
79+
* // s3BucketOwner: "STRING_VALUE",
7880
* // },
7981
* // },
82+
* // vpcConfig: { // VpcConfig
83+
* // subnetIds: [ // SubnetIds // required
84+
* // "STRING_VALUE",
85+
* // ],
86+
* // securityGroupIds: [ // SecurityGroupIds // required
87+
* // "STRING_VALUE",
88+
* // ],
89+
* // },
8090
* // timeoutDurationInHours: Number("int"),
8191
* // jobExpirationTime: new Date("TIMESTAMP"),
8292
* // },

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

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3154,18 +3154,18 @@ export namespace ModelDataSource {
31543154
}
31553155

31563156
/**
3157-
* <p>VPC configuration.</p>
3157+
* <p>The configuration of a virtual private cloud (VPC). For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/usingVPC.html">Protect your data using Amazon Virtual Private Cloud and Amazon Web Services PrivateLink</a>.</p>
31583158
* @public
31593159
*/
31603160
export interface VpcConfig {
31613161
/**
3162-
* <p>VPC configuration subnets.</p>
3162+
* <p>An array of IDs for each subnet in the VPC to use.</p>
31633163
* @public
31643164
*/
31653165
subnetIds: string[] | undefined;
31663166

31673167
/**
3168-
* <p>VPC configuration security group Ids.</p>
3168+
* <p>An array of IDs for each security group in the VPC to use.</p>
31693169
* @public
31703170
*/
31713171
securityGroupIds: string[] | undefined;
@@ -3673,7 +3673,7 @@ export const S3InputFormat = {
36733673
export type S3InputFormat = (typeof S3InputFormat)[keyof typeof S3InputFormat];
36743674

36753675
/**
3676-
* <p>Contains the configuration of the S3 location of the output data.</p>
3676+
* <p>Contains the configuration of the S3 location of the input data.</p>
36773677
* @public
36783678
*/
36793679
export interface ModelInvocationJobS3InputDataConfig {
@@ -3688,6 +3688,12 @@ export interface ModelInvocationJobS3InputDataConfig {
36883688
* @public
36893689
*/
36903690
s3Uri: string | undefined;
3691+
3692+
/**
3693+
* <p>The ID of the Amazon Web Services account that owns the S3 bucket containing the input data.</p>
3694+
* @public
3695+
*/
3696+
s3BucketOwner?: string;
36913697
}
36923698

36933699
/**
@@ -3746,6 +3752,12 @@ export interface ModelInvocationJobS3OutputDataConfig {
37463752
* @public
37473753
*/
37483754
s3EncryptionKeyId?: string;
3755+
3756+
/**
3757+
* <p>The ID of the Amazon Web Services account that owns the S3 bucket containing the output data.</p>
3758+
* @public
3759+
*/
3760+
s3BucketOwner?: string;
37493761
}
37503762

37513763
/**
@@ -3829,6 +3841,12 @@ export interface CreateModelInvocationJobRequest {
38293841
*/
38303842
outputDataConfig: ModelInvocationJobOutputDataConfig | undefined;
38313843

3844+
/**
3845+
* <p>The configuration of the Virtual Private Cloud (VPC) for the data in the batch inference job. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/batch-inference-vpc">Protect batch inference jobs using a VPC</a>.</p>
3846+
* @public
3847+
*/
3848+
vpcConfig?: VpcConfig;
3849+
38323850
/**
38333851
* <p>The number of hours after which to force the batch inference job to time out.</p>
38343852
* @public
@@ -3963,6 +3981,12 @@ export interface GetModelInvocationJobResponse {
39633981
*/
39643982
outputDataConfig: ModelInvocationJobOutputDataConfig | undefined;
39653983

3984+
/**
3985+
* <p>The configuration of the Virtual Private Cloud (VPC) for the data in the batch inference job. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/batch-inference-vpc">Protect batch inference jobs using a VPC</a>.</p>
3986+
* @public
3987+
*/
3988+
vpcConfig?: VpcConfig;
3989+
39663990
/**
39673991
* <p>The number of hours after which batch inference job was set to time out.</p>
39683992
* @public
@@ -4111,6 +4135,12 @@ export interface ModelInvocationJobSummary {
41114135
*/
41124136
outputDataConfig: ModelInvocationJobOutputDataConfig | undefined;
41134137

4138+
/**
4139+
* <p>The configuration of the Virtual Private Cloud (VPC) for the data in the batch inference job. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/batch-inference-vpc">Protect batch inference jobs using a VPC</a>.</p>
4140+
* @public
4141+
*/
4142+
vpcConfig?: VpcConfig;
4143+
41144144
/**
41154145
* <p>The number of hours after which the batch inference job was set to time out.</p>
41164146
* @public
@@ -5317,8 +5347,7 @@ export interface CreateModelCustomizationJobRequest {
53175347
hyperParameters: Record<string, string> | undefined;
53185348

53195349
/**
5320-
* <p>VPC configuration (optional). Configuration parameters for the
5321-
* private Virtual Private Cloud (VPC) that contains the resources you are using for this job.</p>
5350+
* <p>The configuration of the Virtual Private Cloud (VPC) that contains the resources that you're using for this job. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/vpc-model-customization.html">Protect your model customization jobs using a VPC</a>.</p>
53225351
* @public
53235352
*/
53245353
vpcConfig?: VpcConfig;

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,7 @@ export const se_CreateModelInvocationJobCommand = async (
445445
roleArn: [],
446446
tags: (_) => _json(_),
447447
timeoutDurationInHours: [],
448+
vpcConfig: (_) => _json(_),
448449
})
449450
);
450451
b.m("POST").h(headers).b(body);
@@ -1808,6 +1809,7 @@ export const de_GetModelInvocationJobCommand = async (
18081809
status: __expectString,
18091810
submitTime: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
18101811
timeoutDurationInHours: __expectInt32,
1812+
vpcConfig: _json,
18111813
});
18121814
Object.assign(contents, doc);
18131815
return contents;
@@ -3028,6 +3030,7 @@ const de_ModelInvocationJobSummary = (output: any, context: __SerdeContext): Mod
30283030
status: __expectString,
30293031
submitTime: (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
30303032
timeoutDurationInHours: __expectInt32,
3033+
vpcConfig: _json,
30313034
}) as any;
30323035
};
30333036

codegen/sdk-codegen/aws-models/bedrock.json

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1593,7 +1593,7 @@
15931593
"vpcConfig": {
15941594
"target": "com.amazonaws.bedrock#VpcConfig",
15951595
"traits": {
1596-
"smithy.api#documentation": "<p>VPC configuration (optional). Configuration parameters for the\n private Virtual Private Cloud (VPC) that contains the resources you are using for this job.</p>"
1596+
"smithy.api#documentation": "<p>The configuration of the Virtual Private Cloud (VPC) that contains the resources that you're using for this job. For more information, see <a href=\"https://docs.aws.amazon.com/bedrock/latest/userguide/vpc-model-customization.html\">Protect your model customization jobs using a VPC</a>.</p>"
15971597
}
15981598
}
15991599
},
@@ -1827,6 +1827,12 @@
18271827
"smithy.api#required": {}
18281828
}
18291829
},
1830+
"vpcConfig": {
1831+
"target": "com.amazonaws.bedrock#VpcConfig",
1832+
"traits": {
1833+
"smithy.api#documentation": "<p>The configuration of the Virtual Private Cloud (VPC) for the data in the batch inference job. For more information, see <a href=\"https://docs.aws.amazon.com/bedrock/latest/userguide/batch-inference-vpc\">Protect batch inference jobs using a VPC</a>.</p>"
1834+
}
1835+
},
18301836
"timeoutDurationInHours": {
18311837
"target": "com.amazonaws.bedrock#ModelInvocationJobTimeoutDurationInHours",
18321838
"traits": {
@@ -4471,6 +4477,12 @@
44714477
"smithy.api#required": {}
44724478
}
44734479
},
4480+
"vpcConfig": {
4481+
"target": "com.amazonaws.bedrock#VpcConfig",
4482+
"traits": {
4483+
"smithy.api#documentation": "<p>The configuration of the Virtual Private Cloud (VPC) for the data in the batch inference job. For more information, see <a href=\"https://docs.aws.amazon.com/bedrock/latest/userguide/batch-inference-vpc\">Protect batch inference jobs using a VPC</a>.</p>"
4484+
}
4485+
},
44744486
"timeoutDurationInHours": {
44754487
"target": "com.amazonaws.bedrock#ModelInvocationJobTimeoutDurationInHours",
44764488
"traits": {
@@ -8422,10 +8434,16 @@
84228434
"smithy.api#documentation": "<p>The S3 location of the input data.</p>",
84238435
"smithy.api#required": {}
84248436
}
8437+
},
8438+
"s3BucketOwner": {
8439+
"target": "com.amazonaws.bedrock#AccountId",
8440+
"traits": {
8441+
"smithy.api#documentation": "<p>The ID of the Amazon Web Services account that owns the S3 bucket containing the input data.</p>"
8442+
}
84258443
}
84268444
},
84278445
"traits": {
8428-
"smithy.api#documentation": "<p>Contains the configuration of the S3 location of the output data.</p>"
8446+
"smithy.api#documentation": "<p>Contains the configuration of the S3 location of the input data.</p>"
84298447
}
84308448
},
84318449
"com.amazonaws.bedrock#ModelInvocationJobS3OutputDataConfig": {
@@ -8443,6 +8461,12 @@
84438461
"traits": {
84448462
"smithy.api#documentation": "<p>The unique identifier of the key that encrypts the S3 location of the output data.</p>"
84458463
}
8464+
},
8465+
"s3BucketOwner": {
8466+
"target": "com.amazonaws.bedrock#AccountId",
8467+
"traits": {
8468+
"smithy.api#documentation": "<p>The ID of the Amazon Web Services account that owns the S3 bucket containing the output data.</p>"
8469+
}
84468470
}
84478471
},
84488472
"traits": {
@@ -8602,6 +8626,12 @@
86028626
"smithy.api#required": {}
86038627
}
86048628
},
8629+
"vpcConfig": {
8630+
"target": "com.amazonaws.bedrock#VpcConfig",
8631+
"traits": {
8632+
"smithy.api#documentation": "<p>The configuration of the Virtual Private Cloud (VPC) for the data in the batch inference job. For more information, see <a href=\"https://docs.aws.amazon.com/bedrock/latest/userguide/batch-inference-vpc\">Protect batch inference jobs using a VPC</a>.</p>"
8633+
}
8634+
},
86058635
"timeoutDurationInHours": {
86068636
"target": "com.amazonaws.bedrock#ModelInvocationJobTimeoutDurationInHours",
86078637
"traits": {
@@ -9940,20 +9970,20 @@
99409970
"subnetIds": {
99419971
"target": "com.amazonaws.bedrock#SubnetIds",
99429972
"traits": {
9943-
"smithy.api#documentation": "<p>VPC configuration subnets.</p>",
9973+
"smithy.api#documentation": "<p>An array of IDs for each subnet in the VPC to use.</p>",
99449974
"smithy.api#required": {}
99459975
}
99469976
},
99479977
"securityGroupIds": {
99489978
"target": "com.amazonaws.bedrock#SecurityGroupIds",
99499979
"traits": {
9950-
"smithy.api#documentation": "<p>VPC configuration security group Ids.</p>",
9980+
"smithy.api#documentation": "<p>An array of IDs for each security group in the VPC to use.</p>",
99519981
"smithy.api#required": {}
99529982
}
99539983
}
99549984
},
99559985
"traits": {
9956-
"smithy.api#documentation": "<p>VPC configuration.</p>"
9986+
"smithy.api#documentation": "<p>The configuration of a virtual private cloud (VPC). For more information, see <a href=\"https://docs.aws.amazon.com/bedrock/latest/userguide/usingVPC.html\">Protect your data using Amazon Virtual Private Cloud and Amazon Web Services PrivateLink</a>.</p>"
99579987
}
99589988
}
99599989
}

0 commit comments

Comments
 (0)