CfnMaintenanceWindowTaskProps

class aws_cdk.aws_ssm.CfnMaintenanceWindowTaskProps(*, priority, task_arn, task_type, window_id, cutoff_behavior=None, description=None, logging_info=None, max_concurrency=None, max_errors=None, name=None, service_role_arn=None, targets=None, task_invocation_parameters=None, task_parameters=None)

Bases: object

Properties for defining a CfnMaintenanceWindowTask.

Parameters:
  • priority (Union[int, float]) – 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.

  • task_arn (str) – 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.

  • task_type (str) – The type of task. Valid values: RUN_COMMAND , AUTOMATION , LAMBDA , STEP_FUNCTIONS .

  • window_id (str) – The ID of the maintenance window where the task is registered.

  • cutoff_behavior (Optional[str]) – The specification for whether tasks should continue to run after the cutoff time specified in the maintenance windows is reached.

  • description (Optional[str]) – A description of the task.

  • logging_info (Union[IResolvable, LoggingInfoProperty, Dict[str, Any], None]) – Information about an Amazon S3 bucket to write Run Command task-level logs to. .. epigraph:: 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 .

  • max_concurrency (Optional[str]) – The maximum number of targets this task can be run for, in parallel. .. epigraph:: 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.

  • max_errors (Optional[str]) –

    The maximum number of errors allowed before this task stops being scheduled. .. epigraph:: 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.

  • name (Optional[str]) – The task name.

  • service_role_arn (Optional[str]) – 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.

  • targets (Union[IResolvable, Sequence[Union[IResolvable, TargetProperty, Dict[str, Any]]], None]) – 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* .

  • task_invocation_parameters (Union[IResolvable, TaskInvocationParametersProperty, Dict[str, Any], None]) – 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. .. epigraph:: 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.

  • task_parameters (Optional[Any]) – The parameters to pass to the task when it runs. .. epigraph:: 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 .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ssm-maintenancewindowtask.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_ssm as ssm

# parameters: Any
# task_parameters: Any

cfn_maintenance_window_task_props = ssm.CfnMaintenanceWindowTaskProps(
    priority=123,
    task_arn="taskArn",
    task_type="taskType",
    window_id="windowId",

    # the properties below are optional
    cutoff_behavior="cutoffBehavior",
    description="description",
    logging_info=ssm.CfnMaintenanceWindowTask.LoggingInfoProperty(
        region="region",
        s3_bucket="s3Bucket",

        # the properties below are optional
        s3_prefix="s3Prefix"
    ),
    max_concurrency="maxConcurrency",
    max_errors="maxErrors",
    name="name",
    service_role_arn="serviceRoleArn",
    targets=[ssm.CfnMaintenanceWindowTask.TargetProperty(
        key="key",
        values=["values"]
    )],
    task_invocation_parameters=ssm.CfnMaintenanceWindowTask.TaskInvocationParametersProperty(
        maintenance_window_automation_parameters=ssm.CfnMaintenanceWindowTask.MaintenanceWindowAutomationParametersProperty(
            document_version="documentVersion",
            parameters=parameters
        ),
        maintenance_window_lambda_parameters=ssm.CfnMaintenanceWindowTask.MaintenanceWindowLambdaParametersProperty(
            client_context="clientContext",
            payload="payload",
            qualifier="qualifier"
        ),
        maintenance_window_run_command_parameters=ssm.CfnMaintenanceWindowTask.MaintenanceWindowRunCommandParametersProperty(
            cloud_watch_output_config=ssm.CfnMaintenanceWindowTask.CloudWatchOutputConfigProperty(
                cloud_watch_log_group_name="cloudWatchLogGroupName",
                cloud_watch_output_enabled=False
            ),
            comment="comment",
            document_hash="documentHash",
            document_hash_type="documentHashType",
            document_version="documentVersion",
            notification_config=ssm.CfnMaintenanceWindowTask.NotificationConfigProperty(
                notification_arn="notificationArn",

                # the properties below are optional
                notification_events=["notificationEvents"],
                notification_type="notificationType"
            ),
            output_s3_bucket_name="outputS3BucketName",
            output_s3_key_prefix="outputS3KeyPrefix",
            parameters=parameters,
            service_role_arn="serviceRoleArn",
            timeout_seconds=123
        ),
        maintenance_window_step_functions_parameters=ssm.CfnMaintenanceWindowTask.MaintenanceWindowStepFunctionsParametersProperty(
            input="input",
            name="name"
        )
    ),
    task_parameters=task_parameters
)

Attributes

cutoff_behavior

The specification for whether tasks should continue to run after the cutoff time specified in the maintenance windows is reached.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ssm-maintenancewindowtask.html#cfn-ssm-maintenancewindowtask-cutoffbehavior

description

A description of the task.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ssm-maintenancewindowtask.html#cfn-ssm-maintenancewindowtask-description

logging_info

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 .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ssm-maintenancewindowtask.html#cfn-ssm-maintenancewindowtask-logginginfo

max_concurrency

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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ssm-maintenancewindowtask.html#cfn-ssm-maintenancewindowtask-maxconcurrency

max_errors

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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ssm-maintenancewindowtask.html#cfn-ssm-maintenancewindowtask-maxerrors

name

The task name.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ssm-maintenancewindowtask.html#cfn-ssm-maintenancewindowtask-name

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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ssm-maintenancewindowtask.html#cfn-ssm-maintenancewindowtask-priority

service_role_arn

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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ssm-maintenancewindowtask.html#cfn-ssm-maintenancewindowtask-servicerolearn

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* .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ssm-maintenancewindowtask.html#cfn-ssm-maintenancewindowtask-targets

task_arn

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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ssm-maintenancewindowtask.html#cfn-ssm-maintenancewindowtask-taskarn

task_invocation_parameters

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. .. epigraph:

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.
See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ssm-maintenancewindowtask.html#cfn-ssm-maintenancewindowtask-taskinvocationparameters

task_parameters

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 .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ssm-maintenancewindowtask.html#cfn-ssm-maintenancewindowtask-taskparameters

task_type

The type of task.

Valid values: RUN_COMMAND , AUTOMATION , LAMBDA , STEP_FUNCTIONS .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ssm-maintenancewindowtask.html#cfn-ssm-maintenancewindowtask-tasktype

window_id

The ID of the maintenance window where the task is registered.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ssm-maintenancewindowtask.html#cfn-ssm-maintenancewindowtask-windowid