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
-
description
optional - string -
id
optional computed - string -
max_concurrency
required - string -
max_errors
required - string -
name
optional - string -
priority
optional - number -
service_role_arn
optional computed - string -
task_arn
required - string -
task_type
required - string -
window_id
required - string -
targets
list block -
task_invocation_parameters
list block-
automation_parameters
list block-
document_version
optional - string -
parameter
set block
-
-
lambda_parameters
list block-
client_context
optional - string -
payload
optional - string -
qualifier
optional - string
-
-
run_command_parameters
list block-
comment
optional - string -
document_hash
optional - string -
document_hash_type
optional - string -
document_version
optional - string -
output_s3_bucket
optional - string -
output_s3_key_prefix
optional - string -
service_role_arn
optional - string -
timeout_seconds
optional - number -
cloudwatch_config
list block-
cloudwatch_log_group_name
optional computed - string -
cloudwatch_output_enabled
optional - bool
-
-
notification_config
list block-
notification_arn
optional - string -
notification_events
optional - list of string -
notification_type
optional - string
-
-
parameter
set block
-
-
step_functions_parameters
list 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
-
MaxErrors
optional - String -
Description
optional - String -
ServiceRoleArn
optional - String -
Priority
required - Integer -
MaxConcurrency
optional - String -
Targets
optional - List of Target -
Name
optional - String -
TaskArn
required - String -
TaskInvocationParameters
optional - TaskInvocationParameters -
WindowId
required - String -
TaskParameters
optional - Json -
TaskType
required - String -
CutoffBehavior
optional - String -
LoggingInfo
optional - LoggingInfo
Explanation in CloudFormation Registry
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.
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.