assets
Creates, updates, deletes or gets an asset
resource or lists assets
in a region
Overview
Name | assets |
Type | Resource |
Description | Resource schema for AWS::IoTSiteWise::Asset |
Id | aws.iotsitewise.assets |
Fields
Name | Datatype | Description |
---|---|---|
asset_id | string | The ID of the asset |
asset_external_id | string | The External ID of the asset |
asset_model_id | string | The ID of the asset model from which to create the asset. |
asset_arn | string | The ARN of the asset |
asset_name | string | A unique, friendly name for the asset. |
asset_description | string | A description for the asset |
asset_properties | array | |
asset_hierarchies | array | |
tags | array | A list of key-value pairs that contain metadata for the asset. |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | AssetName, AssetModelId, 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 assets
in a region.
SELECT
region,
asset_id,
asset_external_id,
asset_model_id,
asset_arn,
asset_name,
asset_description,
asset_properties,
asset_hierarchies,
tags
FROM aws.iotsitewise.assets
WHERE region = 'us-east-1';
Gets all properties from an individual asset
.
SELECT
region,
asset_id,
asset_external_id,
asset_model_id,
asset_arn,
asset_name,
asset_description,
asset_properties,
asset_hierarchies,
tags
FROM aws.iotsitewise.assets
WHERE region = 'us-east-1' AND data__Identifier = '<AssetId>';
INSERT
example
Use the following StackQL query and manifest file to create a new asset
resource, using stack-deploy
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.iotsitewise.assets (
AssetModelId,
AssetName,
region
)
SELECT
'{{ AssetModelId }}',
'{{ AssetName }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.iotsitewise.assets (
AssetExternalId,
AssetModelId,
AssetName,
AssetDescription,
AssetProperties,
AssetHierarchies,
Tags,
region
)
SELECT
'{{ AssetExternalId }}',
'{{ AssetModelId }}',
'{{ AssetName }}',
'{{ AssetDescription }}',
'{{ AssetProperties }}',
'{{ AssetHierarchies }}',
'{{ Tags }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: asset
props:
- name: AssetExternalId
value: '{{ AssetExternalId }}'
- name: AssetModelId
value: '{{ AssetModelId }}'
- name: AssetName
value: '{{ AssetName }}'
- name: AssetDescription
value: '{{ AssetDescription }}'
- name: AssetProperties
value:
- Id: '{{ Id }}'
ExternalId: '{{ ExternalId }}'
LogicalId: '{{ LogicalId }}'
Alias: '{{ Alias }}'
NotificationState: '{{ NotificationState }}'
Unit: '{{ Unit }}'
- name: AssetHierarchies
value:
- Id: '{{ Id }}'
ExternalId: '{{ ExternalId }}'
LogicalId: '{{ LogicalId }}'
ChildAssetId: '{{ ChildAssetId }}'
- name: Tags
value:
- Key: '{{ Key }}'
Value: '{{ Value }}'
DELETE
example
/*+ delete */
DELETE FROM aws.iotsitewise.assets
WHERE data__Identifier = '<AssetId>'
AND region = 'us-east-1';
Permissions
To operate on the assets
resource, the following permissions are required:
Create
iotsitewise:AssociateAssets,
iotsitewise:CreateAsset,
iotsitewise:DescribeAsset,
iotsitewise:DescribeAssetModel,
iotsitewise:ListAssociatedAssets,
iotsitewise:ListTagsForResource,
iotsitewise:TagResource,
iotsitewise:ListAssetModelProperties,
iotsitewise:ListAssetProperties,
iotsitewise:ListAssetModelCompositeModels,
iotsitewise:UpdateAssetProperty
Read
iotsitewise:DescribeAsset,
iotsitewise:DescribeAssetModel,
iotsitewise:ListAssociatedAssets,
iotsitewise:ListAssetModelProperties,
iotsitewise:ListAssetModelCompositeModels,
iotsitewise:ListAssetProperties,
iotsitewise:ListTagsForResource
Update
iotsitewise:AssociateAssets,
iotsitewise:DescribeAsset,
iotsitewise:DescribeAssetModel,
iotsitewise:DisassociateAssets,
iotsitewise:ListAssociatedAssets,
iotsitewise:ListTagsForResource,
iotsitewise:TagResource,
iotsitewise:UpdateAsset,
iotsitewise:UpdateAssetProperty,
iotsitewise:ListAssetModelProperties,
iotsitewise:ListAssetProperties,
iotsitewise:ListAssetModelCompositeModels,
iotsitewise:UntagResource
Delete
iotsitewise:DeleteAsset,
iotsitewise:DescribeAsset,
iotsitewise:DescribeAssetModel,
iotsitewise:DisassociateAssets,
iotsitewise:ListAssociatedAssets,
iotsitewise:ListAssetProperties,
iotsitewise:ListTagsForResource,
iotsitewise:ListAssetModelCompositeModels,
iotsitewise:ListAssetModelProperties,
iotsitewise:ListAssetProperties
List
iotsitewise:ListAssetModels,
iotsitewise:ListAssets