Skip to content
v2.273.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 ​

assign{ [key: string]: any }assigntyping.Mapping[str, Any]assignMap<String, Object>AssignIDictionary<string, object>Assign*map[string]interface{}= Not assign variables#
Workflow variables to store in this step.

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

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

If this token matches a previous request, Amazon Bedrock ignores the request, but does not return an error.

The maximum length is 256 characters.

commentstringcommentstrcommentStringCommentstringComment*string= No comment#
A comment describing this state.
credentialsCredentialscredentialsCredentialscredentialsCredentialsCredentialsCredentialsCredentialsCredentials= None (Task is executed using the…#
Credentials for an IAM Role that the State Machine assumes for executing the task.

This enables cross-account resource invocations.

default

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

customizationTypeCustomizationTypecustomization_typeCustomizationTypecustomizationTypeCustomizationTypeCustomizationTypeCustomizationTypeCustomizationTypeCustomizationType= FINE_TUNING#
The customization type.
customModelKmsKeyIKeycustom_model_kms_keyIKeycustomModelKmsKeyIKeyCustomModelKmsKeyIKeyCustomModelKmsKeyIKey= encrypted with the AWS owned key#
The custom model is encrypted at rest using this key.
customModelNamestringcustom_model_namestrcustomModelNameStringCustomModelNamestringCustomModelName*stringrequired#
A name for the resulting custom model.

The maximum length is 63 characters.

customModelTagsCustomModelTag[]custom_model_tagstyping.List[CustomModelTag]customModelTagsList<CustomModelTag>CustomModelTagsCustomModelTag[]CustomModelTags*[]CustomModelTag= no tags#
Tags to attach to the resulting custom model.

The maximum number of tags is 200.

heartbeatDurationheartbeatDurationheartbeatDurationHeartbeatDurationHeartbeatDuration= Nonedeprecated#
use `heartbeatTimeout`
heartbeatTimeoutTimeoutheartbeat_timeoutTimeoutheartbeatTimeoutTimeoutHeartbeatTimeoutTimeoutHeartbeatTimeoutTimeout= None#
Timeout for the heartbeat.

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

integrationPatternIntegrationPatternintegration_patternIntegrationPatternintegrationPatternIntegrationPatternIntegrationPatternIntegrationPatternIntegrationPatternIntegrationPattern= `IntegrationPattern.REQUEST_RESP…#
AWS Step Functions integrates with services directly in the Amazon States Language.

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.

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

The maximum length is 63 characters.

jobTagsCustomModelTag[]job_tagstyping.List[CustomModelTag]jobTagsList<CustomModelTag>JobTagsCustomModelTag[]JobTags*[]CustomModelTag= no tags#
Tags to attach to the job.

The maximum number of tags is 200.

The S3 bucket configuration where the output data is stored.
outputPathstringoutput_pathstroutputPathStringOutputPathstringOutputPath*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 {}.

outputsanyoutputsAnyoutputsObjectOutputsobjectOutputsinterface{}= $states.result or $states.errorO…#
Used to specify and transform output from the state.
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#
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.

resultPathstringresult_pathstrresultPathStringResultPathstringResultPath*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.

resultSelector{ [key: string]: any }result_selectortyping.Mapping[str, Any]resultSelectorMap<String, Object>ResultSelectorIDictionary<string, object>ResultSelector*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.

roleIRoleRefroleIRoleRefroleIRoleRefRoleIRoleRefRoleIRoleRef= use auto generated role#
The IAM role that Amazon Bedrock can assume to perform tasks on your behalf.
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…#
Optional name for this state.
default

Default: The construct ID will be used as state name

taskTimeoutTimeouttask_timeoutTimeouttaskTimeoutTimeoutTaskTimeoutTimeoutTaskTimeoutTimeout= None#
Timeout for the task.

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

timeoutDurationtimeoutDurationtimeoutDurationTimeoutDurationTimeoutDuration= Nonedeprecated#
use `taskTimeout`
The S3 bucket configuration where the training data is stored.
validationDataValidationBucketConfiguration[]validation_datatyping.List[ValidationBucketConfiguration]validationDataList<ValidationBucketConfiguration>ValidationDataValidationBucketConfiguration[]ValidationData*[]ValidationBucketConfiguration= undefined - validate using a sub…#
The S3 bucket configuration where the validation data is stored.

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

Used as props by ​