Class CfnMaintenanceWindowTask
A CloudFormation AWS::SSM::MaintenanceWindowTask
.
public class CfnMaintenanceWindowTask : CfnResource, IInspectable
- Inheritance
-
CfnMaintenanceWindowTask
- Implements
-
IInspectable
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.SSM;
var parameters;
var taskParameters;
var cfnMaintenanceWindowTask = new CfnMaintenanceWindowTask(this, "MyCfnMaintenanceWindowTask", new CfnMaintenanceWindowTaskProps {
Priority = 123,
TaskArn = "taskArn",
TaskType = "taskType",
WindowId = "windowId",
// the properties below are optional
CutoffBehavior = "cutoffBehavior",
Description = "description",
LoggingInfo = new LoggingInfoProperty {
Region = "region",
S3Bucket = "s3Bucket",
// the properties below are optional
S3Prefix = "s3Prefix"
},
MaxConcurrency = "maxConcurrency",
MaxErrors = "maxErrors",
Name = "name",
ServiceRoleArn = "serviceRoleArn",
Targets = new [] { new TargetProperty {
Key = "key",
Values = new [] { "values" }
} },
TaskInvocationParameters = new TaskInvocationParametersProperty {
MaintenanceWindowAutomationParameters = new MaintenanceWindowAutomationParametersProperty {
DocumentVersion = "documentVersion",
Parameters = parameters
},
MaintenanceWindowLambdaParameters = new MaintenanceWindowLambdaParametersProperty {
ClientContext = "clientContext",
Payload = "payload",
Qualifier = "qualifier"
},
MaintenanceWindowRunCommandParameters = new MaintenanceWindowRunCommandParametersProperty {
CloudWatchOutputConfig = new CloudWatchOutputConfigProperty {
CloudWatchLogGroupName = "cloudWatchLogGroupName",
CloudWatchOutputEnabled = false
},
Comment = "comment",
DocumentHash = "documentHash",
DocumentHashType = "documentHashType",
DocumentVersion = "documentVersion",
NotificationConfig = new NotificationConfigProperty {
NotificationArn = "notificationArn",
// the properties below are optional
NotificationEvents = new [] { "notificationEvents" },
NotificationType = "notificationType"
},
OutputS3BucketName = "outputS3BucketName",
OutputS3KeyPrefix = "outputS3KeyPrefix",
Parameters = parameters,
ServiceRoleArn = "serviceRoleArn",
TimeoutSeconds = 123
},
MaintenanceWindowStepFunctionsParameters = new MaintenanceWindowStepFunctionsParametersProperty {
Input = "input",
Name = "name"
}
},
TaskParameters = taskParameters
});
Remarks
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 .
CloudformationResource: AWS::SSM::MaintenanceWindowTask
ExampleMetadata: fixture=_generated
Constructors
CfnMaintenanceWindowTask(Construct, string, ICfnMaintenanceWindowTaskProps)
Create a new AWS::SSM::MaintenanceWindowTask
.
public CfnMaintenanceWindowTask(Construct scope, string id, ICfnMaintenanceWindowTaskProps props)
Parameters
scope
Construct- scope in which this resource is defined.
id
string- scoped id of the resource.
props
ICfnMaintenanceWindowTaskProps- resource properties.
Properties
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
public static string CFN_RESOURCE_TYPE_NAME { get; }
Property Value
CfnProperties
protected override IDictionary<string, object> CfnProperties { get; }
Property Value
CutoffBehavior
The specification for whether tasks should continue to run after the cutoff time specified in the maintenance windows is reached.
public virtual string? CutoffBehavior { get; set; }
Property Value
Remarks
Description
A description of the task.
public virtual string? Description { get; set; }
Property Value
Remarks
LoggingInfo
Information about an Amazon S3 bucket to write Run Command task-level logs to.
public virtual object? LoggingInfo { get; set; }
Property Value
Remarks
<code>LoggingInfo</code> has been deprecated. To specify an Amazon S3 bucket to contain logs for Run Command tasks, instead use the <code>OutputS3BucketName</code> and <code>OutputS3KeyPrefix</code> options in the <code>TaskInvocationParameters</code> structure. For information about how Systems Manager handles these options for the supported maintenance window task types, see <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ssm-maintenancewindowtask-maintenancewindowruncommandparameters.html">AWS ::SSM::MaintenanceWindowTask MaintenanceWindowRunCommandParameters</a> .
MaxConcurrency
The maximum number of targets this task can be run for, in parallel.
public virtual string? MaxConcurrency { get; set; }
Property Value
Remarks
Although this element is listed as "Required: No", a value can be omitted only when you are registering or updating a <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/maintenance-windows-targetless-tasks.html">targetless task</a> 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.
MaxErrors
The maximum number of errors allowed before this task stops being scheduled.
public virtual string? MaxErrors { get; set; }
Property Value
Remarks
Although this element is listed as "Required: No", a value can be omitted only when you are registering or updating a <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/maintenance-windows-targetless-tasks.html">targetless task</a> 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
The task name.
public virtual string? Name { get; set; }
Property Value
Remarks
Priority
The priority of the task in the maintenance window.
public virtual double Priority { get; set; }
Property Value
Remarks
The lower the number, the higher the priority. Tasks that have the same priority are scheduled in parallel.
ServiceRoleArn
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.
public virtual string? ServiceRoleArn { get; set; }
Property Value
Remarks
Targets
The targets, either instances or window target IDs.
public virtual object? Targets { get; set; }
Property Value
Remarks
TaskArn
The resource that the task uses during execution.
public virtual string TaskArn { get; set; }
Property Value
Remarks
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.
TaskInvocationParameters
The parameters to pass to the task when it runs.
public virtual object? TaskInvocationParameters { get; set; }
Property Value
Remarks
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 <code>TaskInvocationParameters</code> , you must provide again all the <code>TaskInvocationParameters</code> 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 <code>TaskInvocationParameters</code> values for <code>Comment</code> , <code>NotificationConfig</code> , and <code>OutputS3BucketName</code> . If you update the maintenance window task and specify only a different <code>OutputS3BucketName</code> value, the values for <code>Comment</code> and <code>NotificationConfig</code> are removed.
TaskParameters
The parameters to pass to the task when it runs.
public virtual object TaskParameters { get; set; }
Property Value
Remarks
<code>TaskParameters</code> has been deprecated. To specify parameters to pass to a task when it runs, instead use the <code>Parameters</code> option in the <code>TaskInvocationParameters</code> structure. For information about how Systems Manager handles these options for the supported maintenance window task types, see <a href="https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_MaintenanceWindowTaskInvocationParameters.html">MaintenanceWindowTaskInvocationParameters</a> .
TaskType
The type of task.
public virtual string TaskType { get; set; }
Property Value
Remarks
Valid values: RUN_COMMAND
, AUTOMATION
, LAMBDA
, STEP_FUNCTIONS
.
WindowId
The ID of the maintenance window where the task is registered.
public virtual string WindowId { get; set; }
Property Value
Remarks
Methods
Inspect(TreeInspector)
Examines the CloudFormation resource and discloses attributes.
public virtual void Inspect(TreeInspector inspector)
Parameters
inspector
TreeInspector- tree inspector to collect and process attributes.
RenderProperties(IDictionary<string, object>)
protected override IDictionary<string, object> RenderProperties(IDictionary<string, object> props)
Parameters
props
IDictionary<string, object>