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 | aws.iot.commands |
Fields
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. |
For more information, see AWS::IoT::Command
.
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | CommandId, region |
delete_resource | DELETE | data__Identifier, region |
update_resource | UPDATE | data__Identifier, data__PatchDocument, region |
list_resources | SELECT | region |
get_resource | SELECT | data__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
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.iot.commands (
CommandId,
region
)
SELECT
'{{ CommandId }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.iot.commands (
CommandId,
CreatedAt,
Deprecated,
Description,
DisplayName,
LastUpdatedAt,
MandatoryParameters,
Namespace,
RoleArn,
Payload,
PendingDeletion,
Tags,
region
)
SELECT
'{{ CommandId }}',
'{{ CreatedAt }}',
'{{ Deprecated }}',
'{{ Description }}',
'{{ DisplayName }}',
'{{ LastUpdatedAt }}',
'{{ MandatoryParameters }}',
'{{ Namespace }}',
'{{ RoleArn }}',
'{{ Payload }}',
'{{ PendingDeletion }}',
'{{ Tags }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: command
props:
- name: CommandId
value: '{{ CommandId }}'
- name: CreatedAt
value: '{{ CreatedAt }}'
- name: Deprecated
value: '{{ Deprecated }}'
- name: Description
value: '{{ Description }}'
- name: DisplayName
value: '{{ DisplayName }}'
- name: LastUpdatedAt
value: '{{ LastUpdatedAt }}'
- name: MandatoryParameters
value:
- Name: '{{ Name }}'
Value:
S: '{{ S }}'
B: '{{ B }}'
I: '{{ I }}'
L: '{{ L }}'
D: null
BIN: '{{ BIN }}'
UL: '{{ UL }}'
DefaultValue: null
Description: '{{ Description }}'
- name: Namespace
value: '{{ Namespace }}'
- name: RoleArn
value: '{{ RoleArn }}'
- name: Payload
value:
Content: '{{ Content }}'
ContentType: '{{ ContentType }}'
- name: PendingDeletion
value: '{{ PendingDeletion }}'
- name: Tags
value:
- Key: '{{ Key }}'
Value: '{{ Value }}'
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