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
assign{ [key: string]: any }assigntyping.Mapping[str, Any]assignMap<String, Object>AssignIDictionary<string, object>Assign*map[string]interface{}= Not assign variables#Using workflow variables, you can store data in a step and retrieve that data in future steps.
clientRequestTokenstringclient_request_tokenstrclientRequestTokenStringClientRequestTokenstringClientRequestToken*string= 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.
credentialsCredentialscredentialsCredentialscredentialsCredentialsCredentialsCredentialsCredentialsCredentials= None (Task is executed using the…#This enables cross-account resource invocations.
default
Default: None (Task is executed using the State Machine's execution role)
customizationTypeCustomizationTypecustomization_typeCustomizationTypecustomizationTypeCustomizationTypeCustomizationTypeCustomizationTypeCustomizationTypeCustomizationType= FINE_TUNING#customModelKmsKeyIKeycustom_model_kms_keyIKeycustomModelKmsKeyIKeyCustomModelKmsKeyIKeyCustomModelKmsKeyIKey= encrypted with the AWS owned key#customModelNamestringcustom_model_namestrcustomModelNameStringCustomModelNamestringCustomModelName*stringrequired#The maximum length is 63 characters.
customModelTagsCustomModelTag[]custom_model_tagstyping.List[CustomModelTag]customModelTagsList<CustomModelTag>CustomModelTagsCustomModelTag[]CustomModelTags*[]CustomModelTag= no tags#The maximum number of tags is 200.
heartbeatDurationheartbeatDurationheartbeatDurationHeartbeatDurationHeartbeatDuration= Nonedeprecated#heartbeatTimeoutTimeoutheartbeat_timeoutTimeoutheartbeatTimeoutTimeoutHeartbeatTimeoutTimeoutHeartbeatTimeoutTimeout= None#[disable-awslint:duration-prop-type] is needed because all props interface in aws-stepfunctions-tasks extend this interface
hyperParameters{ [key: string]: string }hyper_parameterstyping.Mapping[str, str]hyperParametersMap<String, String>HyperParametersIDictionary<string, string>HyperParameters*map[string]*string= use default hyperparameters#May also be the special value JsonPath.DISCARD, which will cause the effective input to be the empty object {}.
integrationPatternIntegrationPatternintegration_patternIntegrationPatternintegrationPatternIntegrationPatternIntegrationPatternIntegrationPatternIntegrationPatternIntegrationPattern= `IntegrationPattern.REQUEST_RESP…#You can control these AWS services using service integration patterns.
Depending on the AWS Service, the Service Integration Pattern availability will vary.
default
Default: IntegrationPattern.REQUEST_RESPONSE for most tasks. IntegrationPattern.RUN_JOB for the following exceptions: BatchSubmitJob, EmrAddStep, EmrCreateCluster, EmrTerminationCluster, and EmrContainersStartJobRun.
The maximum length is 63 characters.
jobTagsCustomModelTag[]job_tagstyping.List[CustomModelTag]jobTagsList<CustomModelTag>JobTagsCustomModelTag[]JobTags*[]CustomModelTag= no tags#The maximum number of tags is 200.
outputDataOutputBucketConfigurationoutput_dataOutputBucketConfigurationoutputDataOutputBucketConfigurationOutputDataOutputBucketConfigurationOutputDataOutputBucketConfigurationrequired#May also be the special value JsonPath.DISCARD, which will cause the effective output to be the empty object {}.
outputsanyoutputsAnyoutputsObjectOutputsobjectOutputsinterface{}= $states.result or $states.errorO…#notes · default
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.
Default: $states.result or $states.errorOutput
queryLanguageQueryLanguagequery_languageQueryLanguagequeryLanguageQueryLanguageQueryLanguageQueryLanguageQueryLanguageQueryLanguage= JSONPath#If the state does not contain a queryLanguage field, then it will use the query language specified in the top-level queryLanguage field.
May also be the special value JsonPath.DISCARD, which will cause the state's input to become its output.
resultSelector{ [key: string]: any }result_selectortyping.Mapping[str, Any]resultSelectorMap<String, Object>ResultSelectorIDictionary<string, object>ResultSelector*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.
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.
stateNamestringstate_namestrstateNameStringStateNamestringStateName*string= The construct ID will be used as…#default
Default: The construct ID will be used as state name
[disable-awslint:duration-prop-type] is needed because all props interface in aws-stepfunctions-tasks extend this interface
trainingDataTrainingBucketConfigurationtraining_dataTrainingBucketConfigurationtrainingDataTrainingBucketConfigurationTrainingDataTrainingBucketConfigurationTrainingDataTrainingBucketConfigurationrequired#validationDataValidationBucketConfiguration[]validation_datatyping.List[ValidationBucketConfiguration]validationDataList<ValidationBucketConfiguration>ValidationDataValidationBucketConfiguration[]ValidationData*[]ValidationBucketConfiguration= undefined - validate using a sub…#If you don't provide a validation dataset, specify the evaluation percentage by the Evaluation percentage hyperparameter.
The maximum number is 10.
default
Default: undefined - validate using a subset of the training data
vpcConfigIBedrockCreateModelCustomizationJobVpcConfigvpc_configIBedrockCreateModelCustomizationJobVpcConfigvpcConfigIBedrockCreateModelCustomizationJobVpcConfigVpcConfigIBedrockCreateModelCustomizationJobVpcConfigVpcConfigIBedrockCreateModelCustomizationJobVpcConfig= no VPC configuration#