Class CfnProcessingJob

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
All Implemented Interfaces:
IInspectable, ITaggableV2, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.113.0 (build fc68b25)", date="2025-08-20T12:34:51.275Z") @Stability(Stable) public class CfnProcessingJob extends CfnResource implements IInspectable, ITaggableV2
An Amazon SageMaker processing job that is used to analyze data and evaluate models.

For more information, see Process Data and Evaluate Models .

Also, note the following details specific to processing jobs created using CloudFormation stacks:

  • When you delete a CloudFormation stack with a processing job resource, the processing job is stopped using the StopProcessingJob API but not deleted. Any tags associated with the processing job are deleted using the DeleteTags API.
  • If any part of your CloudFormation stack deployment fails and a rollback initiates, processing jobs with a specified ProcessingJobName value might cause the stack to become stuck in a failed state. This occurs because during a rollback, CloudFormation attempts to recreate the stack resources. Processing job names must be unique, so when CloudFormation attempts to recreate a processing job using the already defined name, this results in an AlreadyExists error. To prevent this, we recommend that you don't specify the optional ProcessingJobName property, thereby allowing SageMaker to auto-generate a unique name for your processing job. This ensures successful stack rollbacks when necessary. If you must use custom job names, you have to manually modify the ProcessingJobName and redeploy the stack to recover from a failed rollback.

Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.services.sagemaker.*;
 CfnProcessingJob cfnProcessingJob = CfnProcessingJob.Builder.create(this, "MyCfnProcessingJob")
         .appSpecification(AppSpecificationProperty.builder()
                 .imageUri("imageUri")
                 // the properties below are optional
                 .containerArguments(List.of("containerArguments"))
                 .containerEntrypoint(List.of("containerEntrypoint"))
                 .build())
         .processingResources(ProcessingResourcesProperty.builder()
                 .clusterConfig(ClusterConfigProperty.builder()
                         .instanceCount(123)
                         .instanceType("instanceType")
                         .volumeSizeInGb(123)
                         // the properties below are optional
                         .volumeKmsKeyId("volumeKmsKeyId")
                         .build())
                 .build())
         .roleArn("roleArn")
         // the properties below are optional
         .environment(Map.of(
                 "environmentKey", "environment"))
         .experimentConfig(ExperimentConfigProperty.builder()
                 .experimentName("experimentName")
                 .runName("runName")
                 .trialComponentDisplayName("trialComponentDisplayName")
                 .trialName("trialName")
                 .build())
         .networkConfig(NetworkConfigProperty.builder()
                 .enableInterContainerTrafficEncryption(false)
                 .enableNetworkIsolation(false)
                 .vpcConfig(VpcConfigProperty.builder()
                         .securityGroupIds(List.of("securityGroupIds"))
                         .subnets(List.of("subnets"))
                         .build())
                 .build())
         .processingInputs(List.of(ProcessingInputsObjectProperty.builder()
                 .inputName("inputName")
                 // the properties below are optional
                 .appManaged(false)
                 .datasetDefinition(DatasetDefinitionProperty.builder()
                         .athenaDatasetDefinition(AthenaDatasetDefinitionProperty.builder()
                                 .catalog("catalog")
                                 .database("database")
                                 .outputFormat("outputFormat")
                                 .outputS3Uri("outputS3Uri")
                                 .queryString("queryString")
                                 // the properties below are optional
                                 .kmsKeyId("kmsKeyId")
                                 .outputCompression("outputCompression")
                                 .workGroup("workGroup")
                                 .build())
                         .dataDistributionType("dataDistributionType")
                         .inputMode("inputMode")
                         .localPath("localPath")
                         .redshiftDatasetDefinition(RedshiftDatasetDefinitionProperty.builder()
                                 .clusterId("clusterId")
                                 .clusterRoleArn("clusterRoleArn")
                                 .database("database")
                                 .dbUser("dbUser")
                                 .outputFormat("outputFormat")
                                 .outputS3Uri("outputS3Uri")
                                 .queryString("queryString")
                                 // the properties below are optional
                                 .kmsKeyId("kmsKeyId")
                                 .outputCompression("outputCompression")
                                 .build())
                         .build())
                 .s3Input(S3InputProperty.builder()
                         .s3DataType("s3DataType")
                         .s3Uri("s3Uri")
                         // the properties below are optional
                         .localPath("localPath")
                         .s3CompressionType("s3CompressionType")
                         .s3DataDistributionType("s3DataDistributionType")
                         .s3InputMode("s3InputMode")
                         .build())
                 .build()))
         .processingJobName("processingJobName")
         .processingOutputConfig(ProcessingOutputConfigProperty.builder()
                 .outputs(List.of(ProcessingOutputsObjectProperty.builder()
                         .outputName("outputName")
                         // the properties below are optional
                         .appManaged(false)
                         .featureStoreOutput(FeatureStoreOutputProperty.builder()
                                 .featureGroupName("featureGroupName")
                                 .build())
                         .s3Output(S3OutputProperty.builder()
                                 .s3UploadMode("s3UploadMode")
                                 .s3Uri("s3Uri")
                                 // the properties below are optional
                                 .localPath("localPath")
                                 .build())
                         .build()))
                 // the properties below are optional
                 .kmsKeyId("kmsKeyId")
                 .build())
         .stoppingCondition(StoppingConditionProperty.builder()
                 .maxRuntimeInSeconds(123)
                 .build())
         .tags(List.of(CfnTag.builder()
                 .key("key")
                 .value("value")
                 .build()))
         .build();
 

