@Generated(value="jsii-pacmak/1.71.0 (build f1f58ae)", date="2022-12-07T17:24:39.754Z") @Stability(value=Stable) public class CfnMaintenanceWindowTask extends CfnResource implements IInspectable
The AWS::SSM::MaintenanceWindowTask resource defines information about a task for an AWS Systems Manager maintenance window. For more information, see RegisterTaskWithMaintenanceWindow in the AWS Systems Manager API Reference .
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;
CfnMaintenanceWindowTask cfnMaintenanceWindowTask = CfnMaintenanceWindowTask.Builder.create(this, "MyCfnMaintenanceWindowTask")
.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();
| Modifier and Type | Class and Description |
|---|---|
static class |
CfnMaintenanceWindowTask.Builder
A fluent builder for
CfnMaintenanceWindowTask. |
static interface |
CfnMaintenanceWindowTask.CloudWatchOutputConfigProperty
Configuration options for sending command output to Amazon CloudWatch Logs.
|
static interface |
CfnMaintenanceWindowTask.LoggingInfoProperty
The `LoggingInfo` property type specifies information about the Amazon S3 bucket to write instance-level logs to.
|
static interface |
CfnMaintenanceWindowTask.MaintenanceWindowAutomationParametersProperty
The `MaintenanceWindowAutomationParameters` property type specifies the parameters for an `AUTOMATION` task type for a maintenance window task in AWS Systems Manager .
|
static interface |
CfnMaintenanceWindowTask.MaintenanceWindowLambdaParametersProperty
The `MaintenanceWindowLambdaParameters` property type specifies the parameters for a `LAMBDA` task type for a maintenance window task in AWS Systems Manager .
|
static interface |
CfnMaintenanceWindowTask.MaintenanceWindowRunCommandParametersProperty
The `MaintenanceWindowRunCommandParameters` property type specifies the parameters for a `RUN_COMMAND` task type for a maintenance window task in AWS Systems Manager .
|
static interface |
CfnMaintenanceWindowTask.MaintenanceWindowStepFunctionsParametersProperty
The `MaintenanceWindowStepFunctionsParameters` property type specifies the parameters for the execution of a `STEP_FUNCTIONS` task in a Systems Manager maintenance window.
|
static interface |
CfnMaintenanceWindowTask.NotificationConfigProperty
The `NotificationConfig` property type specifies configurations for sending notifications for a maintenance window task in AWS Systems Manager .
|
static interface |
CfnMaintenanceWindowTask.TargetProperty
The `Target` property type specifies targets (either instances or window target IDs).
|
static interface |
CfnMaintenanceWindowTask.TaskInvocationParametersProperty
The `TaskInvocationParameters` property type specifies the task execution parameters for a maintenance window task in AWS Systems Manager .
|
software.amazon.jsii.JsiiObject.InitializationModeIInspectable.Jsii$Default, IInspectable.Jsii$ProxyIConstruct.Jsii$Default| Modifier and Type | Field and Description |
|---|---|
static String |
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
|
| Modifier | Constructor and Description |
|---|---|
|
CfnMaintenanceWindowTask(Construct scope,
String id,
CfnMaintenanceWindowTaskProps props)
Create a new `AWS::SSM::MaintenanceWindowTask`.
|
protected |
CfnMaintenanceWindowTask(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CfnMaintenanceWindowTask(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
protected Map<String,Object> |
getCfnProperties() |
String |
getCutoffBehavior()
The specification for whether tasks should continue to run after the cutoff time specified in the maintenance windows is reached.
|
String |
getDescription()
A description of the task.
|
Object |
getLoggingInfo()
Information about an Amazon S3 bucket to write Run Command task-level logs to.
|
String |
getMaxConcurrency()
The maximum number of targets this task can be run for, in parallel.
|
String |
getMaxErrors()
The maximum number of errors allowed before this task stops being scheduled.
|
String |
getName()
The task name.
|
Number |
getPriority()
The priority of the task in the maintenance window.
|
String |
getServiceRoleArn()
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.
|
Object |
getTargets()
The targets, either instances or window target IDs.
|
String |
getTaskArn()
The resource that the task uses during execution.
|
Object |
getTaskInvocationParameters()
The parameters to pass to the task when it runs.
|
Object |
getTaskParameters()
The parameters to pass to the task when it runs.
|
String |
getTaskType()
The type of task.
|
String |
getWindowId()
The ID of the maintenance window where the task is registered.
|
void |
inspect(TreeInspector inspector)
Examines the CloudFormation resource and discloses attributes.
|
protected Map<String,Object> |
renderProperties(Map<String,Object> props) |
void |
setCutoffBehavior(String value)
The specification for whether tasks should continue to run after the cutoff time specified in the maintenance windows is reached.
|
void |
setDescription(String value)
A description of the task.
|
void |
setLoggingInfo(CfnMaintenanceWindowTask.LoggingInfoProperty value)
Information about an Amazon S3 bucket to write Run Command task-level logs to.
|
void |
setLoggingInfo(IResolvable value)
Information about an Amazon S3 bucket to write Run Command task-level logs to.
|
void |
setMaxConcurrency(String value)
The maximum number of targets this task can be run for, in parallel.
|
void |
setMaxErrors(String value)
The maximum number of errors allowed before this task stops being scheduled.
|
void |
setName(String value)
The task name.
|
void |
setPriority(Number value)
The priority of the task in the maintenance window.
|
void |
setServiceRoleArn(String value)
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.
|
void |
setTargets(IResolvable value)
The targets, either instances or window target IDs.
|
void |
setTargets(List<Object> value)
The targets, either instances or window target IDs.
|
void |
setTaskArn(String value)
The resource that the task uses during execution.
|
void |
setTaskInvocationParameters(CfnMaintenanceWindowTask.TaskInvocationParametersProperty value)
The parameters to pass to the task when it runs.
|
void |
setTaskInvocationParameters(IResolvable value)
The parameters to pass to the task when it runs.
|
void |
setTaskParameters(Object value)
The parameters to pass to the task when it runs.
|
void |
setTaskType(String value)
The type of task.
|
void |
setWindowId(String value)
The ID of the maintenance window where the task is registered.
|
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, isCfnResource, shouldSynthesize, toString, validatePropertiesgetRefgetCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdgetNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validatejsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet@Stability(value=Stable) public static final String CFN_RESOURCE_TYPE_NAME
protected CfnMaintenanceWindowTask(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnMaintenanceWindowTask(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable)
public CfnMaintenanceWindowTask(@NotNull
Construct scope,
@NotNull
String id,
@NotNull
CfnMaintenanceWindowTaskProps props)
scope - - scope in which this resource is defined. This parameter is required.id - - scoped id of the resource. This parameter is required.props - - resource properties. This parameter is required.@Stability(value=Stable)
public void inspect(@NotNull
TreeInspector inspector)
inspect in interface IInspectableinspector - - tree inspector to collect and process attributes. This parameter is required.@Stability(value=Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
renderProperties in class CfnResourceprops - This parameter is required.@Stability(value=Stable) @NotNull protected Map<String,Object> getCfnProperties()
getCfnProperties in class CfnResource@Stability(value=Stable) @NotNull public Number getPriority()
The lower the number, the higher the priority. Tasks that have the same priority are scheduled in parallel.
@Stability(value=Stable)
public void setPriority(@NotNull
Number value)
The lower the number, the higher the priority. Tasks that have the same priority are scheduled in parallel.
@Stability(value=Stable) @NotNull public String getTaskArn()
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.
@Stability(value=Stable)
public void setTaskArn(@NotNull
String value)
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.
@Stability(value=Stable) @NotNull public Object getTaskParameters()
TaskParametershas been deprecated. To specify parameters to pass to a task when it runs, instead use theParametersoption in theTaskInvocationParametersstructure. For information about how Systems Manager handles these options for the supported maintenance window task types, see MaintenanceWindowTaskInvocationParameters .
@Stability(value=Stable)
public void setTaskParameters(@NotNull
Object value)
TaskParametershas been deprecated. To specify parameters to pass to a task when it runs, instead use theParametersoption in theTaskInvocationParametersstructure. For information about how Systems Manager handles these options for the supported maintenance window task types, see MaintenanceWindowTaskInvocationParameters .
@Stability(value=Stable) @NotNull public String getTaskType()
Valid values: RUN_COMMAND , AUTOMATION , LAMBDA , STEP_FUNCTIONS .
@Stability(value=Stable)
public void setTaskType(@NotNull
String value)
Valid values: RUN_COMMAND , AUTOMATION , LAMBDA , STEP_FUNCTIONS .
@Stability(value=Stable) @NotNull public String getWindowId()
@Stability(value=Stable)
public void setWindowId(@NotNull
String value)
@Stability(value=Stable) @Nullable public String getCutoffBehavior()
@Stability(value=Stable)
public void setCutoffBehavior(@Nullable
String value)
@Stability(value=Stable) @Nullable public String getDescription()
@Stability(value=Stable)
public void setDescription(@Nullable
String value)
@Stability(value=Stable) @Nullable public Object getLoggingInfo()
LoggingInfohas been deprecated. To specify an Amazon S3 bucket to contain logs for Run Command tasks, instead use theOutputS3BucketNameandOutputS3KeyPrefixoptions in theTaskInvocationParametersstructure. For information about how Systems Manager handles these options for the supported maintenance window task types, see AWS ::SSM::MaintenanceWindowTask MaintenanceWindowRunCommandParameters .
@Stability(value=Stable)
public void setLoggingInfo(@Nullable
IResolvable value)
LoggingInfohas been deprecated. To specify an Amazon S3 bucket to contain logs for Run Command tasks, instead use theOutputS3BucketNameandOutputS3KeyPrefixoptions in theTaskInvocationParametersstructure. For information about how Systems Manager handles these options for the supported maintenance window task types, see AWS ::SSM::MaintenanceWindowTask MaintenanceWindowRunCommandParameters .
@Stability(value=Stable)
public void setLoggingInfo(@Nullable
CfnMaintenanceWindowTask.LoggingInfoProperty value)
LoggingInfohas been deprecated. To specify an Amazon S3 bucket to contain logs for Run Command tasks, instead use theOutputS3BucketNameandOutputS3KeyPrefixoptions in theTaskInvocationParametersstructure. For information about how Systems Manager handles these options for the supported maintenance window task types, see AWS ::SSM::MaintenanceWindowTask MaintenanceWindowRunCommandParameters .
@Stability(value=Stable) @Nullable public String getMaxConcurrency()
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.
@Stability(value=Stable)
public void setMaxConcurrency(@Nullable
String value)
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.
@Stability(value=Stable) @Nullable public String getMaxErrors()
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.
@Stability(value=Stable)
public void setMaxErrors(@Nullable
String value)
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.
@Stability(value=Stable) @Nullable public String getName()
@Stability(value=Stable)
public void setName(@Nullable
String value)
@Stability(value=Stable) @Nullable public String getServiceRoleArn()
@Stability(value=Stable)
public void setServiceRoleArn(@Nullable
String value)
@Stability(value=Stable) @Nullable public Object getTargets()
Key=InstanceIds,Values= *instanceid1* , *instanceid2* .Key=WindowTargetIds,Values= *window-target-id-1* , *window-target-id-2* .@Stability(value=Stable)
public void setTargets(@Nullable
IResolvable value)
Key=InstanceIds,Values= *instanceid1* , *instanceid2* .Key=WindowTargetIds,Values= *window-target-id-1* , *window-target-id-2* .@Stability(value=Stable)
public void setTargets(@Nullable
List<Object> value)
Key=InstanceIds,Values= *instanceid1* , *instanceid2* .Key=WindowTargetIds,Values= *window-target-id-1* , *window-target-id-2* .@Stability(value=Stable) @Nullable public Object getTaskInvocationParameters()
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.
@Stability(value=Stable)
public void setTaskInvocationParameters(@Nullable
IResolvable value)
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.
@Stability(value=Stable)
public void setTaskInvocationParameters(@Nullable
CfnMaintenanceWindowTask.TaskInvocationParametersProperty value)
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.
Copyright © 2022. All rights reserved.