Skip to content

Commit

Permalink
feat(client-bedrock): This feature adds cross account s3 bucket and V…
Browse files Browse the repository at this point in the history
…PC support to ModelInvocation jobs. To use a cross account bucket, pass in the accountId of the bucket to s3BucketOwner in the ModelInvocationJobInputDataConfig or ModelInvocationJobOutputDataConfig.
  • Loading branch information
awstools committed Sep 16, 2024
1 parent 2df520d commit de21918
Show file tree
Hide file tree
Showing 6 changed files with 103 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
* // };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
* // },
Expand Down
41 changes: 35 additions & 6 deletions clients/client-bedrock/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3154,18 +3154,18 @@ export namespace ModelDataSource {
}

/**
* <p>VPC configuration.</p>
* <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>
* @public
*/
export interface VpcConfig {
/**
* <p>VPC configuration subnets.</p>
* <p>An array of IDs for each subnet in the VPC to use.</p>
* @public
*/
subnetIds: string[] | undefined;

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

/**
* <p>Contains the configuration of the S3 location of the output data.</p>
* <p>Contains the configuration of the S3 location of the input data.</p>
* @public
*/
export interface ModelInvocationJobS3InputDataConfig {
Expand All @@ -3688,6 +3688,12 @@ export interface ModelInvocationJobS3InputDataConfig {
* @public
*/
s3Uri: string | undefined;

/**
* <p>The ID of the Amazon Web Services account that owns the S3 bucket containing the input data.</p>
* @public
*/
s3BucketOwner?: string;
}

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

/**
* <p>The ID of the Amazon Web Services account that owns the S3 bucket containing the output data.</p>
* @public
*/
s3BucketOwner?: string;
}

/**
Expand Down Expand Up @@ -3829,6 +3841,12 @@ export interface CreateModelInvocationJobRequest {
*/
outputDataConfig: ModelInvocationJobOutputDataConfig | undefined;

/**
* <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>
* @public
*/
vpcConfig?: VpcConfig;

/**
* <p>The number of hours after which to force the batch inference job to time out.</p>
* @public
Expand Down Expand Up @@ -3963,6 +3981,12 @@ export interface GetModelInvocationJobResponse {
*/
outputDataConfig: ModelInvocationJobOutputDataConfig | undefined;

/**
* <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>
* @public
*/
vpcConfig?: VpcConfig;

/**
* <p>The number of hours after which batch inference job was set to time out.</p>
* @public
Expand Down Expand Up @@ -4111,6 +4135,12 @@ export interface ModelInvocationJobSummary {
*/
outputDataConfig: ModelInvocationJobOutputDataConfig | undefined;

/**
* <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>
* @public
*/
vpcConfig?: VpcConfig;

/**
* <p>The number of hours after which the batch inference job was set to time out.</p>
* @public
Expand Down Expand Up @@ -5317,8 +5347,7 @@ export interface CreateModelCustomizationJobRequest {
hyperParameters: Record<string, string> | undefined;

/**
* <p>VPC configuration (optional). Configuration parameters for the
* private Virtual Private Cloud (VPC) that contains the resources you are using for this job.</p>
* <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>
* @public
*/
vpcConfig?: VpcConfig;
Expand Down
3 changes: 3 additions & 0 deletions clients/client-bedrock/src/protocols/Aws_restJson1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,7 @@ export const se_CreateModelInvocationJobCommand = async (
roleArn: [],
tags: (_) => _json(_),
timeoutDurationInHours: [],
vpcConfig: (_) => _json(_),
})
);
b.m("POST").h(headers).b(body);
Expand Down Expand Up @@ -1808,6 +1809,7 @@ export const de_GetModelInvocationJobCommand = async (
status: __expectString,
submitTime: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
timeoutDurationInHours: __expectInt32,
vpcConfig: _json,
});
Object.assign(contents, doc);
return contents;
Expand Down Expand Up @@ -3028,6 +3030,7 @@ const de_ModelInvocationJobSummary = (output: any, context: __SerdeContext): Mod
status: __expectString,
submitTime: (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
timeoutDurationInHours: __expectInt32,
vpcConfig: _json,
}) as any;
};

