commands
Creates, updates, deletes or gets a command resource or lists commands in a region
Overview
| Name | commands |
| Type | Resource |
| Description | Represents the resource definition of AWS IoT Command. |
| Id | awscc.iot.commands |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
command_arn | string | The Amazon Resource Name (ARN) of the command. |
command_id | string | The unique identifier for the command. |
created_at | string | The date and time when the command was created. |
deprecated | boolean | A flag indicating whether the command is deprecated. |
description | string | The description of the command. |
display_name | string | The display name for the command. |
last_updated_at | string | The date and time when the command was last updated. |
mandatory_parameters | array | The list of mandatory parameters for the command. |
namespace | string | The namespace to which the command belongs. |
role_arn | string | The customer role associated with the command. |
payload | object | The payload associated with the command. |
pending_deletion | boolean | A flag indicating whether the command is pending deletion. |
tags | array | The tags to be associated with the command. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
command_id | string | The unique identifier for the command. |
region | string | AWS region. |
For more information, see AWS::IoT::Command.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | commands | INSERT | CommandId, region |
delete_resource | commands | DELETE | Identifier, region |
update_resource | commands | UPDATE | Identifier, PatchDocument, region |
list_resources | commands_list_only | SELECT | region |
get_resource | commands | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
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 }}';
Lists all commands in a region.
SELECT
region,
command_id
FROM awscc.iot.commands_list_only
WHERE
region = 'us-east-1';
INSERT example
Use the following StackQL query and manifest file to create a new command resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.iot.commands (
CommandId,
region
)
SELECT
'{{ command_id }}',
'{{ region }}';
/*+ create */
INSERT INTO awscc.iot.commands (
CommandId,
CreatedAt,
Deprecated,
Description,
DisplayName,
LastUpdatedAt,
MandatoryParameters,
Namespace,
RoleArn,
Payload,
PendingDeletion,
Tags,
region
)
SELECT
'{{ command_id }}',
'{{ created_at }}',
'{{ deprecated }}',
'{{ description }}',
'{{ display_name }}',
'{{ last_updated_at }}',
'{{ mandatory_parameters }}',
'{{ namespace }}',
'{{ role_arn }}',
'{{ payload }}',
'{{ pending_deletion }}',
'{{ tags }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: command
props:
- name: command_id
value: '{{ command_id }}'
- name: created_at
value: '{{ created_at }}'
- name: deprecated
value: '{{ deprecated }}'
- name: description
value: '{{ description }}'
- name: display_name
value: '{{ display_name }}'
- name: last_updated_at
value: '{{ last_updated_at }}'
- name: mandatory_parameters
value:
- name: '{{ name }}'
value:
s: '{{ s }}'
b: '{{ b }}'
i: '{{ i }}'
l: '{{ l }}'
d: null
b_in: '{{ b_in }}'
u_l: '{{ u_l }}'
default_value: null
description: '{{ description }}'
- name: namespace
value: '{{ namespace }}'
- name: role_arn
value: '{{ role_arn }}'
- name: payload
value:
content: '{{ content }}'
content_type: '{{ content_type }}'
- name: pending_deletion
value: '{{ pending_deletion }}'
- name: tags
value:
- key: '{{ key }}'
value: '{{ value }}'
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:
- Create
- Read
- Update
- Delete
- List
iam:PassRole,
iot:CreateCommand,
iot:TagResource
iot:GetCommand,
iot:ListTagsForResource
iam:PassRole,
iot:UpdateCommand,
iot:GetCommand,
iot:TagResource,
iot:UntagResource,
iot:ListTagsForResource
iot:GetCommand,
iot:UpdateCommand,
iot:DeleteCommand
iot:ListCommands