commands
Creates, updates, deletes, gets or lists a commands resource.
Overview
| Name | commands |
| Type | Resource |
| Id | aws.ssm.commands |
Fields
The following fields are returned by SELECT queries:
- list_commands
| Name | Datatype | Description |
|---|---|---|
alarm_configuration | object | The details for the CloudWatch alarm you want to apply to an automation or command. |
cloud_watch_output_config | object | Configuration options for sending command output to Amazon CloudWatch Logs. |
command_id | string | A unique identifier for this command. |
comment | string | User-specified information about the command, such as a brief description of what the command should do. |
completed_count | 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. |
delivery_timed_out_count | integer | The number of targets for which the status is Delivery Timed Out. |
document_name | string | The name of the document requested for execution. (pattern: <code>^[a-zA-Z0-9_-.]{3,128}$</code>) |
document_version | string | The Systems Manager document (SSM document) version. (pattern: <code>([$]LATEST|[$]DEFAULT|^[1-9][0-9]*$)</code>) |
error_count | integer | The number of targets for which the status is Failed or Execution Timed Out. |
expires_after | string (date-time) | 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 in the Amazon Web Services Systems Manager User Guide. |
instance_ids | array | The managed node IDs against which this command was requested. |
max_concurrency | 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 in the Amazon Web Services Systems Manager User Guide. (pattern: <code>^([1-9][0-9]*|[1-9][0-9]%|[1-9]%|100%)$</code>) |
max_errors | 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 in the Amazon Web Services Systems Manager User Guide. (pattern: <code>^([1-9][0-9]*|[0]|[1-9][0-9]%|[0-9]%|100%)$</code>) |
notification_config | object | Configurations for sending notifications about command status changes. |
output_s3_bucket_name | string | The S3 bucket where the responses to the command executions should be stored. This was requested when issuing the command. |
output_s3_key_prefix | 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. |
output_s3_region | 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. |
parameters | object | The parameter values to be inserted in the document when running the command. |
requested_date_time | string (date-time) | The date and time the command was requested. |
service_role | 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. |
status | string | The status of the command. (Pending, InProgress, Success, Cancelled, Failed, TimedOut, Cancelling) |
status_details | 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 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. |
target_count | integer | The number of targets for the command. |
targets | array | 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. |
timeout_seconds | integer | The TimeoutSeconds value specified for a command. |
triggered_alarms | array | The CloudWatch alarm that was invoked by the command. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_commands | select | region | Lists the commands requested by users of the Amazon Web Services account. |
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
- list_commands
Lists the commands requested by users of the Amazon Web Services account.
SELECT
alarm_configuration,
cloud_watch_output_config,
command_id,
comment,
completed_count,
delivery_timed_out_count,
document_name,
document_version,
error_count,
expires_after,
instance_ids,
max_concurrency,
max_errors,
notification_config,
output_s3_bucket_name,
output_s3_key_prefix,
output_s3_region,
parameters,
requested_date_time,
service_role,
status,
status_details,
target_count,
targets,
timeout_seconds,
triggered_alarms
FROM aws.ssm.commands
WHERE region = '{{ region }}' -- required
;