interface ResourceConfig
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.StepFunctions.Tasks.ResourceConfig |
Java | software.amazon.awscdk.services.stepfunctions.tasks.ResourceConfig |
Python | aws_cdk.aws_stepfunctions_tasks.ResourceConfig |
TypeScript (source) | @aws-cdk/aws-stepfunctions-tasks » ResourceConfig |
Specifies the resources, ML compute instances, and ML storage volumes to deploy for model training.
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', 'mybucket'), '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
Name | Type | Description |
---|---|---|
instance | number | The number of ML compute instances to use. |
instance | Instance | ML compute instance type. |
volume | Size | Size of the ML storage volume that you want to provision. |
volume | IKey | KMS key that Amazon SageMaker uses to encrypt data on the storage volume attached to the ML compute instance(s) that run the training job. |
instanceCount
Type:
number
The number of ML compute instances to use.
instanceType
Type:
Instance
ML compute instance type.
To provide an instance type from the task input, supply an instance type in the following way where the value in the task input is an EC2 instance type prepended with "ml.":
new ec2.InstanceType(sfn.JsonPath.stringAt('$.path.to.instanceType'));
volumeSize
Type:
Size
Size of the ML storage volume that you want to provision.
volumeEncryptionKey?
Type:
IKey
(optional, default: Amazon SageMaker uses the default KMS key for Amazon S3 for your role's account)
KMS key that Amazon SageMaker uses to encrypt data on the storage volume attached to the ML compute instance(s) that run the training job.