Skip to main content

maintenance_window_targets

Creates, updates, deletes, gets or lists a maintenance_window_targets resource.

Overview

Namemaintenance_window_targets
TypeResource
Idaws.ssm.maintenance_window_targets

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
descriptionstringA description for the target.
namestringThe name for the maintenance window target. (pattern: <code>^[a-zA-Z0-9_-.]{3,128}$</code>)
owner_informationstringA 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.
resource_typestringThe type of target that is being registered with the maintenance window. (INSTANCE, RESOURCE_GROUP)
targetsarrayThe targets, either managed nodes or tags. Specify managed nodes using the following format: Key=instanceids,Values=<instanceid1>,<instanceid2> Tags are specified using the following format: Key=<tag name>,Values=<tag value>.
window_idstringThe ID of the maintenance window to register the target with. (pattern: <code>^mw-[0-9a-f]{17}$</code>)
window_target_idstringThe ID of the target. (pattern: <code>^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$</code>)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_maintenance_window_targetsselectregionLists the targets registered with the maintenance window.
update_maintenance_window_targetupdateregion, WindowId, WindowTargetIdModifies the target of an existing maintenance window. You can change the following: Name Description Owner IDs for an ID target Tags for a Tag target From any supported tag type to another. The three supported tag types are ID target, Tag target, and resource group. For more information, see Target. If a parameter is null, then the corresponding field isn't modified.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)

SELECT examples

Lists the targets registered with the maintenance window.

SELECT
description,
name,
owner_information,
resource_type,
targets,
window_id,
window_target_id
FROM aws.ssm.maintenance_window_targets
WHERE region = '{{ region }}' -- required
;

UPDATE examples

Modifies the target of an existing maintenance window. You can change the following: Name Description Owner IDs for an ID target Tags for a Tag target From any supported tag type to another. The three supported tag types are ID target, Tag target, and resource group. For more information, see Target. If a parameter is null, then the corresponding field isn't modified.

UPDATE aws.ssm.maintenance_window_targets
SET
WindowId = '{{ WindowId }}',
WindowTargetId = '{{ WindowTargetId }}',
Targets = '{{ Targets }}',
OwnerInformation = '{{ OwnerInformation }}',
Name = '{{ Name }}',
Description = '{{ Description }}',
Replace = {{ Replace }}
WHERE
region = '{{ region }}' --required
AND WindowId = '{{ WindowId }}' --required
AND WindowTargetId = '{{ WindowTargetId }}' --required
RETURNING
description,
name,
owner_information,
targets,
window_id,
window_target_id;