Class CfnMaintenanceWindowTask.Builder

java.lang.Object
software.amazon.awscdk.services.ssm.CfnMaintenanceWindowTask.Builder
All Implemented Interfaces:
software.amazon.jsii.Builder<CfnMaintenanceWindowTask>
Enclosing class:
CfnMaintenanceWindowTask

@Stability(Stable) public static final class CfnMaintenanceWindowTask.Builder extends Object implements software.amazon.jsii.Builder<CfnMaintenanceWindowTask>
A fluent builder for CfnMaintenanceWindowTask.
  • Method Details

    • create

      @Stability(Stable) public static CfnMaintenanceWindowTask.Builder create(Construct scope, String id)
      Parameters:
      scope -
      • scope in which this resource is defined.
      This parameter is required.
      id -
      • scoped id of the resource.
      This parameter is required.
      Returns:
      a new instance of CfnMaintenanceWindowTask.Builder.
    • priority

      @Stability(Stable) public CfnMaintenanceWindowTask.Builder priority(Number priority)
      The priority of the task in the maintenance window.

      The lower the number, the higher the priority. Tasks that have the same priority are scheduled in parallel.

      Parameters:
      priority - The priority of the task in the maintenance window. This parameter is required.
      Returns:
      this
    • taskArn

      @Stability(Stable) public CfnMaintenanceWindowTask.Builder taskArn(String taskArn)
      The resource that the task uses during execution.

      For RUN_COMMAND and AUTOMATION task types, TaskArn is the SSM document name or Amazon Resource Name (ARN).

      For LAMBDA tasks, TaskArn is the function name or ARN.

      For STEP_FUNCTIONS tasks, TaskArn is the state machine ARN.

      Parameters:
      taskArn - The resource that the task uses during execution. This parameter is required.
      Returns:
      this
    • taskType

      @Stability(Stable) public CfnMaintenanceWindowTask.Builder taskType(String taskType)
      The type of task.

      Valid values: RUN_COMMAND , AUTOMATION , LAMBDA , STEP_FUNCTIONS .

      Parameters:
      taskType - The type of task. This parameter is required.
      Returns:
      this
    • windowId

      @Stability(Stable) public CfnMaintenanceWindowTask.Builder windowId(String windowId)
      The ID of the maintenance window where the task is registered.

      Parameters:
      windowId - The ID of the maintenance window where the task is registered. This parameter is required.
      Returns:
      this
    • cutoffBehavior

      @Stability(Stable) public CfnMaintenanceWindowTask.Builder cutoffBehavior(String cutoffBehavior)
      The specification for whether tasks should continue to run after the cutoff time specified in the maintenance windows is reached.

      Parameters:
      cutoffBehavior - The specification for whether tasks should continue to run after the cutoff time specified in the maintenance windows is reached. This parameter is required.
      Returns:
      this
    • description

      @Stability(Stable) public CfnMaintenanceWindowTask.Builder description(String description)
      A description of the task.

      Parameters:
      description - A description of the task. This parameter is required.
      Returns:
      this
    • loggingInfo

      @Stability(Stable) public CfnMaintenanceWindowTask.Builder loggingInfo(IResolvable loggingInfo)
      Information about an Amazon S3 bucket to write Run Command task-level logs to.

      LoggingInfo has been deprecated. To specify an Amazon S3 bucket to contain logs for Run Command tasks, instead use the OutputS3BucketName and OutputS3KeyPrefix options in the TaskInvocationParameters structure. For information about how Systems Manager handles these options for the supported maintenance window task types, see AWS ::SSM::MaintenanceWindowTask MaintenanceWindowRunCommandParameters .

      Parameters:
      loggingInfo - Information about an Amazon S3 bucket to write Run Command task-level logs to. This parameter is required.
      Returns:
      this
    • loggingInfo

      @Stability(Stable) public CfnMaintenanceWindowTask.Builder loggingInfo(CfnMaintenanceWindowTask.LoggingInfoProperty loggingInfo)
      Information about an Amazon S3 bucket to write Run Command task-level logs to.

      LoggingInfo has been deprecated. To specify an Amazon S3 bucket to contain logs for Run Command tasks, instead use the OutputS3BucketName and OutputS3KeyPrefix options in the TaskInvocationParameters structure. For information about how Systems Manager handles these options for the supported maintenance window task types, see AWS ::SSM::MaintenanceWindowTask MaintenanceWindowRunCommandParameters .

      Parameters:
      loggingInfo - Information about an Amazon S3 bucket to write Run Command task-level logs to. This parameter is required.
      Returns:
      this
    • maxConcurrency

      @Stability(Stable) public CfnMaintenanceWindowTask.Builder maxConcurrency(String maxConcurrency)
      The maximum number of targets this task can be run for, in parallel.

      Although this element is listed as "Required: No", a value can be omitted only when you are registering or updating a targetless task You must provide a value in all other cases.

      For maintenance window tasks without a target specified, you can't supply a value for this option. Instead, the system inserts a placeholder value of 1 . This value doesn't affect the running of your task.

      Parameters:
      maxConcurrency - The maximum number of targets this task can be run for, in parallel. This parameter is required.
      Returns:
      this
    • maxErrors

      @Stability(Stable) public CfnMaintenanceWindowTask.Builder maxErrors(String maxErrors)
      The maximum number of errors allowed before this task stops being scheduled.

      Although this element is listed as "Required: No", a value can be omitted only when you are registering or updating a targetless task You must provide a value in all other cases.

      For maintenance window tasks without a target specified, you can't supply a value for this option. Instead, the system inserts a placeholder value of 1 . This value doesn't affect the running of your task.

      Parameters:
      maxErrors - The maximum number of errors allowed before this task stops being scheduled. This parameter is required.
      Returns:
      this
    • name

      @Stability(Stable) public CfnMaintenanceWindowTask.Builder name(String name)
      The task name.

      Parameters:
      name - The task name. This parameter is required.
      Returns:
      this
    • serviceRoleArn

      @Stability(Stable) public CfnMaintenanceWindowTask.Builder serviceRoleArn(String serviceRoleArn)
      The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) service role to use to publish Amazon Simple Notification Service (Amazon SNS) notifications for maintenance window Run Command tasks.

      Parameters:
      serviceRoleArn - The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) service role to use to publish Amazon Simple Notification Service (Amazon SNS) notifications for maintenance window Run Command tasks. This parameter is required.
      Returns:
      this
    • targets

      @Stability(Stable) public CfnMaintenanceWindowTask.Builder targets(IResolvable targets)
      The targets, either instances or window target IDs.

      • Specify instances using Key=InstanceIds,Values= *instanceid1* , *instanceid2* .
      • Specify window target IDs using Key=WindowTargetIds,Values= *window-target-id-1* , *window-target-id-2* .

      Parameters:
      targets - The targets, either instances or window target IDs. This parameter is required.
      Returns:
      this
    • targets

      @Stability(Stable) public CfnMaintenanceWindowTask.Builder targets(List<? extends Object> targets)
      The targets, either instances or window target IDs.

      • Specify instances using Key=InstanceIds,Values= *instanceid1* , *instanceid2* .
      • Specify window target IDs using Key=WindowTargetIds,Values= *window-target-id-1* , *window-target-id-2* .

      Parameters:
      targets - The targets, either instances or window target IDs. This parameter is required.
      Returns:
      this
    • taskInvocationParameters

      @Stability(Stable) public CfnMaintenanceWindowTask.Builder taskInvocationParameters(IResolvable taskInvocationParameters)
      The parameters to pass to the task when it runs.

      Populate only the fields that match the task type. All other fields should be empty.

      When you update a maintenance window task that has options specified in TaskInvocationParameters , you must provide again all the TaskInvocationParameters values that you want to retain. The values you do not specify again are removed. For example, suppose that when you registered a Run Command task, you specified TaskInvocationParameters values for Comment , NotificationConfig , and OutputS3BucketName . If you update the maintenance window task and specify only a different OutputS3BucketName value, the values for Comment and NotificationConfig are removed.

      Parameters:
      taskInvocationParameters - The parameters to pass to the task when it runs. This parameter is required.
      Returns:
      this
    • taskInvocationParameters

      @Stability(Stable) public CfnMaintenanceWindowTask.Builder taskInvocationParameters(CfnMaintenanceWindowTask.TaskInvocationParametersProperty taskInvocationParameters)
      The parameters to pass to the task when it runs.

      Populate only the fields that match the task type. All other fields should be empty.

      When you update a maintenance window task that has options specified in TaskInvocationParameters , you must provide again all the TaskInvocationParameters values that you want to retain. The values you do not specify again are removed. For example, suppose that when you registered a Run Command task, you specified TaskInvocationParameters values for Comment , NotificationConfig , and OutputS3BucketName . If you update the maintenance window task and specify only a different OutputS3BucketName value, the values for Comment and NotificationConfig are removed.

      Parameters:
      taskInvocationParameters - The parameters to pass to the task when it runs. This parameter is required.
      Returns:
      this
    • taskParameters

      @Stability(Stable) public CfnMaintenanceWindowTask.Builder taskParameters(Object taskParameters)
      The parameters to pass to the task when it runs.

      TaskParameters has been deprecated. To specify parameters to pass to a task when it runs, instead use the Parameters option in the TaskInvocationParameters structure. For information about how Systems Manager handles these options for the supported maintenance window task types, see MaintenanceWindowTaskInvocationParameters .

      Parameters:
      taskParameters - The parameters to pass to the task when it runs. This parameter is required.
      Returns:
      this
    • build

      @Stability(Stable) public CfnMaintenanceWindowTask build()
      Specified by:
      build in interface software.amazon.jsii.Builder<CfnMaintenanceWindowTask>
      Returns:
      a newly built instance of CfnMaintenanceWindowTask.