BedrockCreateModelCustomizationJobProps Struct
Properties for invoking a Bedrock Model.
Example
import * as bedrock from 'aws-cdk-lib/aws-bedrock';
import * as kms from 'aws-cdk-lib/aws-kms';
declare const outputBucket: s3.IBucket;
declare const trainingBucket: s3.IBucket;
declare const validationBucket: s3.IBucket;
declare const kmsKey: kms.IKey;
declare const vpc: ec2.IVpc;
const model = bedrock.FoundationModel.fromFoundationModelId(
this,
'Model',
bedrock.FoundationModelIdentifier.AMAZON_TITAN_TEXT_G1_EXPRESS_V1,
);
const task = new tasks.BedrockCreateModelCustomizationJob(this, 'CreateModelCustomizationJob', {
baseModel: model,
clientRequestToken: 'MyToken',
customizationType: tasks.CustomizationType.FINE_TUNING,
customModelKmsKey: kmsKey,
customModelName: 'MyCustomModel', // required
customModelTags: [{ key: 'key1', value: 'value1' }],
hyperParameters: {
batchSize: '10',
},
jobName: 'MyCustomizationJob', // required
jobTags: [{ key: 'key2', value: 'value2' }],
outputData: {
bucket: outputBucket, // required
path: 'output-data/',
},
trainingData: {
bucket: trainingBucket,
path: 'training-data/data.json',
}, // required
// If you don't provide validation data, you have to specify `Evaluation percentage` hyperparameter.
validationData: [
{
bucket: validationBucket,
path: 'validation-data/data.json',
},
],
vpcConfig: {
securityGroups: [new ec2.SecurityGroup(this, 'SecurityGroup', { vpc })],
subnets: vpc.privateSubnets,
},
});
Properties
assignoptional{ [key: string]: any }assignoptionaltyping.Mapping[str, Any]assignoptionalMap<String, Object>AssignoptionalIDictionary<string, object>Assignoptional*map[string]interface{}#Default: Not assign variables
Using workflow variables, you can store data in a step and retrieve that data in future steps.
clientRequestTokenoptionalstringclient_request_tokenoptionalstrclientRequestTokenoptionalStringClientRequestTokenoptionalstringClientRequestTokenoptional*string#Default: no client request token
If this token matches a previous request, Amazon Bedrock ignores the request, but does not return an error.
The maximum length is 256 characters.
commentoptionalstringcommentoptionalstrcommentoptionalStringCommentoptionalstringCommentoptional*string#Default: No comment
credentialsoptionalCredentialscredentialsoptionalCredentialscredentialsoptionalCredentialsCredentialsoptionalCredentialsCredentialsoptionalCredentials#Default: None (Task is executed using the State Machine's execution role)
This enables cross-account resource invocations.
customizationTypeoptionalCustomizationTypecustomization_typeoptionalCustomizationTypecustomizationTypeoptionalCustomizationTypeCustomizationTypeoptionalCustomizationTypeCustomizationTypeoptionalCustomizationType= FINE_TUNING#customModelKmsKeyoptionalIKeycustom_model_kms_keyoptionalIKeycustomModelKmsKeyoptionalIKeyCustomModelKmsKeyoptionalIKeyCustomModelKmsKeyoptionalIKey#Default: encrypted with the AWS owned key
customModelNamestringcustom_model_namestrcustomModelNameStringCustomModelNamestringCustomModelName*stringrequired#The maximum length is 63 characters.
customModelTagsoptionalCustomModelTag[]custom_model_tagsoptionaltyping.List[CustomModelTag]customModelTagsoptionalList<CustomModelTag>CustomModelTagsoptionalCustomModelTag[]CustomModelTagsoptional*[]CustomModelTag#Default: no tags
The maximum number of tags is 200.
heartbeatoptionalDurationheartbeatoptionalDurationheartbeatoptionalDurationHeartbeatoptionalDurationHeartbeatoptionalDuration= Nonedeprecated#heartbeatTimeoutoptionalTimeoutheartbeat_timeoutoptionalTimeoutheartbeatTimeoutoptionalTimeoutHeartbeatTimeoutoptionalTimeoutHeartbeatTimeoutoptionalTimeout= None#[disable-awslint:duration-prop-type] is needed because all props interface in aws-stepfunctions-tasks extend this interface
hyperParametersoptional{ [key: string]: string }hyper_parametersoptionaltyping.Mapping[str, str]hyperParametersoptionalMap<String, String>HyperParametersoptionalIDictionary<string, string>HyperParametersoptional*map[string]*string#Default: use default hyperparameters
inputPathoptionalstringinput_pathoptionalstrinputPathoptionalStringInputPathoptionalstringInputPathoptional*string= $#May also be the special value JsonPath.DISCARD, which will cause the effective input to be the empty object {}.
integrationPatternoptionalIntegrationPatternintegration_patternoptionalIntegrationPatternintegrationPatternoptionalIntegrationPatternIntegrationPatternoptionalIntegrationPatternIntegrationPatternoptionalIntegrationPattern#Default: IntegrationPattern.REQUEST_RESPONSE for most tasks. IntegrationPattern.RUN_JOB for the following exceptions: BatchSubmitJob, EmrAddStep, EmrCreateCluster, EmrTerminationCluster, and EmrContainersStartJobRun.
You can control these AWS services using service integration patterns.
Depending on the AWS Service, the Service Integration Pattern availability will vary.
The maximum length is 63 characters.
jobTagsoptionalCustomModelTag[]job_tagsoptionaltyping.List[CustomModelTag]jobTagsoptionalList<CustomModelTag>JobTagsoptionalCustomModelTag[]JobTagsoptional*[]CustomModelTag#Default: no tags
The maximum number of tags is 200.
outputDataOutputBucketConfigurationoutput_dataOutputBucketConfigurationoutputDataOutputBucketConfigurationOutputDataOutputBucketConfigurationOutputDataOutputBucketConfigurationrequired#outputPathoptionalstringoutput_pathoptionalstroutputPathoptionalStringOutputPathoptionalstringOutputPathoptional*string= $#May also be the special value JsonPath.DISCARD, which will cause the effective output to be the empty object {}.
outputsoptionalanyoutputsoptionalAnyoutputsoptionalObjectOutputsoptionalobjectOutputsoptionalinterface{}#Default: $states.result or $states.errorOutput
notes
When specified, the value overrides the state output default. The output field accepts any JSON value (object, array, string, number, boolean, null). Any string value, including those inside objects or arrays, will be evaluated as JSONata if surrounded by {% %} characters. Output also accepts a JSONata expression directly.
queryLanguageoptionalQueryLanguagequery_languageoptionalQueryLanguagequeryLanguageoptionalQueryLanguageQueryLanguageoptionalQueryLanguageQueryLanguageoptionalQueryLanguage= JSONPath#If the state does not contain a queryLanguage field, then it will use the query language specified in the top-level queryLanguage field.
resultPathoptionalstringresult_pathoptionalstrresultPathoptionalStringResultPathoptionalstringResultPathoptional*string= $#May also be the special value JsonPath.DISCARD, which will cause the state's input to become its output.
resultSelectoroptional{ [key: string]: any }result_selectoroptionaltyping.Mapping[str, Any]resultSelectoroptionalMap<String, Object>ResultSelectoroptionalIDictionary<string, object>ResultSelectoroptional*map[string]interface{}= None#You can use ResultSelector to create a payload with values that are static or selected from the state's raw result.
roleoptionalIRoleRefroleoptionalIRoleRefroleoptionalIRoleRefRoleoptionalIRoleRefRoleoptionalIRoleRef#Default: use auto generated role
notes
For example, during model training, Amazon Bedrock needs your permission to read input data from an S3 bucket, write model artifacts to an S3 bucket. To pass this role to Amazon Bedrock, the caller of this API must have the iam:PassRole permission.
stateNameoptionalstringstate_nameoptionalstrstateNameoptionalStringStateNameoptionalstringStateNameoptional*string#Default: The construct ID will be used as state name
taskTimeoutoptionalTimeouttask_timeoutoptionalTimeouttaskTimeoutoptionalTimeoutTaskTimeoutoptionalTimeoutTaskTimeoutoptionalTimeout= None#[disable-awslint:duration-prop-type] is needed because all props interface in aws-stepfunctions-tasks extend this interface
timeoutoptionalDurationtimeoutoptionalDurationtimeoutoptionalDurationTimeoutoptionalDurationTimeoutoptionalDuration= Nonedeprecated#trainingDataTrainingBucketConfigurationtraining_dataTrainingBucketConfigurationtrainingDataTrainingBucketConfigurationTrainingDataTrainingBucketConfigurationTrainingDataTrainingBucketConfigurationrequired#validationDataoptionalValidationBucketConfiguration[]validation_dataoptionaltyping.List[ValidationBucketConfiguration]validationDataoptionalList<ValidationBucketConfiguration>ValidationDataoptionalValidationBucketConfiguration[]ValidationDataoptional*[]ValidationBucketConfiguration#Default: undefined - validate using a subset of the training data
If you don't provide a validation dataset, specify the evaluation percentage by the Evaluation percentage hyperparameter.
The maximum number is 10.
vpcConfigoptionalIBedrockCreateModelCustomizationJobVpcConfigvpc_configoptionalIBedrockCreateModelCustomizationJobVpcConfigvpcConfigoptionalIBedrockCreateModelCustomizationJobVpcConfigVpcConfigoptionalIBedrockCreateModelCustomizationJobVpcConfigVpcConfigoptionalIBedrockCreateModelCustomizationJobVpcConfig#Default: no VPC configuration