Skip to content
v2.274.0

BedrockCreateModelCustomizationJobProps Struct ​

Properties for invoking a Bedrock Model.

Example ​

ts
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{}#
Workflow variables to store in this step.

Default: Not assign variables

Using workflow variables, you can store data in a step and retrieve that data in future steps.

baseModelIModelbase_modelIModelbaseModelIModelBaseModelIModelBaseModelIModelrequired#
The base model.
clientRequestTokenoptionalstringclient_request_tokenoptionalstrclientRequestTokenoptionalStringClientRequestTokenoptionalstringClientRequestTokenoptional*string#
A unique, case-sensitive identifier to ensure that the API request completes no more than one time.

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#
A comment describing this state.

Default: No comment

credentialsoptionalCredentialscredentialsoptionalCredentialscredentialsoptionalCredentialsCredentialsoptionalCredentialsCredentialsoptionalCredentials#
Credentials for an IAM Role that the State Machine assumes for executing the task.

Default: None (Task is executed using the State Machine's execution role)

This enables cross-account resource invocations.

customizationTypeoptionalCustomizationTypecustomization_typeoptionalCustomizationTypecustomizationTypeoptionalCustomizationTypeCustomizationTypeoptionalCustomizationTypeCustomizationTypeoptionalCustomizationType= FINE_TUNING#
The customization type.
customModelKmsKeyoptionalIKeycustom_model_kms_keyoptionalIKeycustomModelKmsKeyoptionalIKeyCustomModelKmsKeyoptionalIKeyCustomModelKmsKeyoptionalIKey#
The custom model is encrypted at rest using this key.

Default: encrypted with the AWS owned key

customModelNamestringcustom_model_namestrcustomModelNameStringCustomModelNamestringCustomModelName*stringrequired#
A name for the resulting custom model.

The maximum length is 63 characters.

customModelTagsoptionalCustomModelTag[]custom_model_tagsoptionaltyping.List[CustomModelTag]customModelTagsoptionalList<CustomModelTag>CustomModelTagsoptionalCustomModelTag[]CustomModelTagsoptional*[]CustomModelTag#
Tags to attach to the resulting custom model.

Default: no tags

The maximum number of tags is 200.

heartbeatoptionalDurationheartbeatoptionalDurationheartbeatoptionalDurationHeartbeatoptionalDurationHeartbeatoptionalDuration= Nonedeprecated#
use `heartbeatTimeout`
heartbeatTimeoutoptionalTimeoutheartbeat_timeoutoptionalTimeoutheartbeatTimeoutoptionalTimeoutHeartbeatTimeoutoptionalTimeoutHeartbeatTimeoutoptionalTimeout= None#
Timeout for the heartbeat.

[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#
Parameters related to tuning the model.

Default: use default hyperparameters

inputPathoptionalstringinput_pathoptionalstrinputPathoptionalStringInputPathoptionalstringInputPathoptional*string= $#
JSONPath expression to select part of the state to be the input to this state.

May also be the special value JsonPath.DISCARD, which will cause the effective input to be the empty object {}.

integrationPatternoptionalIntegrationPatternintegration_patternoptionalIntegrationPatternintegrationPatternoptionalIntegrationPatternIntegrationPatternoptionalIntegrationPatternIntegrationPatternoptionalIntegrationPattern#
AWS Step Functions integrates with services directly in the Amazon States Language.

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.

jobNamestringjob_namestrjobNameStringJobNamestringJobName*stringrequired#
A name for the fine-tuning job.

The maximum length is 63 characters.

jobTagsoptionalCustomModelTag[]job_tagsoptionaltyping.List[CustomModelTag]jobTagsoptionalList<CustomModelTag>JobTagsoptionalCustomModelTag[]JobTagsoptional*[]CustomModelTag#
Tags to attach to the job.

Default: no tags

The maximum number of tags is 200.

The S3 bucket configuration where the output data is stored.
outputPathoptionalstringoutput_pathoptionalstroutputPathoptionalStringOutputPathoptionalstringOutputPathoptional*string= $#
JSONPath expression to select part of the state to be the output to this state.

May also be the special value JsonPath.DISCARD, which will cause the effective output to be the empty object {}.

outputsoptionalanyoutputsoptionalAnyoutputsoptionalObjectOutputsoptionalobjectOutputsoptionalinterface{}#
Used to specify and transform output from the state.

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#
The name of the query language used by the state.

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= $#
JSONPath expression to indicate where to inject the state's output.

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#
The JSON that will replace the state's raw result and become the effective result before ResultPath is applied.

You can use ResultSelector to create a payload with values that are static or selected from the state's raw result.

roleoptionalIRoleRefroleoptionalIRoleRefroleoptionalIRoleRefRoleoptionalIRoleRefRoleoptionalIRoleRef#
The IAM role that Amazon Bedrock can assume to perform tasks on your behalf.

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#
Optional name for this state.

Default: The construct ID will be used as state name

taskTimeoutoptionalTimeouttask_timeoutoptionalTimeouttaskTimeoutoptionalTimeoutTaskTimeoutoptionalTimeoutTaskTimeoutoptionalTimeout= None#
Timeout for the task.

[disable-awslint:duration-prop-type] is needed because all props interface in aws-stepfunctions-tasks extend this interface

timeoutoptionalDurationtimeoutoptionalDurationtimeoutoptionalDurationTimeoutoptionalDurationTimeoutoptionalDuration= Nonedeprecated#
use `taskTimeout`
The S3 bucket configuration where the training data is stored.
validationDataoptionalValidationBucketConfiguration[]validation_dataoptionaltyping.List[ValidationBucketConfiguration]validationDataoptionalList<ValidationBucketConfiguration>ValidationDataoptionalValidationBucketConfiguration[]ValidationDataoptional*[]ValidationBucketConfiguration#
The S3 bucket configuration where the validation data is stored.

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.