@Generated(value="jsii-pacmak/1.60.0 (build ebcefe6)", date="2022-06-22T23:27:54.226Z") 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 .
|
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy
IConstruct.Jsii$Default
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
|
Modifier | Constructor and Description |
---|---|
|
CfnMaintenanceWindowTask(Construct scope,
java.lang.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 java.util.Map<java.lang.String,java.lang.Object> |
getCfnProperties() |
java.lang.String |
getCutoffBehavior()
The specification for whether tasks should continue to run after the cutoff time specified in the maintenance windows is reached.
|
java.lang.String |
getDescription()
A description of the task.
|
java.lang.Object |
getLoggingInfo()
Information about an Amazon S3 bucket to write task-level logs to.
|
java.lang.String |
getMaxConcurrency()
The maximum number of targets this task can be run for, in parallel.
|
java.lang.String |
getMaxErrors()
The maximum number of errors allowed before this task stops being scheduled.
|
java.lang.String |
getName()
The task name.
|
java.lang.Number |
getPriority()
The priority of the task in the maintenance window.
|
java.lang.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.
|
java.lang.Object |
getTargets()
The targets, either instances or window target IDs.
|
java.lang.String |
getTaskArn()
The resource that the task uses during execution.
|
java.lang.Object |
getTaskInvocationParameters()
The parameters to pass to the task when it runs.
|
java.lang.Object |
getTaskParameters()
The parameters to pass to the task when it runs.
|
java.lang.String |
getTaskType()
The type of task.
|
java.lang.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 java.util.Map<java.lang.String,java.lang.Object> |
renderProperties(java.util.Map<java.lang.String,java.lang.Object> props) |
void |
setCutoffBehavior(java.lang.String value)
The specification for whether tasks should continue to run after the cutoff time specified in the maintenance windows is reached.
|
void |
setDescription(java.lang.String value)
A description of the task.
|
void |
setLoggingInfo(CfnMaintenanceWindowTask.LoggingInfoProperty value)
Information about an Amazon S3 bucket to write task-level logs to.
|
void |
setLoggingInfo(IResolvable value)
Information about an Amazon S3 bucket to write task-level logs to.
|
void |
setMaxConcurrency(java.lang.String value)
The maximum number of targets this task can be run for, in parallel.
|
void |
setMaxErrors(java.lang.String value)
The maximum number of errors allowed before this task stops being scheduled.
|
void |
setName(java.lang.String value)
The task name.
|
void |
setPriority(java.lang.Number value)
The priority of the task in the maintenance window.
|
void |
setServiceRoleArn(java.lang.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(java.util.List<java.lang.Object> value)
The targets, either instances or window target IDs.
|
void |
setTaskArn(java.lang.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(java.lang.Object value)
The parameters to pass to the task when it runs.
|
void |
setTaskType(java.lang.String value)
The type of task.
|
void |
setWindowId(java.lang.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, validateProperties
getRef
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
public static final java.lang.String CFN_RESOURCE_TYPE_NAME
protected CfnMaintenanceWindowTask(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnMaintenanceWindowTask(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public CfnMaintenanceWindowTask(Construct scope, java.lang.String id, 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.public void inspect(TreeInspector inspector)
inspect
in interface IInspectable
inspector
- - tree inspector to collect and process attributes. This parameter is required.protected java.util.Map<java.lang.String,java.lang.Object> renderProperties(java.util.Map<java.lang.String,java.lang.Object> props)
renderProperties
in class CfnResource
props
- This parameter is required.protected java.util.Map<java.lang.String,java.lang.Object> getCfnProperties()
getCfnProperties
in class CfnResource
public java.lang.Number getPriority()
The lower the number, the higher the priority. Tasks that have the same priority are scheduled in parallel.
public void setPriority(java.lang.Number value)
The lower the number, the higher the priority. Tasks that have the same priority are scheduled in parallel.
public java.lang.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.
public void setTaskArn(java.lang.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.
public java.lang.Object getTaskParameters()
TaskParameters
has been deprecated. To specify parameters to pass to a task when it runs, instead use theParameters
option in theTaskInvocationParameters
structure. For information about how Systems Manager handles these options for the supported maintenance window task types, see MaintenanceWindowTaskInvocationParameters .
public void setTaskParameters(java.lang.Object value)
TaskParameters
has been deprecated. To specify parameters to pass to a task when it runs, instead use theParameters
option in theTaskInvocationParameters
structure. For information about how Systems Manager handles these options for the supported maintenance window task types, see MaintenanceWindowTaskInvocationParameters .
public java.lang.String getTaskType()
Valid values: RUN_COMMAND
, AUTOMATION
, LAMBDA
, STEP_FUNCTIONS
.
public void setTaskType(java.lang.String value)
Valid values: RUN_COMMAND
, AUTOMATION
, LAMBDA
, STEP_FUNCTIONS
.
public java.lang.String getWindowId()
public void setWindowId(java.lang.String value)
public java.lang.String getCutoffBehavior()
public void setCutoffBehavior(java.lang.String value)
public java.lang.String getDescription()
public void setDescription(java.lang.String value)
public java.lang.Object getLoggingInfo()
LoggingInfo
has been deprecated. To specify an Amazon S3 bucket to contain logs, instead use theOutputS3BucketName
andOutputS3KeyPrefix
options in theTaskInvocationParameters
structure. For information about how Systems Manager handles these options for the supported maintenance window task types, see AWS Systems Manager MaintenanceWindowTask TaskInvocationParameters .
public void setLoggingInfo(IResolvable value)
LoggingInfo
has been deprecated. To specify an Amazon S3 bucket to contain logs, instead use theOutputS3BucketName
andOutputS3KeyPrefix
options in theTaskInvocationParameters
structure. For information about how Systems Manager handles these options for the supported maintenance window task types, see AWS Systems Manager MaintenanceWindowTask TaskInvocationParameters .
public void setLoggingInfo(CfnMaintenanceWindowTask.LoggingInfoProperty value)
LoggingInfo
has been deprecated. To specify an Amazon S3 bucket to contain logs, instead use theOutputS3BucketName
andOutputS3KeyPrefix
options in theTaskInvocationParameters
structure. For information about how Systems Manager handles these options for the supported maintenance window task types, see AWS Systems Manager MaintenanceWindowTask TaskInvocationParameters .
public java.lang.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.
public void setMaxConcurrency(java.lang.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.
public java.lang.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.
public void setMaxErrors(java.lang.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.
public java.lang.String getName()
public void setName(java.lang.String value)
public java.lang.String getServiceRoleArn()
public void setServiceRoleArn(java.lang.String value)
public java.lang.Object getTargets()
Key=InstanceIds,Values= *instanceid1* , *instanceid2*
.Key=WindowTargetIds,Values= *window-target-id-1* , *window-target-id-2*
.public void setTargets(IResolvable value)
Key=InstanceIds,Values= *instanceid1* , *instanceid2*
.Key=WindowTargetIds,Values= *window-target-id-1* , *window-target-id-2*
.public void setTargets(java.util.List<java.lang.Object> value)
Key=InstanceIds,Values= *instanceid1* , *instanceid2*
.Key=WindowTargetIds,Values= *window-target-id-1* , *window-target-id-2*
.public java.lang.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 theTaskInvocationParameters
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 specifiedTaskInvocationParameters
values forComment
,NotificationConfig
, andOutputS3BucketName
. If you update the maintenance window task and specify only a differentOutputS3BucketName
value, the values forComment
andNotificationConfig
are removed.
public void setTaskInvocationParameters(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 theTaskInvocationParameters
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 specifiedTaskInvocationParameters
values forComment
,NotificationConfig
, andOutputS3BucketName
. If you update the maintenance window task and specify only a differentOutputS3BucketName
value, the values forComment
andNotificationConfig
are removed.
public void setTaskInvocationParameters(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 theTaskInvocationParameters
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 specifiedTaskInvocationParameters
values forComment
,NotificationConfig
, andOutputS3BucketName
. If you update the maintenance window task and specify only a differentOutputS3BucketName
value, the values forComment
andNotificationConfig
are removed.