Skip to main content

commands

Creates, updates, deletes or gets a command resource or lists commands in a region

Overview

Namecommands
TypeResource
DescriptionRepresents the resource definition of AWS IoT Command.
Idawscc.iot.commands

Fields

NameDatatypeDescription
command_arnstringThe Amazon Resource Name (ARN) of the command.
command_idstringThe unique identifier for the command.
created_atstringThe date and time when the command was created.
deprecatedbooleanA flag indicating whether the command is deprecated.
descriptionstringThe description of the command.
display_namestringThe display name for the command.
last_updated_atstringThe date and time when the command was last updated.
mandatory_parametersarrayThe list of mandatory parameters for the command.
namespacestringThe namespace to which the command belongs.
role_arnstringThe customer role associated with the command.
payloadobjectThe payload associated with the command.
pending_deletionbooleanA flag indicating whether the command is pending deletion.
tagsarrayThe tags to be associated with the command.
regionstringAWS region.

For more information, see AWS::IoT::Command.

Methods

NameResourceAccessible byRequired Params
create_resourcecommandsINSERTCommandId, region
delete_resourcecommandsDELETEIdentifier, region
update_resourcecommandsUPDATEIdentifier, PatchDocument, region
list_resourcescommands_list_onlySELECTregion
get_resourcecommandsSELECTIdentifier, region

SELECT examples

Gets all properties from an individual command.

SELECT
region,
command_arn,
command_id,
created_at,
deprecated,
description,
display_name,
last_updated_at,
mandatory_parameters,
namespace,
role_arn,
payload,
pending_deletion,
tags
FROM awscc.iot.commands
WHERE
region = '{{ region }}' AND
Identifier = '{{ command_id }}';

INSERT example

Use the following StackQL query and manifest file to create a new command resource, using stack-deploy.

/*+ create */
INSERT INTO awscc.iot.commands (
CommandId,
region
)
SELECT
'{{ command_id }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

UPDATE example

Use the following StackQL query and manifest file to update a command resource, using stack-deploy.

/*+ update */
UPDATE awscc.iot.commands
SET PatchDocument = string('{{ {
"CreatedAt": created_at,
"Deprecated": deprecated,
"Description": description,
"DisplayName": display_name,
"LastUpdatedAt": last_updated_at,
"MandatoryParameters": mandatory_parameters,
"Namespace": namespace,
"RoleArn": role_arn,
"Payload": payload,
"PendingDeletion": pending_deletion,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ command_id }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

DELETE example

/*+ delete */
DELETE FROM awscc.iot.commands
WHERE
Identifier = '{{ command_id }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

Additional Parameters

Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:

ParameterDescription
ClientToken
A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.
A client token is valid for 36 hours once used.
After that, a resource request with the same client token is treated as a new request.
If you do not specify a client token, one is generated for inclusion in the request.
RoleArn
The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.
If you do not specify a role, a temporary session is created using your AWS user credentials.
TypeVersionId
For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used.

Permissions

To operate on the commands resource, the following permissions are required:

iam:PassRole,
iot:CreateCommand,
iot:TagResource