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.
Idaws.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

NameAccessible byRequired Params
create_resourceINSERTCommandId, region
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__Identifier, region

SELECT examples

Gets all commands in a region.

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 aws.iot.commands
WHERE region = 'us-east-1';

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 aws.iot.commands
WHERE region = 'us-east-1' AND data__Identifier = '<CommandId>';

INSERT example

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

/*+ create */
INSERT INTO aws.iot.commands (
CommandId,
region
)
SELECT
'{{ CommandId }}',
'{{ region }}';

DELETE example

/*+ delete */
DELETE FROM aws.iot.commands
WHERE data__Identifier = '<CommandId>'
AND region = 'us-east-1';

Permissions

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

Create

iam:PassRole,
iot:CreateCommand,
iot:TagResource

Read

iot:GetCommand,
iot:ListTagsForResource

Update

iam:PassRole,
iot:UpdateCommand,
iot:GetCommand,
iot:TagResource,
iot:UntagResource,
iot:ListTagsForResource

Delete

iot:GetCommand,
iot:UpdateCommand,
iot:DeleteCommand

List

iot:ListCommands