SageMakerCreateTrainingJobProps Struct
Properties for creating an Amazon SageMaker training job.
Example
new tasks.SageMakerCreateTrainingJob(this, 'TrainSagemaker', {
trainingJobName: sfn.JsonPath.stringAt('$.JobName'),
algorithmSpecification: {
algorithmName: 'BlazingText',
trainingInputMode: tasks.InputMode.FILE,
},
inputDataConfig: [{
channelName: 'train',
dataSource: {
s3DataSource: {
s3DataType: tasks.S3DataType.S3_PREFIX,
s3Location: tasks.S3Location.fromJsonExpression('$.S3Bucket'),
},
},
}],
outputDataConfig: {
s3OutputLocation: tasks.S3Location.fromBucket(s3.Bucket.fromBucketName(this, 'Bucket', 'amzn-s3-demo-bucket'), 'myoutputpath'),
},
resourceConfig: {
instanceCount: 1,
instanceType: new ec2.InstanceType(sfn.JsonPath.stringAt('$.InstanceType')),
volumeSize: Size.gibibytes(50),
}, // optional: default is 1 instance of EC2 `M4.XLarge` with `10GB` volume
stoppingCondition: {
maxRuntime: Duration.hours(2),
}, // optional: default is 1 hour
});
Properties
algorithmSpecificationAlgorithmSpecificationalgorithm_specificationAlgorithmSpecificationalgorithmSpecificationAlgorithmSpecificationAlgorithmSpecificationAlgorithmSpecificationAlgorithmSpecificationAlgorithmSpecificationrequired#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.
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)
enableNetworkIsolationbooleanenable_network_isolationboolenableNetworkIsolationBooleanEnableNetworkIsolationboolEnableNetworkIsolation*bool= false#No inbound or outbound network calls can be made to or from the training container.
environment{ [key: string]: string }environmenttyping.Mapping[str, str]environmentMap<String, String>EnvironmentIDictionary<string, string>Environment*map[string]*string= No environment variables#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]: any }hyperparameterstyping.Mapping[str, Any]hyperparametersMap<String, Object>HyperparametersIDictionary<string, object>Hyperparameters*map[string]interface{}= No hyperparameters#Set hyperparameters before you start the learning process. For a list of hyperparameters provided by Amazon SageMaker
inputDataConfigChannel[]input_data_configtyping.List[Channel]inputDataConfigList<Channel>InputDataConfigChannel[]InputDataConfig*[]Channel= No inputDataConfig#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.
outputDataConfigOutputDataConfigoutput_data_configOutputDataConfigoutputDataConfigOutputDataConfigOutputDataConfigOutputDataConfigOutputDataConfigOutputDataConfigrequired#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.
resourceConfigResourceConfigresource_configResourceConfigresourceConfigResourceConfigResourceConfigResourceConfigResourceConfigResourceConfig= 1 instance of EC2 `M4.XLarge` wi…#default
Default: 1 instance of EC2 M4.XLarge with 10GB volume
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.
The role must be granted all necessary permissions for the SageMaker training job to be able to operate.
stateNamestringstate_namestrstateNameStringStateNamestringStateName*string= The construct ID will be used as…#default
Default: The construct ID will be used as state name
stoppingConditionStoppingConditionstopping_conditionStoppingConditionstoppingConditionStoppingConditionStoppingConditionStoppingConditionStoppingConditionStoppingCondition= max runtime of 1 hour#tags{ [key: string]: string }tagstyping.Mapping[str, str]tagsMap<String, String>TagsIDictionary<string, string>Tags*map[string]*string= No tags#[disable-awslint:duration-prop-type] is needed because all props interface in aws-stepfunctions-tasks extend this interface
trainingJobNamestringtraining_job_namestrtrainingJobNameStringTrainingJobNamestringTrainingJobName*stringrequired#