Interface CfnMaintenanceWindowTaskProps
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
CfnMaintenanceWindowTaskProps.Jsii$Proxy
CfnMaintenanceWindowTask.
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.ssm.*;
Object parameters;
Object taskParameters;
CfnMaintenanceWindowTaskProps cfnMaintenanceWindowTaskProps = CfnMaintenanceWindowTaskProps.builder()
.priority(123)
.taskArn("taskArn")
.taskType("taskType")
.windowId("windowId")
// the properties below are optional
.cutoffBehavior("cutoffBehavior")
.description("description")
.loggingInfo(LoggingInfoProperty.builder()
.region("region")
.s3Bucket("s3Bucket")
// the properties below are optional
.s3Prefix("s3Prefix")
.build())
.maxConcurrency("maxConcurrency")
.maxErrors("maxErrors")
.name("name")
.serviceRoleArn("serviceRoleArn")
.targets(List.of(TargetProperty.builder()
.key("key")
.values(List.of("values"))
.build()))
.taskInvocationParameters(TaskInvocationParametersProperty.builder()
.maintenanceWindowAutomationParameters(MaintenanceWindowAutomationParametersProperty.builder()
.documentVersion("documentVersion")
.parameters(parameters)
.build())
.maintenanceWindowLambdaParameters(MaintenanceWindowLambdaParametersProperty.builder()
.clientContext("clientContext")
.payload("payload")
.qualifier("qualifier")
.build())
.maintenanceWindowRunCommandParameters(MaintenanceWindowRunCommandParametersProperty.builder()
.cloudWatchOutputConfig(CloudWatchOutputConfigProperty.builder()
.cloudWatchLogGroupName("cloudWatchLogGroupName")
.cloudWatchOutputEnabled(false)
.build())
.comment("comment")
.documentHash("documentHash")
.documentHashType("documentHashType")
.documentVersion("documentVersion")
.notificationConfig(NotificationConfigProperty.builder()
.notificationArn("notificationArn")
// the properties below are optional
.notificationEvents(List.of("notificationEvents"))
.notificationType("notificationType")
.build())
.outputS3BucketName("outputS3BucketName")
.outputS3KeyPrefix("outputS3KeyPrefix")
.parameters(parameters)
.serviceRoleArn("serviceRoleArn")
.timeoutSeconds(123)
.build())
.maintenanceWindowStepFunctionsParameters(MaintenanceWindowStepFunctionsParametersProperty.builder()
.input("input")
.name("name")
.build())
.build())
.taskParameters(taskParameters)
.build();
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA builder forCfnMaintenanceWindowTaskPropsstatic final classAn implementation forCfnMaintenanceWindowTaskProps -
Method Summary
Modifier and TypeMethodDescriptionbuilder()default StringThe specification for whether tasks should continue to run after the cutoff time specified in the maintenance windows is reached.default StringA description of the task.default Objectdefault StringThe maximum number of targets this task can be run for, in parallel.default StringThe maximum number of errors allowed before this task stops being scheduled.default StringgetName()The task name.The priority of the task in the maintenance window.default StringThe Amazon Resource Name (ARN) of the IAM service role for AWS Systems Manager to assume when running a maintenance window task.default ObjectThe targets, either instances or window target IDs.The resource that the task uses during execution.default ObjectThe parameters to pass to the task when it runs.default ObjectThe type of task.The ID of the maintenance window where the task is registered.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getPriority
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 Also:
-
getTaskArn
The resource that the task uses during execution.For
RUN_COMMANDandAUTOMATIONtask types,TaskArnis the SSM document name or Amazon Resource Name (ARN).For
LAMBDAtasks,TaskArnis the function name or ARN.For
STEP_FUNCTIONStasks,TaskArnis the state machine ARN.- See Also:
-
getTaskType
The type of task.Valid values:
RUN_COMMAND,AUTOMATION,LAMBDA,STEP_FUNCTIONS.- See Also:
-
getWindowId
The ID of the maintenance window where the task is registered.- See Also:
-
getCutoffBehavior
The specification for whether tasks should continue to run after the cutoff time specified in the maintenance windows is reached.- See Also:
-
getDescription
A description of the task.- See Also:
-
getLoggingInfo
LoggingInfohas been deprecated.To specify an Amazon S3 bucket to contain logs for Run Command tasks, instead use the
OutputS3BucketNameandOutputS3KeyPrefixoptions in theTaskInvocationParametersstructure. For information about how Systems Manager handles these options for the supported maintenance window task types, see AWS ::SSM::MaintenanceWindowTask MaintenanceWindowRunCommandParameters .Information about an Amazon S3 bucket to write Run Command task-level logs to.
Returns union: either
IResolvableorCfnMaintenanceWindowTask.LoggingInfoProperty- See Also:
-
getMaxConcurrency
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 Also:
-
getMaxErrors
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 Also:
-
getName
The task name.- See Also:
-
getServiceRoleArn
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 .
- See Also:
-
getTargets
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 union: either
IResolvableor Listinvalid input: '<'eitherIResolvableorCfnMaintenanceWindowTask.TargetProperty>- See Also:
- Specify instances using
-
getTaskInvocationParameters
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 theTaskInvocationParametersvalues 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 specifiedTaskInvocationParametersvalues forComment,NotificationConfig, andOutputS3BucketName. If you update the maintenance window task and specify only a differentOutputS3BucketNamevalue, the values forCommentandNotificationConfigare removed.Returns union: either
IResolvableorCfnMaintenanceWindowTask.TaskInvocationParametersProperty- See Also:
-
getTaskParameters
TaskParametershas been deprecated.To specify parameters to pass to a task when it runs, instead use the
Parametersoption in theTaskInvocationParametersstructure. For information about how Systems Manager handles these options for the supported maintenance window task types, see MaintenanceWindowTaskInvocationParameters .The parameters to pass to the task when it runs.
- See Also:
-
builder
-