AWS::SSM::MaintenanceWindowTarget - AWS CloudFormation

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

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

Minimum: 3

Maximum: 128

Update requires: No interruption

OwnerInformation

A user-provided value that will be included in any Amazon CloudWatch Events 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: Array of Targets

Minimum: 0

Maximum: 5

Update requires: No interruption

WindowId

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

Required: Yes

Type: String

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

Minimum: 20

Maximum: 20

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.

Fn::GetAtt

Examples

Create a maintenance window that targets instances by using tags

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: 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