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

@Generated(value="jsii-pacmak/1.139.0 (build 26a6b54)", date="2026-09-10T17:51:47.410Z") @Stability(Stable) public class CfnTask extends CfnResource implements IInspectable, ITaskRef, ITaggableV2
Resource schema for AWS::IoTSiteWise::Task.

A task defines a reusable containerized compute workload that can be referenced by one or more pipeline compute nodes.

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.iotsitewise.*;
 CfnTask cfnTask = CfnTask.Builder.create(this, "MyCfnTask")
         .taskConfiguration(TaskConfigurationProperty.builder()
                 .containerTaskConfiguration(ContainerTaskConfigurationProperty.builder()
                         .ecrUri("ecrUri")
                         .processingType("processingType")
                         .processingUnit("processingUnit")
                         .taskExecutionRole("taskExecutionRole")
                         // the properties below are optional
                         .command(List.of("command"))
                         .environmentVariables(Map.of(
                                 "environmentVariablesKey", "environmentVariables"))
                         .timeoutSeconds(123)
                         .build())
                 .build())
         .taskName("taskName")
         .workspaceName("workspaceName")
         // the properties below are optional
         .description("description")
         .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

    • CfnTask

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

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

      @Stability(Stable) public CfnTask(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnTaskProps props)
      Create a new AWS::IoTSiteWise::Task.

      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

    • arnForTask

      @Stability(Stable) @NotNull public static String arnForTask(@NotNull ITaskRef resource)
      Parameters:
      resource - This parameter is required.
    • isCfnTask

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

      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.
    • getAttrStatus

      @Stability(Stable) @NotNull public String getAttrStatus()
      The current lifecycle status of the task.
    • getAttrTaskArn

      @Stability(Stable) @NotNull public String getAttrTaskArn()
      The ARN of the task.
    • 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
    • getTaskRef

      @Stability(Stable) @NotNull public TaskReference getTaskRef()
      A reference to a Task resource.
      Specified by:
      getTaskRef in interface ITaskRef
    • getTaskConfiguration

      @Stability(Stable) @NotNull public Object getTaskConfiguration()
      The task execution configuration.

      Returns union: either IResolvable or CfnTask.TaskConfigurationProperty

    • setTaskConfiguration

      @Stability(Stable) public void setTaskConfiguration(@NotNull IResolvable value)
      The task execution configuration.
    • setTaskConfiguration

      @Stability(Stable) public void setTaskConfiguration(@NotNull CfnTask.TaskConfigurationProperty value)
      The task execution configuration.
    • getTaskName

      @Stability(Stable) @NotNull public String getTaskName()
      The name of the task.
    • setTaskName

      @Stability(Stable) public void setTaskName(@NotNull String value)
      The name of the task.
    • getWorkspaceName

      @Stability(Stable) @NotNull public String getWorkspaceName()
      The name of the workspace.
    • setWorkspaceName

      @Stability(Stable) public void setWorkspaceName(@NotNull String value)
      The name of the workspace.
    • getDescription

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

      @Stability(Stable) public void setDescription(@Nullable String value)
      A description of the task.
    • getTags

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

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