CfnMaintenanceWindowTaskProps Struct
Properties for defining a CfnMaintenanceWindowTask.
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_ssm as ssm } from 'aws-cdk-lib';
declare const parameters: any;
declare const taskParameters: any;
const cfnMaintenanceWindowTaskProps: ssm.CfnMaintenanceWindowTaskProps = {
priority: 123,
taskArn: 'taskArn',
taskType: 'taskType',
windowId: 'windowId',
// the properties below are optional
cutoffBehavior: 'cutoffBehavior',
description: 'description',
loggingInfo: {
region: 'region',
s3Bucket: 's3Bucket',
// the properties below are optional
s3Prefix: 's3Prefix',
},
maxConcurrency: 'maxConcurrency',
maxErrors: 'maxErrors',
name: 'name',
serviceRoleArn: 'serviceRoleArn',
targets: [{
key: 'key',
values: ['values'],
}],
taskInvocationParameters: {
maintenanceWindowAutomationParameters: {
documentVersion: 'documentVersion',
parameters: parameters,
},
maintenanceWindowLambdaParameters: {
clientContext: 'clientContext',
payload: 'payload',
qualifier: 'qualifier',
},
maintenanceWindowRunCommandParameters: {
cloudWatchOutputConfig: {
cloudWatchLogGroupName: 'cloudWatchLogGroupName',
cloudWatchOutputEnabled: false,
},
comment: 'comment',
documentHash: 'documentHash',
documentHashType: 'documentHashType',
documentVersion: 'documentVersion',
notificationConfig: {
notificationArn: 'notificationArn',
// the properties below are optional
notificationEvents: ['notificationEvents'],
notificationType: 'notificationType',
},
outputS3BucketName: 'outputS3BucketName',
outputS3KeyPrefix: 'outputS3KeyPrefix',
parameters: parameters,
serviceRoleArn: 'serviceRoleArn',
timeoutSeconds: 123,
},
maintenanceWindowStepFunctionsParameters: {
input: 'input',
name: 'name',
},
},
taskParameters: taskParameters,
};
Properties
cutoffBehavioroptionalstringcutoff_behavioroptionalstrcutoffBehavioroptionalStringCutoffBehavioroptionalstringCutoffBehavioroptional*string#descriptionoptionalstringdescriptionoptionalstrdescriptionoptionalStringDescriptionoptionalstringDescriptionoptional*string#loggingInfooptionalIResolvable | CfnMaintenanceWindowTask.LoggingInfoPropertylogging_infooptionaltyping.Union[IResolvable, LoggingInfoProperty]loggingInfooptionalIResolvableLoggingInfooptionalIResolvableLoggingInfooptionalinterface{}#notes
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 .
Information about an Amazon S3 bucket to write Run Command task-level logs to.
maxConcurrencyoptionalstringmax_concurrencyoptionalstrmaxConcurrencyoptionalStringMaxConcurrencyoptionalstringMaxConcurrencyoptional*string#notes
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.
maxErrorsoptionalstringmax_errorsoptionalstrmaxErrorsoptionalStringMaxErrorsoptionalstringMaxErrorsoptional*string#notes
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.
The lower the number, the higher the priority. Tasks that have the same priority are scheduled in parallel.
serviceRoleArnoptionalstringservice_role_arnoptionalstrserviceRoleArnoptionalStringServiceRoleArnoptionalstringServiceRoleArnoptional*string#notes
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 .
targetsoptionalIResolvable | IResolvable | CfnMaintenanceWindowTask.TargetProperty[]targetsoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, TargetProperty]]]targetsoptionalIResolvableTargetsoptionalIResolvableTargetsoptionalinterface{}#- Specify instances using
Key=InstanceIds,Values= *instanceid1* , *instanceid2*. - Specify window target IDs using
Key=WindowTargetIds,Values= *window-target-id-1* , *window-target-id-2*.
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.
taskInvocationParametersoptionalIResolvable | CfnMaintenanceWindowTask.TaskInvocationParametersPropertytask_invocation_parametersoptionaltyping.Union[IResolvable, TaskInvocationParametersProperty]taskInvocationParametersoptionalIResolvableTaskInvocationParametersoptionalIResolvableTaskInvocationParametersoptionalinterface{}#notes
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.
taskParametersoptionalanytask_parametersoptionalAnytaskParametersoptionalObjectTaskParametersoptionalobjectTaskParametersoptionalinterface{}#notes
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 .
The parameters to pass to the task when it runs.
Valid values: RUN_COMMAND , AUTOMATION , LAMBDA , STEP_FUNCTIONS .