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 | aws.iottwinmaker.entities |
Fields
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. |
update_date_time | string | The last date and time when the entity was updated. |
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. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | WorkspaceId, EntityName, 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 entities
in a region.
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 aws.iottwinmaker.entities
WHERE region = 'us-east-1';
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 aws.iottwinmaker.entities
WHERE region = 'us-east-1' AND data__Identifier = '<WorkspaceId>|<EntityId>';
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 aws.iottwinmaker.entities (
EntityName,
WorkspaceId,
region
)
SELECT
'{{ EntityName }}',
'{{ WorkspaceId }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.iottwinmaker.entities (
EntityId,
EntityName,
ParentEntityId,
Description,
Tags,
WorkspaceId,
Components,
CompositeComponents,
region
)
SELECT
'{{ EntityId }}',
'{{ EntityName }}',
'{{ ParentEntityId }}',
'{{ Description }}',
'{{ Tags }}',
'{{ WorkspaceId }}',
'{{ Components }}',
'{{ CompositeComponents }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: entity
props:
- name: EntityId
value: '{{ EntityId }}'
- name: EntityName
value: '{{ EntityName }}'
- name: ParentEntityId
value: '{{ ParentEntityId }}'
- name: Description
value: '{{ Description }}'
- name: Tags
value: {}
- name: WorkspaceId
value: '{{ WorkspaceId }}'
- name: Components
value: {}
- name: CompositeComponents
value: {}
DELETE
example
/*+ delete */
DELETE FROM aws.iottwinmaker.entities
WHERE data__Identifier = '<WorkspaceId|EntityId>'
AND region = 'us-east-1';
Permissions
To operate on the entities
resource, the following permissions are required:
Create
iottwinmaker:GetWorkspace,
iottwinmaker:CreateEntity,
iottwinmaker:GetEntity,
iottwinmaker:ListComponents,
iottwinmaker:ListProperties,
iottwinmaker:ListTagsForResource,
iottwinmaker:TagResource
Read
iottwinmaker:GetComponentType,
iottwinmaker:GetEntity,
iottwinmaker:ListComponents,
iottwinmaker:ListProperties,
iottwinmaker:GetWorkspace,
iottwinmaker:ListEntities,
iottwinmaker:ListTagsForResource
Update
iottwinmaker:GetComponentType,
iottwinmaker:GetEntity,
iottwinmaker:ListComponents,
iottwinmaker:ListProperties,
iottwinmaker:GetWorkspace,
iottwinmaker:ListTagsForResource,
iottwinmaker:TagResource,
iottwinmaker:UntagResource,
iottwinmaker:UpdateEntity,
iottwinmaker:UpdateComponentType
Delete
iottwinmaker:GetEntity,
iottwinmaker:GetWorkspace,
iottwinmaker:DeleteEntity
List
iottwinmaker:GetWorkspace,
iottwinmaker:ListTagsForResource,
iottwinmaker:GetEntity,
iottwinmaker:ListEntities