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 = 'us-east-1' 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 }}';

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 }}';

DELETE example

/*+ delete */
DELETE FROM awscc.iot.commands
WHERE
Identifier = '{{ command_id }}' AND
region = 'us-east-1';

Permissions

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

iam:PassRole,
iot:CreateCommand,
iot:TagResource