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 | awscc.iotsitewise.assets |
Fields
- get (all properties)
- list (identifiers only)
| 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. |
| Name | Datatype | Description |
|---|---|---|
asset_id | string | The ID of the asset |
region | string | AWS region. |
For more information, see AWS::IoTSiteWise::Asset.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | assets | INSERT | AssetName, AssetModelId, region |
delete_resource | assets | DELETE | Identifier, region |
update_resource | assets | UPDATE | Identifier, PatchDocument, region |
list_resources | assets_list_only | SELECT | region |
get_resource | assets | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
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 awscc.iotsitewise.assets
WHERE
region = 'us-east-1' AND
Identifier = '{{ asset_id }}';
Lists all assets in a region.
SELECT
region,
asset_id
FROM awscc.iotsitewise.assets_list_only
WHERE
region = 'us-east-1';
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 awscc.iotsitewise.assets (
AssetModelId,
AssetName,
region
)
SELECT
'{{ asset_model_id }}',
'{{ asset_name }}',
'{{ region }}';
/*+ create */
INSERT INTO awscc.iotsitewise.assets (
AssetExternalId,
AssetModelId,
AssetName,
AssetDescription,
AssetProperties,
AssetHierarchies,
Tags,
region
)
SELECT
'{{ asset_external_id }}',
'{{ asset_model_id }}',
'{{ asset_name }}',
'{{ asset_description }}',
'{{ asset_properties }}',
'{{ asset_hierarchies }}',
'{{ tags }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: asset
props:
- name: asset_external_id
value: '{{ asset_external_id }}'
- name: asset_model_id
value: '{{ asset_model_id }}'
- name: asset_name
value: '{{ asset_name }}'
- name: asset_description
value: '{{ asset_description }}'
- name: asset_properties
value:
- id: '{{ id }}'
external_id: '{{ external_id }}'
logical_id: '{{ logical_id }}'
alias: '{{ alias }}'
notification_state: '{{ notification_state }}'
unit: '{{ unit }}'
- name: asset_hierarchies
value:
- id: '{{ id }}'
external_id: '{{ external_id }}'
logical_id: '{{ logical_id }}'
child_asset_id: '{{ child_asset_id }}'
- name: tags
value:
- key: '{{ key }}'
value: '{{ value }}'
UPDATE example
Use the following StackQL query and manifest file to update a asset resource, using stack-deploy.
/*+ update */
UPDATE awscc.iotsitewise.assets
SET PatchDocument = string('{{ {
"AssetExternalId": asset_external_id,
"AssetModelId": asset_model_id,
"AssetName": asset_name,
"AssetDescription": asset_description,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ asset_id }}';
DELETE example
/*+ delete */
DELETE FROM awscc.iotsitewise.assets
WHERE
Identifier = '{{ asset_id }}' AND
region = 'us-east-1';
Permissions
To operate on the assets resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
iotsitewise:AssociateAssets,
iotsitewise:CreateAsset,
iotsitewise:DescribeAsset,
iotsitewise:DescribeAssetModel,
iotsitewise:ListAssociatedAssets,
iotsitewise:ListTagsForResource,
iotsitewise:TagResource,
iotsitewise:ListAssetModelProperties,
iotsitewise:ListAssetProperties,
iotsitewise:ListAssetModelCompositeModels,
iotsitewise:UpdateAssetProperty
iotsitewise:DescribeAsset,
iotsitewise:DescribeAssetModel,
iotsitewise:ListAssociatedAssets,
iotsitewise:ListAssetModelProperties,
iotsitewise:ListAssetModelCompositeModels,
iotsitewise:ListAssetProperties,
iotsitewise:ListTagsForResource
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
iotsitewise:DeleteAsset,
iotsitewise:DescribeAsset,
iotsitewise:DescribeAssetModel,
iotsitewise:DisassociateAssets,
iotsitewise:ListAssociatedAssets,
iotsitewise:ListAssetProperties,
iotsitewise:ListTagsForResource,
iotsitewise:ListAssetModelCompositeModels,
iotsitewise:ListAssetModelProperties,
iotsitewise:ListAssetProperties
iotsitewise:ListAssetModels,
iotsitewise:ListAssets