SageMakerCreateTransformJobProps

class aws_cdk.aws_stepfunctions_tasks.SageMakerCreateTransformJobProps(*, comment=None, credentials=None, heartbeat=None, heartbeat_timeout=None, input_path=None, integration_pattern=None, output_path=None, result_path=None, result_selector=None, state_name=None, task_timeout=None, timeout=None, model_name, transform_input, transform_job_name, transform_output, batch_strategy=None, environment=None, max_concurrent_transforms=None, max_payload=None, model_client_options=None, role=None, tags=None, transform_resources=None)

Bases: TaskStateBaseProps

Properties for creating an Amazon SageMaker transform job task.

Parameters:
  • comment (Optional[str]) – An optional description for this state. Default: - No comment

  • credentials (Union[Credentials, Dict[str, Any], None]) – Credentials for an IAM Role that the State Machine assumes for executing the task. This enables cross-account resource invocations. Default: - None (Task is executed using the State Machine’s execution role)

  • heartbeat (Optional[Duration]) – (deprecated) Timeout for the heartbeat. Default: - None

  • heartbeat_timeout (Optional[Timeout]) – Timeout for the heartbeat. [disable-awslint:duration-prop-type] is needed because all props interface in aws-stepfunctions-tasks extend this interface Default: - None

  • input_path (Optional[str]) – JSONPath expression to select part of the state to be the input to this state. May also be the special value JsonPath.DISCARD, which will cause the effective input to be the empty object {}. Default: - The entire task input (JSON path ‘$’)

  • integration_pattern (Optional[IntegrationPattern]) – AWS Step Functions integrates with services directly in the Amazon States Language. You can control these AWS services using service integration patterns. Depending on the AWS Service, the Service Integration Pattern availability will vary. Default: - IntegrationPattern.REQUEST_RESPONSE for most tasks. IntegrationPattern.RUN_JOB for the following exceptions: BatchSubmitJob, EmrAddStep, EmrCreateCluster, EmrTerminationCluster, and EmrContainersStartJobRun.

  • output_path (Optional[str]) – JSONPath expression to select select a portion of the state output to pass to the next state. May also be the special value JsonPath.DISCARD, which will cause the effective output to be the empty object {}. Default: - The entire JSON node determined by the state input, the task result, and resultPath is passed to the next state (JSON path ‘$’)

  • result_path (Optional[str]) – JSONPath expression to indicate where to inject the state’s output. May also be the special value JsonPath.DISCARD, which will cause the state’s input to become its output. Default: - Replaces the entire input with the result (JSON path ‘$’)

  • result_selector (Optional[Mapping[str, Any]]) – The JSON that will replace the state’s raw result and become the effective result before ResultPath is applied. You can use ResultSelector to create a payload with values that are static or selected from the state’s raw result. Default: - None

  • state_name (Optional[str]) – Optional name for this state. Default: - The construct ID will be used as state name

  • task_timeout (Optional[Timeout]) – Timeout for the task. [disable-awslint:duration-prop-type] is needed because all props interface in aws-stepfunctions-tasks extend this interface Default: - None

  • timeout (Optional[Duration]) – (deprecated) Timeout for the task. Default: - None

  • model_name (str) – Name of the model that you want to use for the transform job.

  • transform_input (Union[TransformInput, Dict[str, Any]]) – Dataset to be transformed and the Amazon S3 location where it is stored.

  • transform_job_name (str) – Transform Job Name.

  • transform_output (Union[TransformOutput, Dict[str, Any]]) – S3 location where you want Amazon SageMaker to save the results from the transform job.

  • batch_strategy (Optional[BatchStrategy]) – Number of records to include in a mini-batch for an HTTP inference request. Default: - No batch strategy

  • environment (Optional[Mapping[str, str]]) – Environment variables to set in the Docker container. Default: - No environment variables

  • max_concurrent_transforms (Union[int, float, None]) – Maximum number of parallel requests that can be sent to each instance in a transform job. Default: - Amazon SageMaker checks the optional execution-parameters to determine the settings for your chosen algorithm. If the execution-parameters endpoint is not enabled, the default value is 1.

  • max_payload (Optional[Size]) – Maximum allowed size of the payload, in MB. Default: 6

  • model_client_options (Union[ModelClientOptions, Dict[str, Any], None]) – Configures the timeout and maximum number of retries for processing a transform job invocation. Default: - 0 retries and 60 seconds of timeout

  • role (Optional[IRole]) – Role for the Transform Job. Default: - A role is created with AmazonSageMakerFullAccess managed policy

  • tags (Optional[Mapping[str, str]]) – Tags to be applied to the train job. Default: - No tags

  • transform_resources (Union[TransformResources, Dict[str, Any], None]) – ML compute instances for the transform job. Default: - 1 instance of type M4.XLarge

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

