OutputDataConfig

class aws_cdk.aws_stepfunctions_tasks.OutputDataConfig(*, s3_output_location, encryption_key=None)

Bases: object

Configures the S3 bucket where SageMaker will save the result of model training.

Parameters
  • s3_output_location (S3Location) – Identifies the S3 path where you want Amazon SageMaker to store the model artifacts.

  • encryption_key (Optional[IKey]) – Optional KMS encryption key that Amazon SageMaker uses to encrypt the model artifacts at rest using Amazon S3 server-side encryption. Default: - Amazon SageMaker uses the default KMS key for Amazon S3 for your role’s account

ExampleMetadata

infused

Example:

tasks.SageMakerCreateTrainingJob(self, "TrainSagemaker",
    training_job_name=sfn.JsonPath.string_at("$.JobName"),
    algorithm_specification=tasks.AlgorithmSpecification(
        algorithm_name="BlazingText",
        training_input_mode=tasks.InputMode.FILE
    ),
    input_data_config=[tasks.Channel(
        channel_name="train",
        data_source=tasks.DataSource(
            s3_data_source=tasks.S3DataSource(
                s3_data_type=tasks.S3DataType.S3_PREFIX,
                s3_location=tasks.S3Location.from_json_expression("$.S3Bucket")
            )
        )
    )],
    output_data_config=tasks.OutputDataConfig(
        s3_output_location=tasks.S3Location.from_bucket(s3.Bucket.from_bucket_name(self, "Bucket", "mybucket"), "myoutputpath")
    ),
    resource_config=tasks.ResourceConfig(
        instance_count=1,
        instance_type=ec2.InstanceType(sfn.JsonPath.string_at("$.InstanceType")),
        volume_size=Size.gibibytes(50)
    ),  # optional: default is 1 instance of EC2 `M4.XLarge` with `10GB` volume
    stopping_condition=tasks.StoppingCondition(
        max_runtime=Duration.hours(2)
    )
)

Attributes

encryption_key

Optional KMS encryption key that Amazon SageMaker uses to encrypt the model artifacts at rest using Amazon S3 server-side encryption.

Default
  • Amazon SageMaker uses the default KMS key for Amazon S3 for your role’s account

Return type

Optional[IKey]

s3_output_location

Identifies the S3 path where you want Amazon SageMaker to store the model artifacts.

Return type

S3Location