Skip to content
v2.278.0

Channel Struct ​

Describes the training, validation or test dataset and the Amazon S3 location where it is stored.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_stepfunctions_tasks as stepfunctions_tasks } from 'aws-cdk-lib';

declare const s3Location: stepfunctions_tasks.S3Location;
const channel: stepfunctions_tasks.Channel = {
  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,
  },
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_stepfunctions_tasks as stepfunctions_tasks

# s3_location: stepfunctions_tasks.S3Location

channel = 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
    )
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.stepfunctions.tasks.*;

S3Location s3Location;

Channel channel = 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();
csharp
// 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.AWS.StepFunctions.Tasks;

S3Location s3Location;

var channel = 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
    }
};
go
// 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"

var s3Location S3Location

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),
	},
}

Properties ​

channelNamestringchannel_namestrchannelNameStringChannelNamestringChannelName*string required #
Name of the channel.
compressionTypeoptionalCompressionTypecompression_typeoptionalCompressionTypecompressionTypeoptionalCompressionTypeCompressionTypeoptionalCompressionTypeCompressionTypeoptionalCompressionType = None #
Compression type if training data is compressed.
contentTypeoptionalstringcontent_typeoptionalstrcontentTypeoptionalStringContentTypeoptionalstringContentTypeoptional*string = None #
The MIME type of the data.
dataSourceDataSourcedata_sourceDataSourcedataSourceDataSourceDataSourceDataSourceDataSourceDataSource required #
Location of the channel data.
inputModeoptionalInputModeinput_modeoptionalInputModeinputModeoptionalInputModeInputModeoptionalInputModeInputModeoptionalInputMode = None #
Input mode to use for the data channel in a training job.
recordWrapperTypeoptionalRecordWrapperTyperecord_wrapper_typeoptionalRecordWrapperTyperecordWrapperTypeoptionalRecordWrapperTypeRecordWrapperTypeoptionalRecordWrapperTypeRecordWrapperTypeoptionalRecordWrapperType = None #
Specify RecordIO as the value when input data is in raw format but the training algorithm requires the RecordIO format.

In this case, Amazon SageMaker wraps each individual S3 object in a RecordIO record. If the input data is already in RecordIO format, you don't need to set this attribute.

shuffleConfigoptionalShuffleConfigshuffle_configoptionalShuffleConfigshuffleConfigoptionalShuffleConfigShuffleConfigoptionalShuffleConfigShuffleConfigoptionalShuffleConfig = None #
Shuffle config option for input data in a channel.