<a id="cli-aws-ssm-list-commands"></a>

# list-commands

## Description

Lists the commands requested by users of the Amazon Web Services account.

See also: [AWS API Documentation](https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/ListCommands)

`list-commands` is a paginated operation. Multiple API calls may be issued in order to retrieve the entire data set of results. You can disable pagination by providing the `--no-paginate` argument.
When using `--output text` and the `--query` argument on a paginated response, the `--query` argument must extract data from the results of the following query expressions: `Commands`

## Synopsis

```
  list-commands
[--command-id <value>]
[--instance-id <value>]
[--filters <value>]
[--starting-token <value>]
[--page-size <value>]
[--max-items <value>]
[--cli-input-json | --cli-input-yaml]
[--generate-cli-skeleton <value>]
[--debug]
[--endpoint-url <value>]
[--no-verify-ssl]
[--no-paginate]
[--output <value>]
[--query <value>]
[--profile <value>]
[--region <value>]
[--version <value>]
[--color <value>]
[--no-sign-request]
[--ca-bundle <value>]
[--cli-read-timeout <value>]
[--cli-connect-timeout <value>]
[--cli-binary-format <value>]
[--no-cli-pager]
[--cli-auto-prompt]
[--no-cli-auto-prompt]
[--cli-error-format <value>]
[--help]
```

## Options

`--command-id` (string)

> (Optional) If provided, lists only the specified command.

> Constraints:

> * min: `36`
> * max: `36`

`--instance-id` (string)

> (Optional) Lists commands issued against this managed node ID.

> #### NOTE
> You can’t specify a managed node ID in the same command that you specify `Status` = `Pending` . This is because the command hasn’t reached the managed node yet.

> Constraints:

> * pattern: `(^i-(\w{8}|\w{17})$)|(^mi-\w{17}$)`

`--filters` (list)

> (Optional) One or more filters. Use a filter to return a more specific list of results.

> Constraints:

> * min: `1`
> * max: `5`

> (structure)

> > Describes a command filter.

> > #### NOTE
> > A managed node ID can’t be specified when a command status is `Pending` because the command hasn’t run on the node yet.

> > key -> (string) [required]

> > > The name of the filter.

> > > #### NOTE
> > > The `ExecutionStage` filter can’t be used with the `ListCommandInvocations` operation, only with `ListCommands` .

> > > Possible values:

> > > * `InvokedAfter`
> > > * `InvokedBefore`
> > > * `Status`
> > > * `ExecutionStage`
> > > * `DocumentName`

> > value -> (string) [required]

> > > The filter value. Valid values for each filter key are as follows:

> > > * **InvokedAfter** : Specify a timestamp to limit your results. For example, specify `2024-07-07T00:00:00Z` to see a list of command executions occurring July 7, 2021, and later.
> > > * **InvokedBefore** : Specify a timestamp to limit your results. For example, specify `2024-07-07T00:00:00Z` to see a list of command executions from before July 7, 2021.
> > > * **Status** : Specify a valid command status to see a list of all command executions with that status. The status choices depend on the API you call. The status values you can specify for `ListCommands` are:
> > >   * `Pending`
> > >   * `InProgress`
> > >   * `Success`
> > >   * `Cancelled`
> > >   * `Failed`
> > >   * `TimedOut` (this includes both Delivery and Execution time outs)
> > >   * `AccessDenied`
> > >   * `DeliveryTimedOut`
> > >   * `ExecutionTimedOut`
> > >   * `Incomplete`
> > >   * `NoInstancesInTag`
> > >   * `LimitExceeded`

> > > The status values you can specify for `ListCommandInvocations` are:

> > > > * `Pending`
> > > > * `InProgress`
> > > > * `Delayed`
> > > > * `Success`
> > > > * `Cancelled`
> > > > * `Failed`
> > > > * `TimedOut` (this includes both Delivery and Execution time outs)
> > > > * `AccessDenied`
> > > > * `DeliveryTimedOut`
> > > > * `ExecutionTimedOut`
> > > > * `Undeliverable`
> > > > * `InvalidPlatform`
> > > > * `Terminated`
> > > * **DocumentName** : Specify name of the Amazon Web Services Systems Manager document (SSM document) for which you want to see command execution results. For example, specify `AWS-RunPatchBaseline` to see command executions that used this SSM document to perform security patching operations on managed nodes.
> > > * **ExecutionStage** : Specify one of the following values (`ListCommands` operations only):
> > >   * `Executing` : Returns a list of command executions that are currently still running.
> > >   * `Complete` : Returns a list of command executions that have already completed.