See Also:
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String CFN_RESOURCE_TYPE_NAME
      The CloudFormation resource type name for this resource class.
  • Constructor Details

    • CfnProcessingJob

      protected CfnProcessingJob(software.amazon.jsii.JsiiObjectRef objRef)
    • CfnProcessingJob

      protected CfnProcessingJob(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CfnProcessingJob

      @Stability(Stable) public CfnProcessingJob(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnProcessingJobProps props)
      Parameters:
      scope - Scope in which this resource is defined. This parameter is required.
      id - Construct identifier for this resource (unique in its scope). This parameter is required.
      props - Resource properties. This parameter is required.
  • Method Details

    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      Parameters:
      inspector - tree inspector to collect and process attributes. This parameter is required.
    • renderProperties

      @Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
      Overrides:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getAttrAutoMlJobArn

      @Stability(Stable) @NotNull public String getAttrAutoMlJobArn()
      The Amazon Resource Name (ARN) of the AutoML job associated with this processing job.
    • getAttrCreationTime

      @Stability(Stable) @NotNull public String getAttrCreationTime()
      The time the processing job was created.
    • getAttrExitMessage

      @Stability(Stable) @NotNull public String getAttrExitMessage()
      A string, up to one KB in size, that contains metadata from the processing container when the processing job exits.
    • getAttrFailureReason

      @Stability(Stable) @NotNull public String getAttrFailureReason()
      A string, up to one KB in size, that contains the reason a processing job failed, if it failed.
    • getAttrLastModifiedTime

      @Stability(Stable) @NotNull public String getAttrLastModifiedTime()
      The time the processing job was last modified.
    • getAttrMonitoringScheduleArn

      @Stability(Stable) @NotNull public String getAttrMonitoringScheduleArn()
      The ARN of a monitoring schedule for an endpoint associated with this processing job.
    • getAttrProcessingEndTime

      @Stability(Stable) @NotNull public String getAttrProcessingEndTime()
      The time that the processing job ended.
    • getAttrProcessingJobArn

      @Stability(Stable) @NotNull public String getAttrProcessingJobArn()
      The ARN of the processing job.
    • getAttrProcessingJobStatus

      @Stability(Stable) @NotNull public String getAttrProcessingJobStatus()
      The status of the processing job.
    • getAttrProcessingStartTime

      @Stability(Stable) @NotNull public String getAttrProcessingStartTime()
      The time that the processing job started.
    • getAttrTrainingJobArn

      @Stability(Stable) @NotNull public String getAttrTrainingJobArn()
      The ARN of the training job associated with this processing job.
    • getCdkTagManager

      @Stability(Stable) @NotNull public TagManager getCdkTagManager()
      Tag Manager which manages the tags for this resource.
      Specified by:
      getCdkTagManager in interface ITaggableV2
    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getAppSpecification

      @Stability(Stable) @NotNull public Object getAppSpecification()
      Configuration to run a processing job in a specified container image.
    • setAppSpecification

      @Stability(Stable) public void setAppSpecification(@NotNull IResolvable value)
      Configuration to run a processing job in a specified container image.
    • setAppSpecification

      @Stability(Stable) public void setAppSpecification(@NotNull CfnProcessingJob.AppSpecificationProperty value)
      Configuration to run a processing job in a specified container image.
    • getProcessingResources

      @Stability(Stable) @NotNull public Object getProcessingResources()
      Identifies the resources, ML compute instances, and ML storage volumes to deploy for a processing job.
    • setProcessingResources

      @Stability(Stable) public void setProcessingResources(@NotNull IResolvable value)
      Identifies the resources, ML compute instances, and ML storage volumes to deploy for a processing job.
    • setProcessingResources

      @Stability(Stable) public void setProcessingResources(@NotNull CfnProcessingJob.ProcessingResourcesProperty value)
      Identifies the resources, ML compute instances, and ML storage volumes to deploy for a processing job.
    • getRoleArn

      @Stability(Stable) @NotNull public String getRoleArn()
      The ARN of the role used to create the processing job.
    • setRoleArn

      @Stability(Stable) public void setRoleArn(@NotNull String value)
      The ARN of the role used to create the processing job.
    • getEnvironment

      @Stability(Stable) @Nullable public Object getEnvironment()
      Sets the environment variables in the Docker container.
    • setEnvironment

      @Stability(Stable) public void setEnvironment(@Nullable Map<String,String> value)
      Sets the environment variables in the Docker container.
    • setEnvironment

      @Stability(Stable) public void setEnvironment(@Nullable IResolvable value)
      Sets the environment variables in the Docker container.
    • getExperimentConfig

      @Stability(Stable) @Nullable public Object getExperimentConfig()
      Associates a SageMaker job as a trial component with an experiment and trial.
    • setExperimentConfig

      @Stability(Stable) public void setExperimentConfig(@Nullable IResolvable value)
      Associates a SageMaker job as a trial component with an experiment and trial.
    • setExperimentConfig

      @Stability(Stable) public void setExperimentConfig(@Nullable CfnProcessingJob.ExperimentConfigProperty value)
      Associates a SageMaker job as a trial component with an experiment and trial.
    • getNetworkConfig

      @Stability(Stable) @Nullable public Object getNetworkConfig()
      Networking options for a job, such as network traffic encryption between containers, whether to allow inbound and outbound network calls to and from containers, and the VPC subnets and security groups to use for VPC-enabled jobs.
    • setNetworkConfig

      @Stability(Stable) public void setNetworkConfig(@Nullable IResolvable value)
      Networking options for a job, such as network traffic encryption between containers, whether to allow inbound and outbound network calls to and from containers, and the VPC subnets and security groups to use for VPC-enabled jobs.
    • setNetworkConfig

      @Stability(Stable) public void setNetworkConfig(@Nullable CfnProcessingJob.NetworkConfigProperty value)
      Networking options for a job, such as network traffic encryption between containers, whether to allow inbound and outbound network calls to and from containers, and the VPC subnets and security groups to use for VPC-enabled jobs.
    • getProcessingInputs

      @Stability(Stable) @Nullable public Object getProcessingInputs()
      List of input configurations for the processing job.
    • setProcessingInputs

      @Stability(Stable) public void setProcessingInputs(@Nullable IResolvable value)
      List of input configurations for the processing job.
    • setProcessingInputs

      @Stability(Stable) public void setProcessingInputs(@Nullable List<Object> value)
      List of input configurations for the processing job.
    • getProcessingJobName

      @Stability(Stable) @Nullable public String getProcessingJobName()
      The name of the processing job.
    • setProcessingJobName

      @Stability(Stable) public void setProcessingJobName(@Nullable String value)
      The name of the processing job.
    • getProcessingOutputConfig

      @Stability(Stable) @Nullable public Object getProcessingOutputConfig()
      Contains information about the output location for the compiled model and the target device that the model runs on.
    • setProcessingOutputConfig

      @Stability(Stable) public void setProcessingOutputConfig(@Nullable IResolvable value)
      Contains information about the output location for the compiled model and the target device that the model runs on.
    • setProcessingOutputConfig

      @Stability(Stable) public void setProcessingOutputConfig(@Nullable CfnProcessingJob.ProcessingOutputConfigProperty value)
      Contains information about the output location for the compiled model and the target device that the model runs on.
    • getStoppingCondition

      @Stability(Stable) @Nullable public Object getStoppingCondition()
      Configures conditions under which the processing job should be stopped, such as how long the processing job has been running.
    • setStoppingCondition

      @Stability(Stable) public void setStoppingCondition(@Nullable IResolvable value)
      Configures conditions under which the processing job should be stopped, such as how long the processing job has been running.
    • setStoppingCondition

      @Stability(Stable) public void setStoppingCondition(@Nullable CfnProcessingJob.StoppingConditionProperty value)
      Configures conditions under which the processing job should be stopped, such as how long the processing job has been running.
    • getTags

      @Stability(Stable) @Nullable public List<CfnTag> getTags()
      An array of key-value pairs.
    • setTags

      @Stability(Stable) public void setTags(@Nullable List<CfnTag> value)
      An array of key-value pairs.