batch_strategy

Number of records to include in a mini-batch for an HTTP inference request.

Default:
  • No batch strategy

comment

An optional description for this state.

Default:
  • No comment

credentials

Credentials for an IAM Role that the State Machine assumes for executing the task.

This enables cross-account resource invocations.

Default:
  • None (Task is executed using the State Machine’s execution role)

See:

https://docs.aws.amazon.com/step-functions/latest/dg/concepts-access-cross-acct-resources.html

environment

Environment variables to set in the Docker container.

Default:
  • No environment variables

heartbeat

(deprecated) Timeout for the heartbeat.

Default:
  • None

Deprecated:

use heartbeatTimeout

Stability:

deprecated

heartbeat_timeout

Timeout for the heartbeat.

[disable-awslint:duration-prop-type] is needed because all props interface in aws-stepfunctions-tasks extend this interface

Default:
  • None

input_path

JSONPath expression to select part of the state to be the input to this state.

May also be the special value JsonPath.DISCARD, which will cause the effective input to be the empty object {}.

Default:
  • The entire task input (JSON path ‘$’)

integration_pattern

AWS Step Functions integrates with services directly in the Amazon States Language.

You can control these AWS services using service integration patterns.

Depending on the AWS Service, the Service Integration Pattern availability will vary.

Default:

  • IntegrationPattern.REQUEST_RESPONSE for most tasks.

IntegrationPattern.RUN_JOB for the following exceptions: BatchSubmitJob, EmrAddStep, EmrCreateCluster, EmrTerminationCluster, and EmrContainersStartJobRun.

See:

https://docs.aws.amazon.com/step-functions/latest/dg/connect-supported-services.html

max_concurrent_transforms

Maximum number of parallel requests that can be sent to each instance in a transform job.

Default:

  • Amazon SageMaker checks the optional execution-parameters to determine the settings for your chosen algorithm.

If the execution-parameters endpoint is not enabled, the default value is 1.

max_payload

Maximum allowed size of the payload, in MB.

Default:

6

model_client_options

Configures the timeout and maximum number of retries for processing a transform job invocation.

Default:
  • 0 retries and 60 seconds of timeout

model_name

Name of the model that you want to use for the transform job.

output_path

JSONPath expression to select select a portion of the state output to pass to the next state.

May also be the special value JsonPath.DISCARD, which will cause the effective output to be the empty object {}.

Default:

  • The entire JSON node determined by the state input, the task result,

and resultPath is passed to the next state (JSON path ‘$’)

result_path

JSONPath expression to indicate where to inject the state’s output.

May also be the special value JsonPath.DISCARD, which will cause the state’s input to become its output.

Default:
  • Replaces the entire input with the result (JSON path ‘$’)

result_selector

The JSON that will replace the state’s raw result and become the effective result before ResultPath is applied.

You can use ResultSelector to create a payload with values that are static or selected from the state’s raw result.

Default:
  • None

See:

https://docs.aws.amazon.com/step-functions/latest/dg/input-output-inputpath-params.html#input-output-resultselector

role

Role for the Transform Job.

Default:
  • A role is created with AmazonSageMakerFullAccess managed policy

state_name

Optional name for this state.

Default:
  • The construct ID will be used as state name

tags

Tags to be applied to the train job.

Default:
  • No tags

task_timeout

Timeout for the task.

[disable-awslint:duration-prop-type] is needed because all props interface in aws-stepfunctions-tasks extend this interface

Default:
  • None

timeout

(deprecated) Timeout for the task.

Default:
  • None

Deprecated:

use taskTimeout

Stability:

deprecated

transform_input

Dataset to be transformed and the Amazon S3 location where it is stored.

transform_job_name

Transform Job Name.

transform_output

S3 location where you want Amazon SageMaker to save the results from the transform job.

transform_resources

ML compute instances for the transform job.

Default:
  • 1 instance of type M4.XLarge