Skip to content

Commit 0c653d3

Browse files
feat(stepfunctions-tasks): bedrock createModelCustomizationJob integration (#31913)
This PR was [previously created](#29043) and passed the community review, but the maintainer review stopped midway, and it was eventually closed. There shouldn’t be any issues with the content, so I am submitting the PR again. ### Issue # (if applicable) Closes #29042 ### Reason for this change AWS stepfunctions support optimized integration with AWS bedrock. Currently, only invokeModel is supported by CDK, but I would like createModelCustomizationJob to be supported in the same manner. ### Description of changes I've added CreatemodelCustomizationJob class. ```ts const taskConfig = { baseModel: model, clientRequestToken: 'MyToken', customizationType: CustomizationType.FINE_TUNING, kmsKey, customModelName: 'MyCustomModel', customModelTags: [{ key: 'key1', value: 'value1' }], hyperParameters: { batchSize: '10', }, jobName: 'MyCustomizationJob', jobTags: [{ key: 'key2', value: 'value2' }], outputDataS3Uri: outputBucket.s3UrlForObject(), trainingDataS3Uri: trainingBucket.s3UrlForObject(), validationDataS3Uri: [validationBucket.s3UrlForObject()], vpcConfig: { securityGroups: [new ec2.SecurityGroup(stack, 'SecurityGroup', { vpc })], subnets: vpc.isolatedSubnets, }, }; const task1 = new BedrockCreateModelCustomizationJob(stack, 'CreateModelCustomizationJob1', taskConfig); const chain = sfn.Chain .start(new sfn.Pass(stack, 'Start')) .next(task1) .next(new sfn.Pass(stack, 'Done')); new sfn.StateMachine(stack, 'StateMachine', { definitionBody: sfn.DefinitionBody.fromChainable(chain), timeout: cdk.Duration.seconds(30), }); ``` ### Description of how you validated changes I've added both unit and integ tests. ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent a3a0cf0 commit 0c653d3

File tree

17 files changed

+35830
-2
lines changed

17 files changed

+35830
-2
lines changed

packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/bedrock/integ.create-model-customization-job.js.snapshot/CreateModelCustomizationJobDefaultTestDeployAssertEC679DFE.assets.json

Lines changed: 33 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)