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
Idawscc.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.

For more information, see AWS::IoTSiteWise::Asset.

Methods

NameResourceAccessible byRequired Params
create_resourceassetsINSERTAssetName, AssetModelId, region
delete_resourceassetsDELETEIdentifier, region
update_resourceassetsUPDATEIdentifier, PatchDocument, region
list_resourcesassets_list_onlySELECTregion
get_resourceassetsSELECTIdentifier, region

SELECT examples

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 }}';

INSERT example

Use the following StackQL query and manifest file to create a new asset resource, using stack-deploy.

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

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:

iotsitewise:AssociateAssets,
iotsitewise:CreateAsset,
iotsitewise:DescribeAsset,
iotsitewise:DescribeAssetModel,
iotsitewise:ListAssociatedAssets,
iotsitewise:ListTagsForResource,
iotsitewise:TagResource,
iotsitewise:ListAssetModelProperties,
iotsitewise:ListAssetProperties,
iotsitewise:ListAssetModelCompositeModels,
iotsitewise:UpdateAssetProperty