aws ssm describe-maintenance-window-targets
Lists the targets registered with the maintenance window. AWS CLI reference
2 examples 4 options Its page in the AWS CLI reference
Examples
Example 1: To list all targets for a Maintenance Window
The following describe-maintenance-window-targets example lists all of the targets for a maintenance window.
aws ssm describe-maintenance-window-targets --window-id "mw-06cf17cbefEXAMPLE"Identify--window-idThe ID of the maintenance window whose targets should be retrieved.Its output, shortened
{
"Targets": [
{
"ResourceType": "INSTANCE",
"OwnerInformation": "Single instance",
"WindowId": "mw-06cf17cbefEXAMPLE",
"Targets": [
{
"Values": [
"i-0000293ffdEXAMPLE"
],
"Key": "InstanceIds"
}
],
"WindowTargetId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111"
},
{
"ResourceType": "INSTANCE",
"OwnerInformation": "Two instances in a list",
"WindowId": "mw-06cf17cbefEXAMPLE",
"Targets": [
{
"Values": [
"i-0000293ffdEXAMPLE",
"i-0cb2b964d3EXAMPLE"
],
"Key": "InstanceIds"
}
],
"WindowTargetId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE22222"
… 3 more linesExample 2: To list all targets for a maintenance window matching a specific owner information value
The following describe-maintenance-window-targets example lists all of the targets for a maintenance window with a specific value.
aws ssm describe-maintenance-window-targets --window-id "mw-0ecb1226ddEXAMPLE" --filters "Key=OwnerInformation,Values=CostCenter1"Identify--window-idThe ID of the maintenance window whose targets should be retrieved.--filtersOptional filters that can be used to narrow down the scope of the returned window targets.Its output
{
"Targets": [
{
"WindowId": "mw-0ecb1226ddEXAMPLE",
"WindowTargetId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE33333",
"ResourceType": "INSTANCE",
"Targets": [
{
"Key": "tag:Environment",
"Values": [
"Prod"
]
}
],
"OwnerInformation": "CostCenter1",
"Name": "ProdTarget1"
}
]
}For more information, see View Information About Maintenance Windows (AWS CLI) in the AWS Systems Manager User Guide.
Options
--filtersOptional filters that can be used to narrow down the scope of the returned window targets.--max-resultsThe maximum number of items to return for this call.--next-tokenThe token for the next set of items to return.--window-idThe ID of the maintenance window whose targets should be retrieved.