AWS Systems Manager Maintenance Window Target

This page shows how to write Terraform and CloudFormation for Systems Manager Maintenance Window Target and write them securely.

aws_ssm_maintenance_window_target (Terraform)

The Maintenance Window Target in Systems Manager can be configured in Terraform with the resource name aws_ssm_maintenance_window_target. 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 Target resource

AWS::SSM::MaintenanceWindowTarget (CloudFormation)

The MaintenanceWindowTarget in SSM can be configured in CloudFormation with the resource name AWS::SSM::MaintenanceWindowTarget. The following sections describe 10 examples of how to use the resource and its parameters.

Example Usage from GitHub

ssm-maintenance-window-patch.yml#L75
    Type: AWS::SSM::MaintenanceWindowTarget
    Properties:
      Description: !Sub ${Environment} AL2 Standard
      Name: !Sub ${Environment}-al2-standard
      ResourceType: INSTANCE
      Targets:
ssm-maintenancetask.yml#L6
    Type: "AWS::SSM::MaintenanceWindowTarget"
    Properties:
      OwnerInformation: "dave@globomantics.com"
      Description: "All Server 2016"
      WindowId:
        Fn::ImportValue: mw-patch-2016
Schwduled-stop-start-ec2.yml#L57
    Type: AWS::SSM::MaintenanceWindowTarget
    Properties:
      Description: "自動停止を適用するターゲットを定義します"
      Name: EC2
      ResourceType: RESOURCE_GROUP
      Targets:
ssm-basics-patch-manager.yml#L39
    Type: "AWS::SSM::MaintenanceWindowTarget"
    Properties:
      OwnerInformation: !Ref UbuntuPatchGroupKey
      WindowId: !Ref DemoMaintenanceWindow
      ResourceType: INSTANCE
      Targets:
centos_production.yml#L14
    Type: "AWS::SSM::MaintenanceWindowTarget"
    Properties:
      Name: "Target-For-Patch-Manager-Maintenance-Window"
      Description: "Defines the EC2 Instance Targest for Maintenance Window: Patch-Manager-Maintenance-Window"
      ResourceType: "INSTANCE"
      WindowId:
CF_DeployNoRebootSSMResource.json#L97
            "Type": "AWS::SSM::MaintenanceWindowTarget",
            "Properties": {
                "Description": "Scan for Patches in ScanPatchInfoNoRebootSystems",
                "WindowId": {
                    "Ref": "ScanMaintenanceWindow"
                },
CF_DeployNoRebootSSMResource_NewPB.json#L97
            "Type": "AWS::SSM::MaintenanceWindowTarget",
            "Properties": {
                "Description": "Scan for Patches in ScanPatchInfoNoRebootSystems",
                "WindowId": {
                    "Ref": "ScanMaintenanceWindow"
                },
cf-dev-environments-patchbaseline.json#L92
              "Type" : "AWS::SSM::MaintenanceWindowTarget",
              "Properties" : {
                "Name": { "Fn::Join": ["-",["MaintenanceWindow-Targets",{ "Fn::FindInMap": ["CustomVariables", "PatchGroups1","Value"]},"Schedule1" ]]},
                "Description" : { "Fn::Join": [" ",["MaintenanceWindow","Targets",{ "Fn::FindInMap": ["CustomVariables", "PatchGroups1","Value"]},"Schedule1" ]]},
                "WindowId" : {"Ref": "MaintenanceWindow1"},
                "ResourceType" : "INSTANCE",
patching.template.json#L32
      "Type": "AWS::SSM::MaintenanceWindowTarget",
      "Properties": {
        "ResourceType": "INSTANCE",
        "Targets": [
          {
            "Key": "tag:Patchgroup",
CF_DeploySSMResource_Inc_NoReboot.json#L103
            "Type": "AWS::SSM::MaintenanceWindowTarget",
            "Properties": {
                "Description": "Scan for Patches in All instances",
                "WindowId": {
                    "Ref": "ScanMaintenanceWindow"
                },

Parameters

Explanation in CloudFormation Registry

The AWS::SSM::MaintenanceWindowTarget resource registers a target with a maintenance window for AWS Systems Manager. For more information, see RegisterTargetWithMaintenanceWindow in the AWS Systems Manager API Reference.

Frequently asked questions

What is AWS Systems Manager Maintenance Window Target?

AWS Systems Manager Maintenance Window Target 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 Target?

For CloudFormation, the stuartellis/ec2-evergreen, sednanref/learning and ShumpeiAsahi/Schwduled-stop-start-ec2 source code examples are useful. See the CloudFormation Example section for further details.