AWS CloudFormation
User Guide (Version )

AWS::SSM::MaintenanceWindowTarget

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.

Syntax

To declare this entity in your AWS CloudFormation template, use the following syntax:

JSON

{ "Type" : "AWS::SSM::MaintenanceWindowTarget", "Properties" : { "Description" : String, "Name" : String, "OwnerInformation" : String, "ResourceType" : String, "Targets" : [ Targets, ... ], "WindowId" : String } }

YAML

Type: AWS::SSM::MaintenanceWindowTarget Properties: Description: String Name: String OwnerInformation: String ResourceType: String Targets: - Targets WindowId: String

Properties

Description

A description for the target.

Required: No

Type: String

Minimum: 1

Maximum: 128

Update requires: No interruption

Name

The name for the maintenance window target.

Required: No

Type: String

Minimum: 3

Maximum: 128

Pattern: ^[a-zA-Z0-9_\-.]{3,128}$

Update requires: No interruption

OwnerInformation

A user-provided value that will be included in any CloudWatch events that are raised while running tasks for these targets in this maintenance window.

Required: No

Type: String

Minimum: 1

Maximum: 128

Update requires: No interruption

ResourceType

The type of target that is being registered with the maintenance window.

Required: Yes

Type: String

Allowed Values: INSTANCE | RESOURCE_GROUP

Update requires: No interruption

Targets

The targets to register with the maintenance window. In other words, the instances to run commands on when the maintenance window runs.

You must specify targets by using the WindowTargetIds parameter.

Required: Yes

Type: List of Targets

Maximum: 5

Update requires: No interruption

WindowId

The ID of the maintenance window to register the target with.

Required: Yes

Type: String

Minimum: 20

Maximum: 20

Pattern: ^mw-[0-9a-f]{17}$

Update requires: Replacement

Return Values

Ref

When you pass the logical ID of this resource to the intrinsic Ref function, Ref returns the maintenance window target ID, such as 12a345b6-bbb7-4bb6-90b0-8c9577a2d2b9.

For more information about using the Ref function, see Ref.

Examples

AWS Systems Manager Maintenance Window Target Example

The following example creates a Systems Manager maintenance window target that targets managed instances with the tag key ENV and the tag value DEV.

JSON

{ "Resources": { "MaintenanceWindowTarget": { "Type": "AWS::SSM::MaintenanceWindowTarget", "Properties": { "WindowId": "MaintenanceWindow", "ResourceType": "INSTANCE", "Targets": [ { "Key": "tag:ENV", "Values": [ "DEV" ] } ], "OwnerInformation": "SSM Step Function Demo", "Name": "SSMStepFunctionDemo", "Description": "A target for demonstrating maintenance windows and step functions" }, "DependsOn": "MaintenanceWindow" } } }

YAML

Resources: MaintenanceWindowTarget: Type: 'AWS::SSM::MaintenanceWindowTarget' Properties: WindowId: !Ref MaintenanceWindow ResourceType: 'INSTANCE' Targets: - Key: 'tag:ENV' Values: - 'DEV' OwnerInformation: 'SSM Step Function Demo' Name: 'SSMStepFunctionDemo' Description: 'A target for demonstrating maintenance windows and step functions' DependsOn: MaintenanceWindow

See Also