TransformResources

class aws_cdk.aws_stepfunctions_tasks.TransformResources(*, instance_count, instance_type, volume_encryption_key=None)

Bases: object

ML compute instances for the transform job.

Parameters
  • instance_count (Union[int, float]) – Number of ML compute instances to use in the transform job.

  • instance_type (InstanceType) – ML compute instance type for the transform job.

  • volume_encryption_key (Optional[IKey]) – AWS KMS key that Amazon SageMaker uses to encrypt data on the storage volume attached to the ML compute instance(s). Default: - None

ExampleMetadata

infused

Example:

tasks.SageMakerCreateTransformJob(self, "Batch Inference",
    transform_job_name="MyTransformJob",
    model_name="MyModelName",
    model_client_options=tasks.ModelClientOptions(
        invocations_max_retries=3,  # default is 0
        invocations_timeout=Duration.minutes(5)
    ),
    transform_input=tasks.TransformInput(
        transform_data_source=tasks.TransformDataSource(
            s3_data_source=tasks.TransformS3DataSource(
                s3_uri="s3://inputbucket/train",
                s3_data_type=tasks.S3DataType.S3_PREFIX
            )
        )
    ),
    transform_output=tasks.TransformOutput(
        s3_output_path="s3://outputbucket/TransformJobOutputPath"
    ),
    transform_resources=tasks.TransformResources(
        instance_count=1,
        instance_type=ec2.InstanceType.of(ec2.InstanceClass.M4, ec2.InstanceSize.XLARGE)
    )
)

Attributes

instance_count

Number of ML compute instances to use in the transform job.

Return type

Union[int, float]

instance_type

ML compute instance type for the transform job.

Return type

InstanceType

volume_encryption_key

AWS KMS key that Amazon SageMaker uses to encrypt data on the storage volume attached to the ML compute instance(s).

Default
  • None

Return type

Optional[IKey]