> > > Constraints:

> > > * min: `1`
> > > * max: `128`

Shorthand Syntax:

```
key=string,value=string ...
```

JSON Syntax:

```json
[
  {
    "key": "InvokedAfter"|"InvokedBefore"|"Status"|"ExecutionStage"|"DocumentName",
    "value": "string"
  }
  ...
]
```

`--starting-token` (string)

> A token to specify where to start paginating. This is the `NextToken` from a previously truncated response.

> For usage examples, see [Pagination](https://docs.aws.amazon.com/cli/latest/userguide/pagination.html) in the *AWS Command Line Interface User Guide* .

`--page-size` (integer)

> The size of each page to get in the AWS service call. This does not affect the number of items returned in the command’s output. Setting a smaller page size results in more calls to the AWS service, retrieving fewer items in each call. This can help prevent the AWS service calls from timing out.

> For usage examples, see [Pagination](https://docs.aws.amazon.com/cli/latest/userguide/pagination.html) in the *AWS Command Line Interface User Guide* .

> Constraints:

> * min: `1`
> * max: `50`

`--max-items` (integer)

> The total number of items to return in the command’s output. If the total number of items available is more than the value specified, a `NextToken` is provided in the command’s output. To resume pagination, provide the `NextToken` value in the `starting-token` argument of a subsequent command. **Do not** use the `NextToken` response element directly outside of the AWS CLI.

> For usage examples, see [Pagination](https://docs.aws.amazon.com/cli/latest/userguide/pagination.html) in the *AWS Command Line Interface User Guide* .

`--cli-input-json` | `--cli-input-yaml` (string)
Reads arguments from the JSON string provided. The JSON string follows the format provided by `--generate-cli-skeleton`. If other arguments are provided on the command line, those values will override the JSON-provided values. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally. This may not be specified along with `--cli-input-yaml`.

`--generate-cli-skeleton` (string)
Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value `input`, prints a sample input JSON that can be used as an argument for `--cli-input-json`. Similarly, if provided `yaml-input` it will print a sample input YAML that can be used with `--cli-input-yaml`. If provided with the value `output`, it validates the command inputs and returns a sample output JSON for that command. The generated JSON skeleton is not stable between versions of the AWS CLI and there are no backwards compatibility guarantees in the JSON skeleton generated.

## Global Options

`--debug` (boolean)

Turn on debug logging.

`--endpoint-url` (string)

Override command’s default URL with the given URL.

`--no-verify-ssl` (boolean)

By default, the AWS CLI uses SSL when communicating with AWS services. For each SSL connection, the AWS CLI will verify SSL certificates. This option overrides the default behavior of verifying SSL certificates.

`--no-paginate` (boolean)

Disable automatic pagination. If automatic pagination is disabled, the AWS CLI will only make one call, for the first page of results.

`--output` (string)

The formatting style for command output.

* json
* text
* table
* yaml
* yaml-stream
* off

`--query` (string)

A JMESPath query to use in filtering the response data.

`--profile` (string)

Use a specific profile from your credential file.

`--region` (string)

The region to use. Overrides config/env settings.

`--version` (string)

Display the version of this tool.

`--color` (string)

Turn on/off color output.

* on
* off
* auto

`--no-sign-request` (boolean)

Do not sign requests. Credentials will not be loaded if this argument is provided.

`--ca-bundle` (string)

The CA certificate bundle to use when verifying SSL certificates. Overrides config/env settings.

`--cli-read-timeout` (int)

The maximum socket read time in seconds. If the value is set to 0, the socket read will be blocking and not timeout. The default value is 60 seconds.

`--cli-connect-timeout` (int)

The maximum socket connect time in seconds. If the value is set to 0, the socket connect will be blocking and not timeout. The default value is 60 seconds.

`--cli-binary-format` (string)

The formatting style to be used for binary blobs. The default format is base64. The base64 format expects binary blobs to be provided as a base64 encoded string. The raw-in-base64-out format preserves compatibility with AWS CLI V1 behavior and binary values must be passed literally. When providing contents from a file that map to a binary blob `fileb://` will always be treated as binary and use the file contents directly regardless of the `cli-binary-format` setting. When using `file://` the file contents will need to properly formatted for the configured `cli-binary-format`.

* base64
* raw-in-base64-out

`--no-cli-pager` (boolean)

Disable cli pager for output.

`--cli-auto-prompt` (boolean)

Automatically prompt for CLI input parameters.

`--no-cli-auto-prompt` (boolean)

Disable automatically prompt for CLI input parameters.

`--cli-error-format` (string)

The formatting style for error output. By default, errors are displayed in enhanced format.

* legacy
* json
* yaml
* text
* table
* enhanced

`--help` (boolean)

Display help for the command/subcommand.

## Examples

#### NOTE
To use the following examples, you must have the AWS CLI installed and configured. See the [Getting started guide](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html) in the *AWS CLI User Guide* for more information.

Unless otherwise stated, all examples have unix-like quotation rules. These examples will need to be adapted to your terminal’s quoting rules. See [Using quotation marks with strings](https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-quoting-strings.html) in the *AWS CLI User Guide* .

**Example 1: To get the status of a specific command**

The following `list-commands` example retrieves and displays the status of the specified command.

```bash
aws ssm list-commands \
    --command-id "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111"
```

Output:

```json
{
    "Commands": [
        {
            "CommandId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111",
            "DocumentName": "AWS-RunShellScript",
            "DocumentVersion": "1",
            "Comment": "",
            "ExpiresAfter": "2020-02-19T12:28:02.500000-08:00",
            "Parameters": {
                "commands": [
                    "ifconfig"
                ]
            },
            "InstanceIds": [
                "i-028ea792daEXAMPLE"
            ],
            "Targets": [],
            "RequestedDateTime": "2020-02-19T11:18:02.500000-08:00",
            "Status": "Success",
            "StatusDetails": "Success",
            "OutputS3BucketName": "",
            "OutputS3KeyPrefix": "",
            "MaxConcurrency": "50",
            "MaxErrors": "0",
            "TargetCount": 1,
            "CompletedCount": 1,
            "ErrorCount": 0,
            "DeliveryTimedOutCount": 0,
            "ServiceRole": "",
            "NotificationConfig": {
                "NotificationArn": "",
                "NotificationEvents": [],
                "NotificationType": ""
            },
            "CloudWatchOutputConfig": {
                "CloudWatchLogGroupName": "",
                "CloudWatchOutputEnabled": false
            },
            "TimeoutSeconds": 3600
        }
    ]
}
```

**Example 2: To get the status of commands requested after a specific date**

The following `list-commands` example retrieves the details of commands requested after the specified date.

```bash
aws ssm list-commands \
    --filters "key=InvokedAfter,value=2020-02-01T00:00:00Z"
```

Output:

```json
{
    "Commands": [
        {
            "CommandId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE22222",
            "DocumentName": "AWS-UpdateSSMAgent",
            "DocumentVersion": "",
            "Comment": "a1b2c3d4-5678-90ab-cdef-EXAMPLE33333:a1b2c3d4-5678-90ab-cdef-EXAMPLE44444",
            "ExpiresAfter": "2020-02-19T11:28:02.500000-08:00",
            "Parameters": {},
            "InstanceIds": [
                "i-028ea792daEXAMPLE",
                "i-02feef8c46EXAMPLE",
                "i-038613f3f0EXAMPLE",
                "i-03a530a2d4EXAMPLE",
                "i-083b678d37EXAMPLE",
                "i-0dee81debaEXAMPLE"
            ],
            "Targets": [],
            "RequestedDateTime": "2020-02-19T10:18:02.500000-08:00",
            "Status": "Success",
            "StatusDetails": "Success",
            "OutputS3BucketName": "",
            "OutputS3KeyPrefix": "",
            "MaxConcurrency": "50",
            "MaxErrors": "100%",
            "TargetCount": 6,
            "CompletedCount": 6,
            "ErrorCount": 0,
            "DeliveryTimedOutCount": 0,
            "ServiceRole": "",
            "NotificationConfig": {
                "NotificationArn": "",
                "NotificationEvents": [],
                "NotificationType": ""
            },
            "CloudWatchOutputConfig": {
                "CloudWatchLogGroupName": "",
                "CloudWatchOutputEnabled": false
            }
        }
    ]
}
```

**Example 3: To list all commands requested in an AWS account**

The following `list-commands` example lists all commands requested by users in the current AWS account and Region.

```bash
aws ssm list-commands
```

Output:

```json
{
    "Commands": [
        {
            "CommandId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE22222",
            "DocumentName": "AWS-UpdateSSMAgent",
            "DocumentVersion": "",
            "Comment": "a1b2c3d4-5678-90ab-cdef-EXAMPLE33333:a1b2c3d4-5678-90ab-cdef-EXAMPLE44444",
            "ExpiresAfter": "2020-02-19T11:28:02.500000-08:00",
            "Parameters": {},
            "InstanceIds": [
                "i-028ea792daEXAMPLE",
                "i-02feef8c46EXAMPLE",
                "i-038613f3f0EXAMPLE",
                "i-03a530a2d4EXAMPLE",
                "i-083b678d37EXAMPLE",
                "i-0dee81debaEXAMPLE"
            ],
            "Targets": [],
            "RequestedDateTime": "2020-02-19T10:18:02.500000-08:00",
            "Status": "Success",
            "StatusDetails": "Success",
            "OutputS3BucketName": "",
            "OutputS3KeyPrefix": "",
            "MaxConcurrency": "50",
            "MaxErrors": "100%",
            "TargetCount": 6,
            "CompletedCount": 6,
            "ErrorCount": 0,
            "DeliveryTimedOutCount": 0,
            "ServiceRole": "",
            "NotificationConfig": {
                "NotificationArn": "",
                "NotificationEvents": [],
                "NotificationType": ""
            },
            "CloudWatchOutputConfig": {
                "CloudWatchLogGroupName": "",
                "CloudWatchOutputEnabled": false
            }
        },
        {
            "CommandId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE55555",
            "DocumentName": "AWS-FindWindowsUpdates",
            "DocumentVersion": "1",
            "Comment": "",
            "ExpiresAfter": "2020-01-24T12:37:31.874000-08:00",
            "Parameters": {
                "KbArticleIds": [
                    ""
                ],
                "UpdateLevel": [
                    "All"
                ]
            },
            "InstanceIds": [],
            "Targets": [
                {
                    "Key": "InstanceIds",
                    "Values": [
                        "i-00ec29b21eEXAMPLE",
                        "i-09911ddd90EXAMPLE"
                    ]
                }
            ],
            "RequestedDateTime": "2020-01-24T11:27:31.874000-08:00",
            "Status": "Success",
            "StatusDetails": "Success",
            "OutputS3BucketName": "my-us-east-2-bucket",
            "OutputS3KeyPrefix": "my-rc-output",
            "MaxConcurrency": "50",
            "MaxErrors": "0",
            "TargetCount": 2,
            "CompletedCount": 2,
            "ErrorCount": 0,
            "DeliveryTimedOutCount": 0,
            "ServiceRole": "arn:aws:iam::123456789012:role/aws-service-role/ssm.amazonaws.com/AWSServiceRoleForAmazonSSM",
            "NotificationConfig": {
                "NotificationArn": "arn:aws:sns:us-west-2:123456789012:my-us-east-2-notification-arn",
                "NotificationEvents": [
                    "All"
                ],
                "NotificationType": "Invocation"
            },
            "CloudWatchOutputConfig": {
                "CloudWatchLogGroupName": "",
                "CloudWatchOutputEnabled": false
            }
        },
        {
            "CommandId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE66666",
            "DocumentName": "AWS-RunPatchBaseline",
            "DocumentVersion": "1",
            "Comment": "",
            "ExpiresAfter": "2020-01-24T12:21:04.350000-08:00",
            "Parameters": {
                "InstallOverrideList": [
                    ""
                ],
                "Operation": [
                    "Install"
                ],
                "RebootOption": [
                    "RebootIfNeeded"
                ],
                "SnapshotId": [
                    ""
                ]
            },
            "InstanceIds": [],
            "Targets": [
                {
                    "Key": "InstanceIds",
                    "Values": [
                        "i-00ec29b21eEXAMPLE",
                        "i-09911ddd90EXAMPLE"
                    ]
                }
            ],
            "RequestedDateTime": "2020-01-24T11:11:04.350000-08:00",
            "Status": "Success",
            "StatusDetails": "Success",
            "OutputS3BucketName": "my-us-east-2-bucket",
            "OutputS3KeyPrefix": "my-rc-output",
            "MaxConcurrency": "50",
            "MaxErrors": "0",
            "TargetCount": 2,
            "CompletedCount": 2,
            "ErrorCount": 0,
            "DeliveryTimedOutCount": 0,
            "ServiceRole": "arn:aws:iam::123456789012:role/aws-service-role/ssm.amazonaws.com/AWSServiceRoleForAmazonSSM",
            "NotificationConfig": {
                "NotificationArn": "arn:aws:sns:us-west-2:123456789012:my-us-east-2-notification-arn",
                "NotificationEvents": [
                    "All"
                ],
                "NotificationType": "Invocation"
            },
            "CloudWatchOutputConfig": {
                "CloudWatchLogGroupName": "",
                "CloudWatchOutputEnabled": false
            }
        }
    ]
}
```

For more information, see [Running Commands Using Systems Manager Run Command](https://docs.aws.amazon.com/systems-manager/latest/userguide/run-command.html) in the *AWS Systems Manager User Guide*.

## Output

Commands -> (list)

> (Optional) The list of commands requested by the user.

> (structure)

> > Describes a command request.

> > CommandId -> (string)

> > > A unique identifier for this command.

> > > Constraints:

> > > * min: `36`
> > > * max: `36`

> > DocumentName -> (string)

> > > The name of the document requested for execution.

> > > Constraints:

> > > * pattern: `^[a-zA-Z0-9_\-.]{3,128}$`

> > DocumentVersion -> (string)

> > > The Systems Manager document (SSM document) version.

> > > Constraints:

> > > * pattern: `([$]LATEST|[$]DEFAULT|^[1-9][0-9]*$)`

> > Comment -> (string)

> > > User-specified information about the command, such as a brief description of what the command should do.

> > > Constraints:

> > > * max: `100`

> > ExpiresAfter -> (timestamp)

> > > If a command expires, it changes status to `DeliveryTimedOut` for all invocations that have the status `InProgress` , `Pending` , or `Delayed` . `ExpiresAfter` is calculated based on the total timeout for the overall command. For more information, see [Understanding command timeout values](https://docs.aws.amazon.com/systems-manager/latest/userguide/monitor-commands.html?icmpid=docs_ec2_console#monitor-about-status-timeouts) in the *Amazon Web Services Systems Manager User Guide* .

> > Parameters -> (map)

> > > The parameter values to be inserted in the document when running the command.

> > > key -> (string)

> > > value -> (list)

> > > > (string)

> > InstanceIds -> (list)

> > > The managed node IDs against which this command was requested.

> > > Constraints:

> > > * min: `0`
> > > * max: `50`

> > > (string)

> > > > Constraints:

> > > > * pattern: `(^i-(\w{8}|\w{17})$)|(^mi-\w{17}$)`

> > Targets -> (list)

> > > An array of search criteria that targets managed nodes using a Key,Value combination that you specify. Targets is required if you don’t provide one or more managed node IDs in the call.

> > > Constraints:

> > > * min: `0`
> > > * max: `5`

> > > (structure)

> > > > An array of search criteria that targets managed nodes using a key-value pair that you specify.

> > > > #### NOTE
> > > > One or more targets must be specified for maintenance window Run Command-type tasks. Depending on the task, targets are optional for other maintenance window task types (Automation, Lambda, and Step Functions). For more information about running tasks that don’t specify targets, see [Registering maintenance window tasks without targets](https://docs.aws.amazon.com/systems-manager/latest/userguide/maintenance-windows-targetless-tasks.html) in the *Amazon Web Services Systems Manager User Guide* .

> > > > Supported formats include the following.

> > > > > **For all Systems Manager tools:**
> > > > * `Key=tag-key,Values=tag-value-1,tag-value-2`

> > > > > **For Automation and Change Manager:**
> > > > * `Key=tag:tag-key,Values=tag-value`
> > > > * `Key=ResourceGroup,Values=resource-group-name`
> > > > * `Key=ParameterValues,Values=value-1,value-2,value-3`
> > > > * To target all instances in the Amazon Web Services Region:
> > > >   * `Key=AWS::EC2::Instance,Values=*`
> > > >   * `Key=InstanceIds,Values=*`
> > > > * Automation only, to target Microsoft Azure or Google Cloud Platform (GCP) resources:
> > > >   * `Key=CloudConnector,Values=cloud-connector-id`
> > > >   * `Key=CloudConnector,Values={"CloudConnectorId":"cloud-connector-id","SsmManagedNodeFilter":"MANAGED","CloudProviderRegions":["eastus"]}`

> > > > Instead of `CloudConnector` , you can use `AzureCloudConnector` or `GcpCloudConnector` for a cloud connector to that provider. You must specify exactly one value. A cloud connector ID alone targets every running virtual machine (VM) in the cloud connector’s scope. In the JSON value, `CloudConnectorId` is required, and the following optional keys narrow that scope:

> > > > > * For both providers: `SsmManagedNodeFilter` , which filters VMs by whether they are Systems Manager managed nodes.
> > > > > * For Microsoft Azure: `CloudProviderRegions` , `AzureSubscriptions` , `AzureResourceGroups` , `AzureTag` , `AzureVmPowerStates` , and `AzureResourceType` .
> > > > > * For GCP: `Zones` , `GcpProjects` , `IncludesLabels` , `ExcludesLabels` , `GcpInstanceStates` , `OsPolicyComplianceFilter` , `OsPolicyOrchestratorName` , `OsPolicyOrchestratorId` , and `GcpAssetType` .

> > > > For descriptions, valid values, and defaults of these keys, see [Cloud Connector target reference](https://docs.aws.amazon.com/systems-manager/latest/userguide/automation-cloud-connector-target.html) in the *Amazon Web Services Systems Manager User Guide* .

> > > > > **For Run Command and Maintenance Windows:**
> > > > * `Key=InstanceIds,Values=instance-id-1,instance-id-2,instance-id-3`
> > > > * `Key=tag:tag-key,Values=tag-value-1,tag-value-2`
> > > > * `Key=resource-groups:Name,Values=resource-group-name`
> > > > * Additionally, Maintenance Windows support targeting resource types:
> > > >   * `Key=resource-groups:ResourceTypeFilters,Values=resource-type-1,resource-type-2`

> > > > > **For State Manager:**
> > > > * `Key=InstanceIds,Values=instance-id-1,instance-id-2,instance-id-3`
> > > > * `Key=tag:tag-key,Values=tag-value-1,tag-value-2`
> > > > * To target all instances in the Amazon Web Services Region:
> > > >   * `Key=InstanceIds,Values=*`
> > > > * For associations that run an Automation runbook, to target Microsoft Azure or Google Cloud Platform (GCP) resources:
> > > >   * `Key=CloudConnector,Values=cloud-connector-id`
> > > >   * `Key=CloudConnector,Values={"CloudConnectorId":"cloud-connector-id","SsmManagedNodeFilter":"UNMANAGED"}`

> > > > Supported JSON keys: `CloudConnectorId` (required), `SsmManagedNodeFilter` , and `CloudProviderRegions` .

> > > > For more information about how to send commands that target managed nodes using `Key,Value` parameters, see [Targeting multiple managed nodes](https://docs.aws.amazon.com/systems-manager/latest/userguide/send-commands-multiple.html#send-commands-targeting) in the *Amazon Web Services Systems Manager User Guide* .

> > > > Key -> (string)

> > > > > User-defined criteria for sending commands that target managed nodes that meet the criteria.

> > > > > Constraints:

> > > > > * min: `1`
> > > > > * max: `163`
> > > > > * pattern: `^[\p{L}\p{Z}\p{N}_.:/=\-@]*$|resource-groups:ResourceTypeFilters|resource-groups:Name`

> > > > Values -> (list)

> > > > > User-defined criteria that maps to `Key` . For example, if you specified `tag:ServerRole` , you could specify `value:WebServer` to run a command on instances that include EC2 tags of `ServerRole,WebServer` .

> > > > > Depending on the type of target, the maximum number of values for a key might be lower than the global maximum of 50.

> > > > > Constraints:

> > > > > * min: `0`
> > > > > * max: `50`

> > > > > (string)

> > RequestedDateTime -> (timestamp)

> > > The date and time the command was requested.

> > Status -> (string)

> > > The status of the command.

> > > Possible values:

> > > * `Pending`
> > > * `InProgress`
> > > * `Success`
> > > * `Cancelled`
> > > * `Failed`
> > > * `TimedOut`
> > > * `Cancelling`

> > StatusDetails -> (string)

> > > A detailed status of the command execution. `StatusDetails` includes more information than `Status` because it includes states resulting from error and concurrency control parameters. `StatusDetails` can show different results than Status. For more information about these statuses, see [Understanding command statuses](https://docs.aws.amazon.com/systems-manager/latest/userguide/monitor-commands.html) in the *Amazon Web Services Systems Manager User Guide* . StatusDetails can be one of the following values:

> > > * Pending: The command hasn’t been sent to any managed nodes.
> > > * In Progress: The command has been sent to at least one managed node but hasn’t reached a final state on all managed nodes.
> > > * Success: The command successfully ran on all invocations. This is a terminal state.
> > > * Delivery Timed Out: The value of MaxErrors or more command invocations shows a status of Delivery Timed Out. This is a terminal state.
> > > * Execution Timed Out: The value of MaxErrors or more command invocations shows a status of Execution Timed Out. This is a terminal state.
> > > * Failed: The value of MaxErrors or more command invocations shows a status of Failed. This is a terminal state.
> > > * Incomplete: The command was attempted on all managed nodes and one or more invocations doesn’t have a value of Success but not enough invocations failed for the status to be Failed. This is a terminal state.
> > > * Cancelled: The command was terminated before it was completed. This is a terminal state.
> > > * Rate Exceeded: The number of managed nodes targeted by the command exceeded the account limit for pending invocations. The system has canceled the command before running it on any managed node. This is a terminal state.
> > > * Delayed: The system attempted to send the command to the managed node but wasn’t successful. The system retries again.

> > > Constraints:

> > > * min: `0`
> > > * max: `100`

> > OutputS3Region -> (string)

> > > (Deprecated) You can no longer specify this parameter. The system ignores it. Instead, Systems Manager automatically determines the Amazon Web Services Region of the S3 bucket.

> > > Constraints:

> > > * min: `3`
> > > * max: `20`

> > OutputS3BucketName -> (string)

> > > The S3 bucket where the responses to the command executions should be stored. This was requested when issuing the command.

> > > Constraints:

> > > * min: `3`
> > > * max: `63`

> > OutputS3KeyPrefix -> (string)

> > > The S3 directory path inside the bucket where the responses to the command executions should be stored. This was requested when issuing the command.

> > > Constraints:

> > > * max: `500`

> > MaxConcurrency -> (string)

> > > The maximum number of managed nodes that are allowed to run the command at the same time. You can specify a number of managed nodes, such as 10, or a percentage of nodes, such as 10%. The default value is 50. For more information about how to use `MaxConcurrency` , see [Amazon Web Services Systems Manager Run Command](https://docs.aws.amazon.com/systems-manager/latest/userguide/run-command.html) in the *Amazon Web Services Systems Manager User Guide* .

> > > Constraints:

> > > * min: `1`
> > > * max: `7`
> > > * pattern: `^([1-9][0-9]*|[1-9][0-9]%|[1-9]%|100%)$`

> > MaxErrors -> (string)

> > > The maximum number of errors allowed before the system stops sending the command to additional targets. You can specify a number of errors, such as 10, or a percentage or errors, such as 10%. The default value is `0` . For more information about how to use `MaxErrors` , see [Amazon Web Services Systems Manager Run Command](https://docs.aws.amazon.com/systems-manager/latest/userguide/run-command.html) in the *Amazon Web Services Systems Manager User Guide* .

> > > Constraints:

> > > * min: `1`
> > > * max: `7`
> > > * pattern: `^([1-9][0-9]*|[0]|[1-9][0-9]%|[0-9]%|100%)$`

> > TargetCount -> (integer)

> > > The number of targets for the command.

> > CompletedCount -> (integer)

> > > The number of targets for which the command invocation reached a terminal state. Terminal states include the following: Success, Failed, Execution Timed Out, Delivery Timed Out, Cancelled, Terminated, or Undeliverable.

> > ErrorCount -> (integer)

> > > The number of targets for which the status is Failed or Execution Timed Out.

> > DeliveryTimedOutCount -> (integer)

> > > The number of targets for which the status is Delivery Timed Out.

> > ServiceRole -> (string)

> > > The Identity and Access Management (IAM) service role that Run Command, a tool in Amazon Web Services Systems Manager, uses to act on your behalf when sending notifications about command status changes.

> > NotificationConfig -> (structure)

> > > Configurations for sending notifications about command status changes.

> > > NotificationArn -> (string)

> > > > An Amazon Resource Name (ARN) for an Amazon Simple Notification Service (Amazon SNS) topic. Run Command pushes notifications about command status changes to this topic.

> > > NotificationEvents -> (list)

> > > > The different events for which you can receive notifications. To learn more about these events, see [Monitoring Systems Manager status changes using Amazon SNS notifications](https://docs.aws.amazon.com/systems-manager/latest/userguide/monitoring-sns-notifications.html) in the *Amazon Web Services Systems Manager User Guide* .

> > > > (string)

> > > > > Possible values:

> > > > > * `All`
> > > > > * `InProgress`
> > > > > * `Success`
> > > > > * `TimedOut`
> > > > > * `Cancelled`
> > > > > * `Failed`

> > > NotificationType -> (string)

> > > > The type of notification.

> > > > * `Command` : Receive notification when the status of a command changes.
> > > > * `Invocation` : For commands sent to multiple managed nodes, receive notification on a per-node basis when the status of a command changes.

> > > > Possible values:

> > > > * `Command`
> > > > * `Invocation`

> > CloudWatchOutputConfig -> (structure)

> > > Amazon CloudWatch Logs information where you want Amazon Web Services Systems Manager to send the command output.

> > > CloudWatchLogGroupName -> (string)

> > > > The name of the CloudWatch Logs log group where you want to send command output. If you don’t specify a group name, Amazon Web Services Systems Manager automatically creates a log group for you. The log group uses the following naming format:

> > > > > \`\`aws/ssm/*SystemsManagerDocumentName* \`\`

> > > > Constraints:

> > > > * min: `1`
> > > > * max: `512`

> > > CloudWatchOutputEnabled -> (boolean)

> > > > Enables Systems Manager to send command output to CloudWatch Logs.

> > TimeoutSeconds -> (integer)

> > > The `TimeoutSeconds` value specified for a command.

> > > Constraints:

> > > * min: `30`
> > > * max: `2592000`

> > AlarmConfiguration -> (structure)

> > > The details for the CloudWatch alarm applied to your command.

> > > IgnorePollAlarmFailure -> (boolean)

> > > > When this value is *true* , your automation or command continues to run in cases where we can’t retrieve alarm status information from CloudWatch. In cases where we successfully retrieve an alarm status of OK or INSUFFICIENT_DATA, the automation or command continues to run, regardless of this value. Default is *false* .

> > > Alarms -> (list) [required]

> > > > The name of the CloudWatch alarm specified in the configuration.

> > > > Constraints:

> > > > * min: `1`
> > > > * max: `1`

> > > > (structure)

> > > > > A CloudWatch alarm you apply to an automation or command.

> > > > > Name -> (string) [required]

> > > > > > The name of your CloudWatch alarm.

> > > > > > Constraints:

> > > > > > * min: `1`
> > > > > > * max: `255`
> > > > > > * pattern: `^(?!\s*$).+`

> > TriggeredAlarms -> (list)

> > > The CloudWatch alarm that was invoked by the command.

> > > Constraints:

> > > * min: `1`
> > > * max: `1`

> > > (structure)

> > > > The details about the state of your CloudWatch alarm.

> > > > Name -> (string) [required]

> > > > > The name of your CloudWatch alarm.

> > > > > Constraints:

> > > > > * min: `1`
> > > > > * max: `255`
> > > > > * pattern: `^(?!\s*$).+`

> > > > State -> (string) [required]

> > > > > The state of your CloudWatch alarm.

> > > > > Possible values:

> > > > > * `UNKNOWN`
> > > > > * `ALARM`

NextToken -> (string)

> (Optional) The token for the next set of items to return. (You received this token from a previous call.)
