AWS Systems Manager Maintenance Window Task
This page shows how to write Terraform and CloudFormation for Systems Manager Maintenance Window Task and write them securely.
aws_ssm_maintenance_window_task (Terraform)
The Maintenance Window Task in Systems Manager can be configured in Terraform with the resource name aws_ssm_maintenance_window_task. The following sections describe how to use the resource and its parameters.
Example Usage from GitHub
An example could not be found in GitHub.
Parameters
-
descriptionoptional - string -
idoptional computed - string -
max_concurrencyrequired - string -
max_errorsrequired - string -
nameoptional - string -
priorityoptional - number -
service_role_arnoptional computed - string -
task_arnrequired - string -
task_typerequired - string -
window_idrequired - string -
targetslist block -
task_invocation_parameterslist block-
automation_parameterslist block-
document_versionoptional - string -
parameterset block
-
-
lambda_parameterslist block-
client_contextoptional - string -
payloadoptional - string -
qualifieroptional - string
-
-
run_command_parameterslist block-
commentoptional - string -
document_hashoptional - string -
document_hash_typeoptional - string -
document_versionoptional - string -
output_s3_bucketoptional - string -
output_s3_key_prefixoptional - string -
service_role_arnoptional - string -
timeout_secondsoptional - number -
cloudwatch_configlist block-
cloudwatch_log_group_nameoptional computed - string -
cloudwatch_output_enabledoptional - bool
-
-
notification_configlist block-
notification_arnoptional - string -
notification_eventsoptional - list of string -
notification_typeoptional - string
-
-
parameterset block
-
-
step_functions_parameterslist block
-
Explanation in Terraform Registry
Provides an SSM Maintenance Window Task resource
AWS::SSM::MaintenanceWindowTask (CloudFormation)
The MaintenanceWindowTask in SSM can be configured in CloudFormation with the resource name AWS::SSM::MaintenanceWindowTask. The following sections describe 10 examples of how to use the resource and its parameters.
Example Usage from GitHub
Type: AWS::SSM::MaintenanceWindowTask
Properties:
Description: "EC2の自動停止のタスクです"
MaxConcurrency: 1
MaxErrors: 1
Name: Schedule-stop-ec2
Type: "AWS::SSM::MaintenanceWindowTask"
Properties:
MaxErrors: 1
ServiceRoleArn: !Ref MaintenanceWindowRoleArn
Priority: 1
MaxConcurrency: 2
Type: AWS::SSM::MaintenanceWindowTask
LinuxMaintenanceWindowTaskScan:
Properties:
Description: 'Service Catalog EC2 Reference Architecture Maintenance Window
Task: Scan for update for Amazon Linux Instance'
MaxConcurrency: 1
Type: "AWS::SSM::MaintenanceWindowTask"
Properties:
MaxErrors: 1
Description: Task that applies patches to instances
ServiceRoleArn:
Fn::ImportValue: mw-iam-role
Type: AWS::SSM::MaintenanceWindowTask
Properties:
Description: Update standard Amazon Linux 2 instances
Name: !Sub ${Environment}-al2-update
TaskType: RUN_COMMAND
WindowId: !Ref WeeklyMaintenanceWindow
"Type": "AWS::SSM::MaintenanceWindowTask",
"Properties": {
"MaxConcurrency": "2",
"MaxErrors": "2",
"Priority": 1,
"Targets": [
"Type": "AWS::SSM::MaintenanceWindowTask",
"Properties": {
"MaxErrors": 50,
"Description": "Scans for patches in all instances",
"Priority": 1,
"MaxConcurrency": 100,
"Type": "AWS::SSM::MaintenanceWindowTask",
"Properties": {
"MaxErrors": 50,
"Description": "Scans for patches in all instances",
"Priority": 1,
"MaxConcurrency": 100,
"Type": "AWS::SSM::MaintenanceWindowTask",
"Properties": {
"MaxErrors": 50,
"Description": "Scans for patches in all instances",
"Priority": 1,
"MaxConcurrency": 100,
"Type": "AWS::SSM::MaintenanceWindowTask",
"Properties": {
"MaxErrors": 50,
"Description": "Scans for patches in all instances",
"Priority": 1,
"MaxConcurrency": 100,
Parameters
-
MaxErrorsoptional - String -
Descriptionoptional - String -
ServiceRoleArnoptional - String -
Priorityrequired - Integer -
MaxConcurrencyoptional - String -
Targetsoptional - List of Target -
Nameoptional - String -
TaskArnrequired - String -
TaskInvocationParametersoptional - TaskInvocationParameters -
WindowIdrequired - String -
TaskParametersoptional - Json -
TaskTyperequired - String -
CutoffBehavioroptional - String -
LoggingInfooptional - LoggingInfo
Explanation in CloudFormation Registry
The
AWS::SSM::MaintenanceWindowTaskresource defines information about a task for an AWS Systems Manager maintenance window. For more information, see RegisterTaskWithMaintenanceWindow in the AWS Systems Manager API Reference.
Frequently asked questions
What is AWS Systems Manager Maintenance Window Task?
AWS Systems Manager Maintenance Window Task is a resource for Systems Manager of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.
Where can I find the example code for the AWS Systems Manager Maintenance Window Task?
For CloudFormation, the ShumpeiAsahi/Schwduled-stop-start-ec2, rajjeet/CloudformationStarters and asaf-proov/prooV-ServiceCatalog source code examples are useful. See the CloudFormation Example section for further details.