Skip to main content

assets

Creates, updates, deletes or gets an asset resource or lists assets in a region

Overview

Nameassets
TypeResource
DescriptionResource schema for AWS::IoTSiteWise::Asset
Idaws.iotsitewise.assets

Fields

NameDatatypeDescription
asset_idstringThe ID of the asset
asset_external_idstringThe External ID of the asset
asset_model_idstringThe ID of the asset model from which to create the asset.
asset_arnstringThe ARN of the asset
asset_namestringA unique, friendly name for the asset.
asset_descriptionstringA description for the asset
asset_propertiesarray
asset_hierarchiesarray
tagsarrayA list of key-value pairs that contain metadata for the asset.
regionstringAWS region.

Methods

NameAccessible byRequired Params
create_resourceINSERTAssetName, AssetModelId, region
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__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.

/*+ create */
INSERT INTO aws.iotsitewise.assets (
AssetModelId,
AssetName,
region
)
SELECT
'{{ AssetModelId }}',
'{{ AssetName }}',
'{{ region }}';

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