maintenance_window_targets
Creates, updates, deletes, gets or lists a maintenance_window_targets resource.
Overview
| Name | maintenance_window_targets |
| Type | Resource |
| Id | aws.ssm.maintenance_window_targets |
Fields
The following fields are returned by SELECT queries:
- describe_maintenance_window_targets
| Name | Datatype | Description |
|---|---|---|
description | string | A description for the target. |
name | string | The name for the maintenance window target. (pattern: <code>^[a-zA-Z0-9_-.]{3,128}$</code>) |
owner_information | string | 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. |
resource_type | string | The type of target that is being registered with the maintenance window. (INSTANCE, RESOURCE_GROUP) |
targets | array | The 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_id | string | The ID of the maintenance window to register the target with. (pattern: <code>^mw-[0-9a-f]{17}$</code>) |
window_target_id | string | The 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:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_maintenance_window_targets | select | region | Lists the targets registered with the maintenance window. | |
update_maintenance_window_target | update | region, WindowId, WindowTargetId | 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. |
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.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- describe_maintenance_window_targets
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
- update_maintenance_window_target
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;