Class CfnMaintenanceWindowTaskProps.Builder

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

@Stability(Stable) public static final class CfnMaintenanceWindowTaskProps.Builder extends Object implements software.amazon.jsii.Builder<CfnMaintenanceWindowTaskProps>
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • priority

      @Stability(Stable) public CfnMaintenanceWindowTaskProps.Builder priority(Number priority)
      Parameters:
      priority - The priority of the task in the maintenance window. This parameter is required. The lower the number, the higher the priority. Tasks that have the same priority are scheduled in parallel.
      Returns:
      this
    • taskArn

      @Stability(Stable) public CfnMaintenanceWindowTaskProps.Builder taskArn(String taskArn)
      Parameters:
      taskArn - The resource that the task uses during execution. This parameter is required. 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.

      Returns:
      this
    • taskType

      @Stability(Stable) public CfnMaintenanceWindowTaskProps.Builder taskType(String taskType)
      Parameters:
      taskType - The type of task. This parameter is required. Valid values: RUN_COMMAND , AUTOMATION , LAMBDA , STEP_FUNCTIONS .
      Returns:
      this
    • windowId

      @Stability(Stable) public CfnMaintenanceWindowTaskProps.Builder windowId(String windowId)
      Parameters:
      windowId - The ID of the maintenance window where the task is registered. This parameter is required.
      Returns:
      this
    • cutoffBehavior

      @Stability(Stable) public CfnMaintenanceWindowTaskProps.Builder cutoffBehavior(String cutoffBehavior)
      Parameters:
      cutoffBehavior - The specification for whether tasks should continue to run after the cutoff time specified in the maintenance windows is reached.
      Returns:
      this
    • description

      @Stability(Stable) public CfnMaintenanceWindowTaskProps.Builder description(String description)
      Parameters:
      description - A description of the task.
      Returns:
      this
    • loggingInfo

      @Stability(Stable) public CfnMaintenanceWindowTaskProps.Builder loggingInfo(IResolvable loggingInfo)
      Parameters:
      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 .

      Returns:
      this
    • loggingInfo

      @Stability(Stable) public CfnMaintenanceWindowTaskProps.Builder loggingInfo(CfnMaintenanceWindowTask.LoggingInfoProperty loggingInfo)
      Parameters:
      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 .

      Returns:
      this
    • maxConcurrency

      @Stability(Stable) public CfnMaintenanceWindowTaskProps.Builder maxConcurrency(String maxConcurrency)
      Parameters:
      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.

      Returns:
      this
    • maxErrors

      @Stability(Stable) public CfnMaintenanceWindowTaskProps.Builder maxErrors(String maxErrors)
      Parameters:
      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.

      Returns:
      this
    • name

      @Stability(Stable) public CfnMaintenanceWindowTaskProps.Builder name(String name)
      Parameters:
      name - The task name.
      Returns:
      this
    • serviceRoleArn

      @Stability(Stable) public CfnMaintenanceWindowTaskProps.Builder serviceRoleArn(String serviceRoleArn)
      Parameters:
      serviceRoleArn - The Amazon Resource Name (ARN) of the IAM service role for AWS Systems Manager to assume when running a maintenance window task. If you do not specify a service role ARN, Systems Manager uses a service-linked role in your account. If no appropriate service-linked role for Systems Manager exists in your account, it is created when you run RegisterTaskWithMaintenanceWindow .

      However, for an improved security posture, we strongly recommend creating a custom policy and custom service role for running your maintenance window tasks. The policy can be crafted to provide only the permissions needed for your particular maintenance window tasks. For more information, see Setting up Maintenance Windows in the in the AWS Systems Manager User Guide .

      Returns:
      this
    • targets

      @Stability(Stable) public CfnMaintenanceWindowTaskProps.Builder targets(IResolvable targets)
      Parameters:
      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* .
      Returns:
      this
    • targets

      @Stability(Stable) public CfnMaintenanceWindowTaskProps.Builder targets(List<? extends Object> targets)
      Parameters:
      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* .
      Returns:
      this
    • taskInvocationParameters

      @Stability(Stable) public CfnMaintenanceWindowTaskProps.Builder taskInvocationParameters(IResolvable taskInvocationParameters)
      Parameters:
      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.

      Returns:
      this
    • taskInvocationParameters

      @Stability(Stable) public CfnMaintenanceWindowTaskProps.Builder taskInvocationParameters(CfnMaintenanceWindowTask.TaskInvocationParametersProperty taskInvocationParameters)
      Parameters:
      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.

      Returns:
      this
    • taskParameters

      @Stability(Stable) public CfnMaintenanceWindowTaskProps.Builder taskParameters(Object taskParameters)
      Parameters:
      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 .

      Returns:
      this
    • build

      @Stability(Stable) public CfnMaintenanceWindowTaskProps build()
      Builds the configured instance.
      Specified by:
      build in interface software.amazon.jsii.Builder<CfnMaintenanceWindowTaskProps>
      Returns:
      a new instance of CfnMaintenanceWindowTaskProps
      Throws:
      NullPointerException - if any required attribute was not provided