Class CfnJob

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

@Generated(value="jsii-pacmak/1.139.0 (build 26a6b54)", date="2026-09-02T11:03:11.765Z") @Stability(Stable) public class CfnJob extends CfnResource implements IInspectable, IJobRef, ITaggableV2
Use the AWS::IoT::Job resource to declare an AWS IoT job.

A job can be used to define a set of remote operations that are sent to and run on one or more devices (things or thing groups) connected to AWS IoT.

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.iot.*;
 CfnJob cfnJob = CfnJob.Builder.create(this, "MyCfnJob")
         .jobId("jobId")
         .targets(List.of("targets"))
         // the properties below are optional
         .abortConfig(AbortConfigProperty.builder()
                 .criteriaList(List.of(AbortCriteriaProperty.builder()
                         .action("action")
                         .failureType("failureType")
                         .minNumberOfExecutedThings(123)
                         .thresholdPercentage(123)
                         .build()))
                 .build())
         .description("description")
         .destinationPackageVersions(List.of("destinationPackageVersions"))
         .document("document")
         .documentParameters(Map.of(
                 "documentParametersKey", "documentParameters"))
         .documentSource("documentSource")
         .jobExecutionsRetryConfig(JobExecutionsRetryConfigProperty.builder()
                 .criteriaList(List.of(RetryCriteriaProperty.builder()
                         .failureType("failureType")
                         .numberOfRetries(123)
                         .build()))
                 .build())
         .jobExecutionsRolloutConfig(JobExecutionsRolloutConfigProperty.builder()
                 .exponentialRate(ExponentialRolloutRateProperty.builder()
                         .baseRatePerMinute(123)
                         .incrementFactor(123)
                         .rateIncreaseCriteria(RateIncreaseCriteriaProperty.builder()
                                 .numberOfNotifiedThings(123)
                                 .numberOfSucceededThings(123)
                                 .build())
                         .build())
                 .maximumPerMinute(123)
                 .build())
         .jobTemplateArn("jobTemplateArn")
         .presignedUrlConfig(PresignedUrlConfigProperty.builder()
                 .expiresInSec(123)
                 .roleArn("roleArn")
                 .build())
         .schedulingConfig(SchedulingConfigProperty.builder()
                 .endBehavior("endBehavior")
                 .endTime("endTime")
                 .maintenanceWindows(List.of(MaintenanceWindowProperty.builder()
                         .durationInMinutes(123)
                         .startTime("startTime")
                         .build()))
                 .startTime("startTime")
                 .build())
         .tags(List.of(CfnTag.builder()
                 .key("key")
                 .value("value")
                 .build()))
         .targetSelection("targetSelection")
         .timeoutConfig(TimeoutConfigProperty.builder()
                 .inProgressTimeoutInMinutes(123)
                 .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

    • CfnJob

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

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

      @Stability(Stable) public CfnJob(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnJobProps props)
      Create a new AWS::IoT::Job.

      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

    • arnForJob

      @Stability(Stable) @NotNull public static String arnForJob(@NotNull IJobRef resource)
      Parameters:
      resource - This parameter is required.
    • isCfnJob

      @Stability(Stable) @NotNull public static Boolean isCfnJob(@NotNull Object x)
      Checks whether the given object is a CfnJob.

      Parameters:
      x - This parameter is required.
    • 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.
    • getAttrArn

      @Stability(Stable) @NotNull public String getAttrArn()
      The Amazon Resource Name (ARN) of the job.
    • getAttrCreatedAt

      @Stability(Stable) @NotNull public String getAttrCreatedAt()
      The time when the job was created, in ISO 8601 date-time format.
    • 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
    • getCfnPropertyNames

      @Stability(Stable) @NotNull protected Map<String,String> getCfnPropertyNames()
      Overrides:
      getCfnPropertyNames in class CfnResource
    • getJobRef

      @Stability(Stable) @NotNull public JobReference getJobRef()
      A reference to a Job resource.
      Specified by:
      getJobRef in interface IJobRef
    • getJobId

      @Stability(Stable) @NotNull public String getJobId()
      A job identifier which must be unique for your AWS account.
    • setJobId

      @Stability(Stable) public void setJobId(@NotNull String value)
      A job identifier which must be unique for your AWS account.
    • getTargets

      @Stability(Stable) @NotNull public List<String> getTargets()
      A list of things and thing groups to which the job should be sent.
    • setTargets

      @Stability(Stable) public void setTargets(@NotNull List<String> value)
      A list of things and thing groups to which the job should be sent.
    • getAbortConfig

      @Stability(Stable) @Nullable public Object getAbortConfig()
      The criteria that determine when and how a job abort takes place.

      Returns union: either IResolvable or CfnJob.AbortConfigProperty

    • setAbortConfig

      @Stability(Stable) public void setAbortConfig(@Nullable IResolvable value)
      The criteria that determine when and how a job abort takes place.
    • setAbortConfig

      @Stability(Stable) public void setAbortConfig(@Nullable CfnJob.AbortConfigProperty value)
      The criteria that determine when and how a job abort takes place.
    • getDescription

      @Stability(Stable) @Nullable public String getDescription()
      A short text description of the job.
    • setDescription

      @Stability(Stable) public void setDescription(@Nullable String value)
      A short text description of the job.
    • getDestinationPackageVersions

      @Stability(Stable) @Nullable public List<String> getDestinationPackageVersions()
      The package version Amazon Resource Names (ARNs) that are installed on the device when the job successfully completes.
    • setDestinationPackageVersions

      @Stability(Stable) public void setDestinationPackageVersions(@Nullable List<String> value)
      The package version Amazon Resource Names (ARNs) that are installed on the device when the job successfully completes.
    • getDocument

      @Stability(Stable) @Nullable public String getDocument()
      The job document.
    • setDocument

      @Stability(Stable) public void setDocument(@Nullable String value)
      The job document.
    • getDocumentParameters

      @Stability(Stable) @Nullable public Object getDocumentParameters()
      Parameters of an Amazon Web Services managed template that you can specify to create the job document.

      Returns union: either IResolvable or Mapinvalid input: '<'String, String>

    • setDocumentParameters

      @Stability(Stable) public void setDocumentParameters(@Nullable IResolvable value)
      Parameters of an Amazon Web Services managed template that you can specify to create the job document.
    • setDocumentParameters

      @Stability(Stable) public void setDocumentParameters(@Nullable Map<String,String> value)
      Parameters of an Amazon Web Services managed template that you can specify to create the job document.
    • getDocumentSource

      @Stability(Stable) @Nullable public String getDocumentSource()
      An S3 link, or S3 object URL, to the job document.
    • setDocumentSource

      @Stability(Stable) public void setDocumentSource(@Nullable String value)
      An S3 link, or S3 object URL, to the job document.
    • getJobExecutionsRetryConfig

      @Stability(Stable) @Nullable public Object getJobExecutionsRetryConfig()
      The configuration that determines how many retries are allowed for each failure type for a job.

      Returns union: either IResolvable or CfnJob.JobExecutionsRetryConfigProperty

    • setJobExecutionsRetryConfig

      @Stability(Stable) public void setJobExecutionsRetryConfig(@Nullable IResolvable value)
      The configuration that determines how many retries are allowed for each failure type for a job.
    • setJobExecutionsRetryConfig

      @Stability(Stable) public void setJobExecutionsRetryConfig(@Nullable CfnJob.JobExecutionsRetryConfigProperty value)
      The configuration that determines how many retries are allowed for each failure type for a job.
    • getJobExecutionsRolloutConfig

      @Stability(Stable) @Nullable public Object getJobExecutionsRolloutConfig()
      Allows you to create a staged rollout of a job.

      Returns union: either IResolvable or CfnJob.JobExecutionsRolloutConfigProperty

    • setJobExecutionsRolloutConfig

      @Stability(Stable) public void setJobExecutionsRolloutConfig(@Nullable IResolvable value)
      Allows you to create a staged rollout of a job.
    • setJobExecutionsRolloutConfig

      @Stability(Stable) public void setJobExecutionsRolloutConfig(@Nullable CfnJob.JobExecutionsRolloutConfigProperty value)
      Allows you to create a staged rollout of a job.
    • getJobTemplateArn

      @Stability(Stable) @Nullable public String getJobTemplateArn()
      The ARN of the job template used to create the job.
    • setJobTemplateArn

      @Stability(Stable) public void setJobTemplateArn(@Nullable String value)
      The ARN of the job template used to create the job.
    • getPresignedUrlConfig

      @Stability(Stable) @Nullable public Object getPresignedUrlConfig()
      Configuration for pre-signed S3 URLs.

      Returns union: either IResolvable or CfnJob.PresignedUrlConfigProperty

    • setPresignedUrlConfig

      @Stability(Stable) public void setPresignedUrlConfig(@Nullable IResolvable value)
      Configuration for pre-signed S3 URLs.
    • setPresignedUrlConfig

      @Stability(Stable) public void setPresignedUrlConfig(@Nullable CfnJob.PresignedUrlConfigProperty value)
      Configuration for pre-signed S3 URLs.
    • getSchedulingConfig

      @Stability(Stable) @Nullable public Object getSchedulingConfig()
      Specifies the date and time that a job will begin the rollout of the job document to all devices in the target group.

      Returns union: either IResolvable or CfnJob.SchedulingConfigProperty

    • setSchedulingConfig

      @Stability(Stable) public void setSchedulingConfig(@Nullable IResolvable value)
      Specifies the date and time that a job will begin the rollout of the job document to all devices in the target group.
    • setSchedulingConfig

      @Stability(Stable) public void setSchedulingConfig(@Nullable CfnJob.SchedulingConfigProperty value)
      Specifies the date and time that a job will begin the rollout of the job document to all devices in the target group.
    • getTags

      @Stability(Stable) @Nullable public List<CfnTag> getTags()
      Metadata which can be used to manage the job.
    • setTags

      @Stability(Stable) public void setTags(@Nullable List<CfnTag> value)
      Metadata which can be used to manage the job.
    • getTargetSelection

      @Stability(Stable) @Nullable public String getTargetSelection()
      Specifies whether the job will continue to run (CONTINUOUS), or will be complete after all those things specified as targets have completed the job (SNAPSHOT).
    • setTargetSelection

      @Stability(Stable) public void setTargetSelection(@Nullable String value)
      Specifies whether the job will continue to run (CONTINUOUS), or will be complete after all those things specified as targets have completed the job (SNAPSHOT).
    • getTimeoutConfig

      @Stability(Stable) @Nullable public Object getTimeoutConfig()
      Specifies the amount of time each device has to finish its execution of the job.

      Returns union: either IResolvable or CfnJob.TimeoutConfigProperty

    • setTimeoutConfig

      @Stability(Stable) public void setTimeoutConfig(@Nullable IResolvable value)
      Specifies the amount of time each device has to finish its execution of the job.
    • setTimeoutConfig

      @Stability(Stable) public void setTimeoutConfig(@Nullable CfnJob.TimeoutConfigProperty value)
      Specifies the amount of time each device has to finish its execution of the job.