Expand Down
40 changes: 35 additions & 5 deletions codegen/sdk-codegen/aws-models/bedrock.json
Original file line number Diff line number Diff line change
Expand Up @@ -1593,7 +1593,7 @@
"vpcConfig": {
"target": "com.amazonaws.bedrock#VpcConfig",
"traits": {
"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>"
"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>"
}
}
},
Expand Down Expand Up @@ -1827,6 +1827,12 @@
"smithy.api#required": {}
}
},
"vpcConfig": {
"target": "com.amazonaws.bedrock#VpcConfig",
"traits": {
"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>"
}
},
"timeoutDurationInHours": {
"target": "com.amazonaws.bedrock#ModelInvocationJobTimeoutDurationInHours",
"traits": {
Expand Down Expand Up @@ -4471,6 +4477,12 @@
"smithy.api#required": {}
}
},
"vpcConfig": {
"target": "com.amazonaws.bedrock#VpcConfig",
"traits": {
"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>"
}
},
"timeoutDurationInHours": {
"target": "com.amazonaws.bedrock#ModelInvocationJobTimeoutDurationInHours",
"traits": {
Expand Down Expand Up @@ -8422,10 +8434,16 @@
"smithy.api#documentation": "<p>The S3 location of the input data.</p>",
"smithy.api#required": {}
}
},
"s3BucketOwner": {
"target": "com.amazonaws.bedrock#AccountId",
"traits": {
"smithy.api#documentation": "<p>The ID of the Amazon Web Services account that owns the S3 bucket containing the input data.</p>"
}
}
},
"traits": {
"smithy.api#documentation": "<p>Contains the configuration of the S3 location of the output data.</p>"
"smithy.api#documentation": "<p>Contains the configuration of the S3 location of the input data.</p>"
}
},
"com.amazonaws.bedrock#ModelInvocationJobS3OutputDataConfig": {
Expand All @@ -8443,6 +8461,12 @@
"traits": {
"smithy.api#documentation": "<p>The unique identifier of the key that encrypts the S3 location of the output data.</p>"
}
},
"s3BucketOwner": {
"target": "com.amazonaws.bedrock#AccountId",
"traits": {
"smithy.api#documentation": "<p>The ID of the Amazon Web Services account that owns the S3 bucket containing the output data.</p>"
}
}
},
"traits": {
Expand Down Expand Up @@ -8602,6 +8626,12 @@
"smithy.api#required": {}
}
},
"vpcConfig": {
"target": "com.amazonaws.bedrock#VpcConfig",
"traits": {
"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>"
}
},
"timeoutDurationInHours": {
"target": "com.amazonaws.bedrock#ModelInvocationJobTimeoutDurationInHours",
"traits": {
Expand Down Expand Up @@ -9940,20 +9970,20 @@
"subnetIds": {
"target": "com.amazonaws.bedrock#SubnetIds",
"traits": {
"smithy.api#documentation": "<p>VPC configuration subnets.</p>",
"smithy.api#documentation": "<p>An array of IDs for each subnet in the VPC to use.</p>",
"smithy.api#required": {}
}
},
"securityGroupIds": {
"target": "com.amazonaws.bedrock#SecurityGroupIds",
"traits": {
"smithy.api#documentation": "<p>VPC configuration security group Ids.</p>",
"smithy.api#documentation": "<p>An array of IDs for each security group in the VPC to use.</p>",
"smithy.api#required": {}
}
}
},
"traits": {
"smithy.api#documentation": "<p>VPC configuration.</p>"
"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>"
}
}
}
Expand Down

0 comments on commit de21918

Please sign in to comment.