Create assets for asset models in Amazon IoT SiteWise
You can create an asset from an asset model. You must have an asset model before you can create an asset. If you haven't created an asset model, see Create asset models in Amazon IoT SiteWise.
Note
You can only create assets from ACTIVE
models. If your model's state isn't
ACTIVE
, you may need to wait for up to a few minutes before you can create
assets from that model. For more information, see Asset and model states.
Create an asset (console)
You can use the Amazon IoT SiteWise console to create an asset.
To create an asset (console)
Navigate to the Amazon IoT SiteWise console
. -
In the navigation pane, choose Assets.
-
Choose Create asset.
-
On the Create asset page, do the following:
-
For Model, choose the asset model from which to create an asset.
Note
If your model isn't ACTIVE, you must wait until it's active, or resolve issues if it's FAILED.
-
Enter a Name for your asset.
-
(Optional) Add tags for your asset. For more information, see Tag your Amazon IoT SiteWise resources.
-
Choose Create asset.
When you create an asset, the Amazon IoT SiteWise console navigates to the new asset's page. On this page, you can see the asset's Status, which is initially CREATING. This page automatically updates, so you can wait for the asset's status to update.
Note
The asset creation process can take up to a minute. After the Status is ACTIVE, you can perform update operations on your asset. For more information, see Asset and model states.
-
After you create an asset, see Configure a new asset.
Create an asset (Amazon CLI)
You can use the Amazon Command Line Interface (Amazon CLI) to create an asset from an asset model.
You must have an assetModelId
to create an asset. If you created an asset
model, but don't know its assetModelId
, use the ListAssetModels API to view all of your
asset models.
To create an asset from an asset model, use the CreateAsset API with the following parameters:
-
assetName
– The new asset's name. Give your asset a name to help you identify it. -
assetModelId
– The ID of the asset. This is the actual ID in UUID format, or theexternalId:myExternalId
if it has one. For more information, see Reference objects with external IDs in the Amazon IoT SiteWise User Guide.
To create an asset (Amazon CLI)
-
Run the following command to create an asset. Replace
asset-name
with a name for the asset andasset-model-id
with the ID or the external ID of the asset model.aws iotsitewise create-asset \ --asset-name
asset-name
\ --asset-model-idasset-model-id
The operation returns a response that contains your new asset's details and status in the following format.
{ "assetId": "
String
", "assetArn": "String
", "assetStatus": { "state": "String
", "error": { "code": "String
", "message": "String
" } } }The asset's
state
isCREATING
until the asset creates.Note
The asset creation process can take up to a minute. To check your asset's status, use the DescribeAsset operation with your asset's ID as the
assetId
parameter. After the asset'sstate
isACTIVE
, you can perform update operations on your asset. For more information, see Asset and model states.
After you create an asset, see Configure a new asset.