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.

Review your Terraform file for AWS best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).

Parameters

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

Schwduled-stop-start-ec2.yml#L69
    Type: AWS::SSM::MaintenanceWindowTask
    Properties:
      Description: "EC2の自動停止のタスクです"
      MaxConcurrency: 1
      MaxErrors: 1
      Name: Schedule-stop-ec2
ssm-basics-patch-manager.yml#L50
    Type: "AWS::SSM::MaintenanceWindowTask"
    Properties:
      MaxErrors: 1
      ServiceRoleArn: !Ref MaintenanceWindowRoleArn
      Priority: 1
      MaxConcurrency: 2
YAML_Service_Catalog_EC2_Reference_Architecture.yml#L209
    Type: AWS::SSM::MaintenanceWindowTask
  LinuxMaintenanceWindowTaskScan:
    Properties:
      Description: 'Service Catalog EC2 Reference Architecture Maintenance Window
        Task: Scan for update for Amazon Linux Instance'
      MaxConcurrency: 1
ssm-maintenancetask.yml#L19
    Type: "AWS::SSM::MaintenanceWindowTask"
    Properties:
      MaxErrors: 1
      Description: Task that applies patches to instances
      ServiceRoleArn:
        Fn::ImportValue: mw-iam-role
ssm-maintenance-window-patch.yml#L121
    Type: AWS::SSM::MaintenanceWindowTask
    Properties:
      Description: Update standard Amazon Linux 2 instances
      Name: !Sub ${Environment}-al2-update
      TaskType: RUN_COMMAND
      WindowId: !Ref WeeklyMaintenanceWindow
patching.template.json#L74
      "Type": "AWS::SSM::MaintenanceWindowTask",
      "Properties": {
        "MaxConcurrency": "2",
        "MaxErrors": "2",
        "Priority": 1,
        "Targets": [
CF_DeploySSMResource_Inc_NoReboot.json#L125
            "Type": "AWS::SSM::MaintenanceWindowTask",
            "Properties": {
                "MaxErrors": 50,
                "Description": "Scans for patches in all instances",
                "Priority": 1,
                "MaxConcurrency": 100,
CF_DeploySSMResource.json#L125
            "Type": "AWS::SSM::MaintenanceWindowTask",
            "Properties": {
                "MaxErrors": 50,
                "Description": "Scans for patches in all instances",
                "Priority": 1,
                "MaxConcurrency": 100,
CF_DeployNoRebootSSMResource_NewPB.json#L119
            "Type": "AWS::SSM::MaintenanceWindowTask",
            "Properties": {
                "MaxErrors": 50,
                "Description": "Scans for patches in all instances",
                "Priority": 1,
                "MaxConcurrency": 100,
CF_DeployNoRebootSSMResource.json#L119
            "Type": "AWS::SSM::MaintenanceWindowTask",
            "Properties": {
                "MaxErrors": 50,
                "Description": "Scans for patches in all instances",
                "Priority": 1,
                "MaxConcurrency": 100,

Parameters

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.