SageMakerCreateTrainingJobJsonataProps Struct
Properties for creating an Amazon SageMaker training job using JSONata.
| Source | aws-stepfunctions-tasks/lib/sagemaker/create-training-job.ts |
|---|---|
| Type last changed |
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';
import { aws_ec2 as ec2 } from 'aws-cdk-lib';
import { aws_iam as iam } from 'aws-cdk-lib';
import { aws_kms as kms } from 'aws-cdk-lib';
import { aws_stepfunctions as stepfunctions } from 'aws-cdk-lib';
import { aws_stepfunctions_tasks as stepfunctions_tasks } from 'aws-cdk-lib';
declare const assign: any;
declare const dockerImage: stepfunctions_tasks.DockerImage;
declare const hyperparameters: any;
declare const instanceType: ec2.InstanceType;
declare const key: kms.Key;
declare const outputs: any;
declare const role: iam.Role;
declare const s3Location: stepfunctions_tasks.S3Location;
declare const size: cdk.Size;
declare const subnet: ec2.Subnet;
declare const subnetFilter: ec2.SubnetFilter;
declare const taskRole: stepfunctions.TaskRole;
declare const timeout: stepfunctions.Timeout;
declare const vpc: ec2.Vpc;
const sageMakerCreateTrainingJobJsonataProps: stepfunctions_tasks.SageMakerCreateTrainingJobJsonataProps = {
algorithmSpecification: {
algorithmName: 'algorithmName',
metricDefinitions: [{
name: 'name',
regex: 'regex',
}],
trainingImage: dockerImage,
trainingInputMode: stepfunctions_tasks.InputMode.PIPE,
},
outputDataConfig: {
s3OutputLocation: s3Location,
// the properties below are optional
encryptionKey: key,
},
trainingJobName: 'trainingJobName',
// the properties below are optional
assign: {
assignKey: assign,
},
comment: 'comment',
credentials: {
role: taskRole,
},
enableNetworkIsolation: false,
environment: {
environmentKey: 'environment',
},
heartbeat: cdk.Duration.minutes(30),
heartbeatTimeout: timeout,
hyperparameters: {
hyperparametersKey: hyperparameters,
},
inputDataConfig: [{
channelName: 'channelName',
dataSource: {
s3DataSource: {
s3Location: s3Location,
// the properties below are optional
attributeNames: ['attributeNames'],
s3DataDistributionType: stepfunctions_tasks.S3DataDistributionType.FULLY_REPLICATED,
s3DataType: stepfunctions_tasks.S3DataType.MANIFEST_FILE,
},
},
// the properties below are optional
compressionType: stepfunctions_tasks.CompressionType.NONE,
contentType: 'contentType',
inputMode: stepfunctions_tasks.InputMode.PIPE,
recordWrapperType: stepfunctions_tasks.RecordWrapperType.NONE,
shuffleConfig: {
seed: 123,
},
}],
integrationPattern: stepfunctions.IntegrationPattern.REQUEST_RESPONSE,
outputs: outputs,
queryLanguage: stepfunctions.QueryLanguage.JSON_PATH,
resourceConfig: {
instanceCount: 123,
instanceType: instanceType,
volumeSize: size,
// the properties below are optional
volumeEncryptionKey: key,
},
role: role,
stateName: 'stateName',
stoppingCondition: {
maxRuntime: cdk.Duration.minutes(30),
},
tags: {
tagsKey: 'tags',
},
taskTimeout: timeout,
timeout: cdk.Duration.minutes(30),
vpcConfig: {
vpc: vpc,
// the properties below are optional
subnets: {
availabilityZones: ['availabilityZones'],
onePerAz: false,
subnetFilters: [subnetFilter],
subnetGroupName: 'subnetGroupName',
subnets: [subnet],
subnetType: ec2.SubnetType.PRIVATE_ISOLATED,
},
},
};
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk as cdk
from aws_cdk import aws_ec2 as ec2
from aws_cdk import aws_iam as iam
from aws_cdk import aws_kms as kms
from aws_cdk import aws_stepfunctions as stepfunctions
from aws_cdk import aws_stepfunctions_tasks as stepfunctions_tasks
# assign: Any
# docker_image: stepfunctions_tasks.DockerImage
# hyperparameters: Any
# instance_type: ec2.InstanceType
# key: kms.Key
# outputs: Any
# role: iam.Role
# s3_location: stepfunctions_tasks.S3Location
# size: cdk.Size
# subnet: ec2.Subnet
# subnet_filter: ec2.SubnetFilter
# task_role: stepfunctions.TaskRole
# timeout: stepfunctions.Timeout
# vpc: ec2.Vpc
sage_maker_create_training_job_jsonata_props = stepfunctions_tasks.SageMakerCreateTrainingJobJsonataProps(
algorithm_specification=stepfunctions_tasks.AlgorithmSpecification(
algorithm_name="algorithmName",
metric_definitions=[stepfunctions_tasks.MetricDefinition(
name="name",
regex="regex"
)],
training_image=docker_image,
training_input_mode=stepfunctions_tasks.InputMode.PIPE
),
output_data_config=stepfunctions_tasks.OutputDataConfig(
s3_output_location=s3_location,
# the properties below are optional
encryption_key=key
),
training_job_name="trainingJobName",
# the properties below are optional
assign={
"assign_key": assign
},
comment="comment",
credentials=stepfunctions.Credentials(
role=task_role
),
enable_network_isolation=False,
environment={
"environment_key": "environment"
},
heartbeat=cdk.Duration.minutes(30),
heartbeat_timeout=timeout,
hyperparameters={
"hyperparameters_key": hyperparameters
},
input_data_config=[stepfunctions_tasks.Channel(
channel_name="channelName",
data_source=stepfunctions_tasks.DataSource(
s3_data_source=stepfunctions_tasks.S3DataSource(
s3_location=s3_location,
# the properties below are optional
attribute_names=["attributeNames"],
s3_data_distribution_type=stepfunctions_tasks.S3DataDistributionType.FULLY_REPLICATED,
s3_data_type=stepfunctions_tasks.S3DataType.MANIFEST_FILE
)
),
# the properties below are optional
compression_type=stepfunctions_tasks.CompressionType.NONE,
content_type="contentType",
input_mode=stepfunctions_tasks.InputMode.PIPE,
record_wrapper_type=stepfunctions_tasks.RecordWrapperType.NONE,
shuffle_config=stepfunctions_tasks.ShuffleConfig(
seed=123
)
)],
integration_pattern=stepfunctions.IntegrationPattern.REQUEST_RESPONSE,
outputs=outputs,
query_language=stepfunctions.QueryLanguage.JSON_PATH,
resource_config=stepfunctions_tasks.ResourceConfig(
instance_count=123,
instance_type=instance_type,
volume_size=size,
# the properties below are optional
volume_encryption_key=key
),
role=role,
state_name="stateName",
stopping_condition=stepfunctions_tasks.StoppingCondition(
max_runtime=cdk.Duration.minutes(30)
),
tags={
"tags_key": "tags"
},
task_timeout=timeout,
timeout=cdk.Duration.minutes(30),
vpc_config=stepfunctions_tasks.VpcConfig(
vpc=vpc,
# the properties below are optional
subnets=ec2.SubnetSelection(
availability_zones=["availabilityZones"],
one_per_az=False,
subnet_filters=[subnet_filter],
subnet_group_name="subnetGroupName",
subnets=[subnet],
subnet_type=ec2.SubnetType.PRIVATE_ISOLATED
)
)
)
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.*;
import software.amazon.awscdk.services.ec2.*;
import software.amazon.awscdk.services.iam.*;
import software.amazon.awscdk.services.kms.*;
import software.amazon.awscdk.services.stepfunctions.*;
import software.amazon.awscdk.services.stepfunctions.tasks.*;
Object assign;
DockerImage dockerImage;
Object hyperparameters;
InstanceType instanceType;
Key key;
Object outputs;
Role role;
S3Location s3Location;
Size size;
Subnet subnet;
SubnetFilter subnetFilter;
TaskRole taskRole;
Timeout timeout;
Vpc vpc;
SageMakerCreateTrainingJobJsonataProps sageMakerCreateTrainingJobJsonataProps = SageMakerCreateTrainingJobJsonataProps.builder()
.algorithmSpecification(AlgorithmSpecification.builder()
.algorithmName("algorithmName")
.metricDefinitions(List.of(MetricDefinition.builder()
.name("name")
.regex("regex")
.build()))
.trainingImage(dockerImage)
.trainingInputMode(InputMode.PIPE)
.build())
.outputDataConfig(OutputDataConfig.builder()
.s3OutputLocation(s3Location)
// the properties below are optional
.encryptionKey(key)
.build())
.trainingJobName("trainingJobName")
// the properties below are optional
.assign(Map.of(
"assignKey", assign))
.comment("comment")
.credentials(Credentials.builder()
.role(taskRole)
.build())
.enableNetworkIsolation(false)
.environment(Map.of(
"environmentKey", "environment"))
.heartbeat(Duration.minutes(30))
.heartbeatTimeout(timeout)
.hyperparameters(Map.of(
"hyperparametersKey", hyperparameters))
.inputDataConfig(List.of(Channel.builder()
.channelName("channelName")
.dataSource(DataSource.builder()
.s3DataSource(S3DataSource.builder()
.s3Location(s3Location)
// the properties below are optional
.attributeNames(List.of("attributeNames"))
.s3DataDistributionType(S3DataDistributionType.FULLY_REPLICATED)
.s3DataType(S3DataType.MANIFEST_FILE)
.build())
.build())
// the properties below are optional
.compressionType(CompressionType.NONE)
.contentType("contentType")
.inputMode(InputMode.PIPE)
.recordWrapperType(RecordWrapperType.NONE)
.shuffleConfig(ShuffleConfig.builder()
.seed(123)
.build())
.build()))
.integrationPattern(IntegrationPattern.REQUEST_RESPONSE)
.outputs(outputs)
.queryLanguage(QueryLanguage.JSON_PATH)
.resourceConfig(ResourceConfig.builder()
.instanceCount(123)
.instanceType(instanceType)
.volumeSize(size)
// the properties below are optional
.volumeEncryptionKey(key)
.build())
.role(role)
.stateName("stateName")
.stoppingCondition(StoppingCondition.builder()
.maxRuntime(Duration.minutes(30))
.build())
.tags(Map.of(
"tagsKey", "tags"))
.taskTimeout(timeout)
.timeout(Duration.minutes(30))
.vpcConfig(VpcConfig.builder()
.vpc(vpc)
// the properties below are optional
.subnets(SubnetSelection.builder()
.availabilityZones(List.of("availabilityZones"))
.onePerAz(false)
.subnetFilters(List.of(subnetFilter))
.subnetGroupName("subnetGroupName")
.subnets(List.of(subnet))
.subnetType(SubnetType.PRIVATE_ISOLATED)
.build())
.build())
.build();
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK;
using Amazon.CDK.AWS.EC2;
using Amazon.CDK.AWS.IAM;
using Amazon.CDK.AWS.KMS;
using Amazon.CDK.AWS.StepFunctions;
using Amazon.CDK.AWS.StepFunctions.Tasks;
var assign;
DockerImage dockerImage;
var hyperparameters;
InstanceType instanceType;
Key key;
var outputs;
Role role;
S3Location s3Location;
Size size;
Subnet subnet;
SubnetFilter subnetFilter;
TaskRole taskRole;
Timeout timeout;
Vpc vpc;
var sageMakerCreateTrainingJobJsonataProps = new SageMakerCreateTrainingJobJsonataProps {
AlgorithmSpecification = new AlgorithmSpecification {
AlgorithmName = "algorithmName",
MetricDefinitions = new [] { new MetricDefinition {
Name = "name",
Regex = "regex"
} },
TrainingImage = dockerImage,
TrainingInputMode = InputMode.PIPE
},
OutputDataConfig = new OutputDataConfig {
S3OutputLocation = s3Location,
// the properties below are optional
EncryptionKey = key
},
TrainingJobName = "trainingJobName",
// the properties below are optional
Assign = new Dictionary<string, object> {
{ "assignKey", assign }
},
Comment = "comment",
Credentials = new Credentials {
Role = taskRole
},
EnableNetworkIsolation = false,
Environment = new Dictionary<string, string> {
{ "environmentKey", "environment" }
},
Heartbeat = Duration.Minutes(30),
HeartbeatTimeout = timeout,
Hyperparameters = new Dictionary<string, object> {
{ "hyperparametersKey", hyperparameters }
},
InputDataConfig = new [] { new Channel {
ChannelName = "channelName",
DataSource = new DataSource {
S3DataSource = new S3DataSource {
S3Location = s3Location,
// the properties below are optional
AttributeNames = new [] { "attributeNames" },
S3DataDistributionType = S3DataDistributionType.FULLY_REPLICATED,
S3DataType = S3DataType.MANIFEST_FILE
}
},
// the properties below are optional
CompressionType = CompressionType.NONE,
ContentType = "contentType",
InputMode = InputMode.PIPE,
RecordWrapperType = RecordWrapperType.NONE,
ShuffleConfig = new ShuffleConfig {
Seed = 123
}
} },
IntegrationPattern = IntegrationPattern.REQUEST_RESPONSE,
Outputs = outputs,
QueryLanguage = QueryLanguage.JSON_PATH,
ResourceConfig = new ResourceConfig {
InstanceCount = 123,
InstanceType = instanceType,
VolumeSize = size,
// the properties below are optional
VolumeEncryptionKey = key
},
Role = role,
StateName = "stateName",
StoppingCondition = new StoppingCondition {
MaxRuntime = Duration.Minutes(30)
},
Tags = new Dictionary<string, string> {
{ "tagsKey", "tags" }
},
TaskTimeout = timeout,
Timeout = Duration.Minutes(30),
VpcConfig = new VpcConfig {
Vpc = vpc,
// the properties below are optional
Subnets = new SubnetSelection {
AvailabilityZones = new [] { "availabilityZones" },
OnePerAz = false,
SubnetFilters = new [] { subnetFilter },
SubnetGroupName = "subnetGroupName",
Subnets = new [] { subnet },
SubnetType = SubnetType.PRIVATE_ISOLATED
}
}
};
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
var assign interface{}
var dockerImage DockerImage
var hyperparameters interface{}
var instanceType InstanceType
var key Key
var outputs interface{}
var role Role
var s3Location S3Location
var size Size
var subnet Subnet
var subnetFilter SubnetFilter
var taskRole TaskRole
var timeout Timeout
var vpc Vpc
sageMakerCreateTrainingJobJsonataProps := &SageMakerCreateTrainingJobJsonataProps{
AlgorithmSpecification: &AlgorithmSpecification{
AlgorithmName: jsii.String("algorithmName"),
MetricDefinitions: []MetricDefinition{
&MetricDefinition{
Name: jsii.String("name"),
Regex: jsii.String("regex"),
},
},
TrainingImage: dockerImage,
TrainingInputMode: awscdk.Aws_stepfunctions_tasks.InputMode_PIPE,
},
OutputDataConfig: &OutputDataConfig{
S3OutputLocation: s3Location,
// the properties below are optional
EncryptionKey: key,
},
TrainingJobName: jsii.String("trainingJobName"),
// the properties below are optional
Assign: map[string]interface{}{
"assignKey": assign,
},
Comment: jsii.String("comment"),
Credentials: &Credentials{
Role: taskRole,
},
EnableNetworkIsolation: jsii.Boolean(false),
Environment: map[string]*string{
"environmentKey": jsii.String("environment"),
},
Heartbeat: cdk.Duration_Minutes(jsii.Number(30)),
HeartbeatTimeout: timeout,
Hyperparameters: map[string]interface{}{
"hyperparametersKey": hyperparameters,
},
InputDataConfig: []Channel{
&Channel{
ChannelName: jsii.String("channelName"),
DataSource: &DataSource{
S3DataSource: &S3DataSource{
S3Location: s3Location,
// the properties below are optional
AttributeNames: []*string{
jsii.String("attributeNames"),
},
S3DataDistributionType: awscdk.*Aws_stepfunctions_tasks.S3DataDistributionType_FULLY_REPLICATED,
S3DataType: awscdk.*Aws_stepfunctions_tasks.S3DataType_MANIFEST_FILE,
},
},
// the properties below are optional
CompressionType: awscdk.*Aws_stepfunctions_tasks.CompressionType_NONE,
ContentType: jsii.String("contentType"),
InputMode: awscdk.*Aws_stepfunctions_tasks.InputMode_PIPE,
RecordWrapperType: awscdk.*Aws_stepfunctions_tasks.RecordWrapperType_NONE,
ShuffleConfig: &ShuffleConfig{
Seed: jsii.Number(123),
},
},
},
IntegrationPattern: awscdk.Aws_stepfunctions.IntegrationPattern_REQUEST_RESPONSE,
Outputs: outputs,
QueryLanguage: awscdk.*Aws_stepfunctions.QueryLanguage_JSON_PATH,
ResourceConfig: &ResourceConfig{
InstanceCount: jsii.Number(123),
InstanceType: instanceType,
VolumeSize: size,
// the properties below are optional
VolumeEncryptionKey: key,
},
Role: role,
StateName: jsii.String("stateName"),
StoppingCondition: &StoppingCondition{
MaxRuntime: cdk.Duration_*Minutes(jsii.Number(30)),
},
Tags: map[string]*string{
"tagsKey": jsii.String("tags"),
},
TaskTimeout: timeout,
Timeout: cdk.Duration_*Minutes(jsii.Number(30)),
VpcConfig: &VpcConfig{
Vpc: vpc,
// the properties below are optional
Subnets: &SubnetSelection{
AvailabilityZones: []*string{
jsii.String("availabilityZones"),
},
OnePerAz: jsii.Boolean(false),
SubnetFilters: []SubnetFilter{
subnetFilter,
},
SubnetGroupName: jsii.String("subnetGroupName"),
Subnets: []ISubnet{
subnet,
},
SubnetType: awscdk.Aws_ec2.SubnetType_PRIVATE_ISOLATED,
},
},
}
Properties
algorithmSpecificationAlgorithmSpecificationalgorithm_specificationAlgorithmSpecificationalgorithmSpecificationAlgorithmSpecificationAlgorithmSpecificationAlgorithmSpecificationAlgorithmSpecificationAlgorithmSpecification required #assignoptional{ [key: string]: any }assignoptionaltyping.Mapping[str, Any]assignoptionalMap<String, Object>AssignoptionalIDictionary<string, object>Assignoptional*map[string]interface{} #Default: Not assign variables
Using workflow variables, you can store data in a step and retrieve that data in future steps.
commentoptionalstringcommentoptionalstrcommentoptionalStringCommentoptionalstringCommentoptional*string #Default: No comment
credentialsoptionalCredentialscredentialsoptionalCredentialscredentialsoptionalCredentialsCredentialsoptionalCredentialsCredentialsoptionalCredentials #Default: None (Task is executed using the State Machine's execution role)
This enables cross-account resource invocations.
enableNetworkIsolationoptionalbooleanenable_network_isolationoptionalboolenableNetworkIsolationoptionalBooleanEnableNetworkIsolationoptionalboolEnableNetworkIsolationoptional*bool = false #No inbound or outbound network calls can be made to or from the training container.
environmentoptional{ [key: string]: string }environmentoptionaltyping.Mapping[str, str]environmentoptionalMap<String, String>EnvironmentoptionalIDictionary<string, string>Environmentoptional*map[string]*string #Default: No environment variables
heartbeatoptionalDurationheartbeatoptionalDurationheartbeatoptionalDurationHeartbeatoptionalDurationHeartbeatoptionalDuration = None deprecated #heartbeatTimeoutoptionalTimeoutheartbeat_timeoutoptionalTimeoutheartbeatTimeoutoptionalTimeoutHeartbeatTimeoutoptionalTimeoutHeartbeatTimeoutoptionalTimeout = None #[disable-awslint:duration-prop-type] is needed because all props interface in aws-stepfunctions-tasks extend this interface
hyperparametersoptional{ [key: string]: any }hyperparametersoptionaltyping.Mapping[str, Any]hyperparametersoptionalMap<String, Object>HyperparametersoptionalIDictionary<string, object>Hyperparametersoptional*map[string]interface{} #Default: No hyperparameters
Set hyperparameters before you start the learning process. For a list of hyperparameters provided by Amazon SageMaker
inputDataConfigoptionalChannel[]input_data_configoptionaltyping.List[Channel]inputDataConfigoptionalList<Channel>InputDataConfigoptionalChannel[]InputDataConfigoptional*[]Channel #Default: No inputDataConfig
integrationPatternoptionalIntegrationPatternintegration_patternoptionalIntegrationPatternintegrationPatternoptionalIntegrationPatternIntegrationPatternoptionalIntegrationPatternIntegrationPatternoptionalIntegrationPattern #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.
outputDataConfigOutputDataConfigoutput_data_configOutputDataConfigoutputDataConfigOutputDataConfigOutputDataConfigOutputDataConfigOutputDataConfigOutputDataConfig required #outputsoptionalanyoutputsoptionalAnyoutputsoptionalObjectOutputsoptionalobjectOutputsoptionalinterface{} #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 #If the state does not contain a queryLanguage field, then it will use the query language specified in the top-level queryLanguage field.
resourceConfigoptionalResourceConfigresource_configoptionalResourceConfigresourceConfigoptionalResourceConfigResourceConfigoptionalResourceConfigResourceConfigoptionalResourceConfig #Default: 1 instance of EC2 M4.XLarge with 10GB volume
Default: a role will be created.
The role must be granted all necessary permissions for the SageMaker training job to be able to operate.
stateNameoptionalstringstate_nameoptionalstrstateNameoptionalStringStateNameoptionalstringStateNameoptional*string #Default: The construct ID will be used as state name
stoppingConditionoptionalStoppingConditionstopping_conditionoptionalStoppingConditionstoppingConditionoptionalStoppingConditionStoppingConditionoptionalStoppingConditionStoppingConditionoptionalStoppingCondition #Default: max runtime of 1 hour
tagsoptional{ [key: string]: string }tagsoptionaltyping.Mapping[str, str]tagsoptionalMap<String, String>TagsoptionalIDictionary<string, string>Tagsoptional*map[string]*string #Default: No tags
taskTimeoutoptionalTimeouttask_timeoutoptionalTimeouttaskTimeoutoptionalTimeoutTaskTimeoutoptionalTimeoutTaskTimeoutoptionalTimeout = None #[disable-awslint:duration-prop-type] is needed because all props interface in aws-stepfunctions-tasks extend this interface
timeoutoptionalDurationtimeoutoptionalDurationtimeoutoptionalDurationTimeoutoptionalDurationTimeoutoptionalDuration = None deprecated #trainingJobNamestringtraining_job_namestrtrainingJobNameStringTrainingJobNamestringTrainingJobName*string required #