Creating an asset (Amazon CLI) - Amazon IoT SiteWise
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Creating 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 the externalId:myExternalId if it has one. For more information, see Referencing 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 and asset-model-id with the ID or the external ID of the asset model.

    aws iotsitewise create-asset \ --asset-name asset-name \ --asset-model-id asset-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 is CREATING 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's state is ACTIVE, you can perform update operations on your asset. For more information, see Asset and model states.

After you create an asset, see Configuring a new asset.