entities
Creates, updates, deletes or gets an entity resource or lists entities in a region
Overview
| Name | entities |
| Type | Resource |
| Description | Resource schema for AWS::IoTTwinMaker::Entity |
| Id | awscc.iottwinmaker.entities |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
entity_id | string | The ID of the entity. |
entity_name | string | The name of the entity. |
status | object | The current status of the entity. |
has_child_entities | boolean | A Boolean value that specifies whether the entity has child entities or not. |
parent_entity_id | string | The ID of the parent entity. |
arn | string | The ARN of the entity. |
description | string | The description of the entity. |
creation_date_time | string | The date and time when the entity was created. |
tags | object | A key-value pair to associate with a resource. |
workspace_id | string | The ID of the workspace. |
components | object | A map that sets information about a component type. |
composite_components | object | A map that sets information about a composite component. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
entity_id | string | The ID of the entity. |
workspace_id | string | The ID of the workspace. |
region | string | AWS region. |
For more information, see AWS::IoTTwinMaker::Entity.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | entities | INSERT | WorkspaceId, EntityName, region |
delete_resource | entities | DELETE | Identifier, region |
update_resource | entities | UPDATE | Identifier, PatchDocument, region |
list_resources | entities_list_only | SELECT | region |
get_resource | entities | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual entity.
SELECT
region,
entity_id,
entity_name,
status,
has_child_entities,
parent_entity_id,
arn,
description,
creation_date_time,
update_date_time,
tags,
workspace_id,
components,
composite_components
FROM awscc.iottwinmaker.entities
WHERE
region = '{{ region }}' AND
Identifier = '{{ workspace_id }}|{{ entity_id }}';
Lists all entities in a region.
SELECT
region,
workspace_id,
entity_id
FROM awscc.iottwinmaker.entities_list_only
WHERE
region = '{{ region }}';
INSERT example
Use the following StackQL query and manifest file to create a new entity resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.iottwinmaker.entities (
EntityName,
WorkspaceId,
region
)
SELECT
'{{ entity_name }}',
'{{ workspace_id }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.iottwinmaker.entities (
EntityId,
EntityName,
ParentEntityId,
Description,
Tags,
WorkspaceId,
Components,
CompositeComponents,
region
)
SELECT
'{{ entity_id }}',
'{{ entity_name }}',
'{{ parent_entity_id }}',
'{{ description }}',
'{{ tags }}',
'{{ workspace_id }}',
'{{ components }}',
'{{ composite_components }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: entity
props:
- name: entity_id
value: '{{ entity_id }}'
- name: entity_name
value: '{{ entity_name }}'
- name: parent_entity_id
value: '{{ parent_entity_id }}'
- name: description
value: '{{ description }}'
- name: tags
value: {}
- name: workspace_id
value: '{{ workspace_id }}'
- name: components
value: {}
- name: composite_components
value: {}
UPDATE example
Use the following StackQL query and manifest file to update a entity resource, using stack-deploy.
/*+ update */
UPDATE awscc.iottwinmaker.entities
SET PatchDocument = string('{{ {
"EntityName": entity_name,
"ParentEntityId": parent_entity_id,
"Description": description,
"Tags": tags,
"Components": components,
"CompositeComponents": composite_components
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ workspace_id }}|{{ entity_id }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.iottwinmaker.entities
WHERE
Identifier = '{{ workspace_id }}|{{ entity_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:
| Parameter | Description |
|---|---|
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 entities resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
iottwinmaker:GetWorkspace,
iottwinmaker:CreateEntity,
iottwinmaker:GetEntity,
iottwinmaker:ListComponents,
iottwinmaker:ListProperties,
iottwinmaker:ListTagsForResource,
iottwinmaker:TagResource
iottwinmaker:GetComponentType,
iottwinmaker:GetEntity,
iottwinmaker:ListComponents,
iottwinmaker:ListProperties,
iottwinmaker:GetWorkspace,
iottwinmaker:ListEntities,
iottwinmaker:ListTagsForResource
iottwinmaker:GetComponentType,
iottwinmaker:GetEntity,
iottwinmaker:ListComponents,
iottwinmaker:ListProperties,
iottwinmaker:GetWorkspace,
iottwinmaker:ListTagsForResource,
iottwinmaker:TagResource,
iottwinmaker:UntagResource,
iottwinmaker:UpdateEntity,
iottwinmaker:UpdateComponentType
iottwinmaker:GetEntity,
iottwinmaker:GetWorkspace,
iottwinmaker:DeleteEntity
iottwinmaker:GetWorkspace,
iottwinmaker:ListTagsForResource,
iottwinmaker:GetEntity,
iottwinmaker:ListEntities