Create a dataset
Note
The SiteWise Monitor feature is no longer available to new customers. Existing customers can continue to use the service as normal. For more information, see SiteWise Monitor availability change.
Note
The Amazon IoT SiteWise Assistant must use a dataset with an Amazon Kendra index for enterprise level knowledge and guidance. If you do not have a Amazon Kendra index, see Creating an index to create one. Adding a dataset improves the quality of the Assistant's response, and minimizes hallucinations.
- Console
-
Create a dataset in the Amazon IoT SiteWise console
-
Datasets are displayed in the Datasets section of the Amazon IoT SiteWise Assistant page.
-
If no datasets exist, choose Create dataset.
-
In the Dataset details page, choose a Kendra index from the drop down menu to associate with the dataset.
-
The dataset name is populated by the Kendra index selected in Step 3. Edit the name if needed.
-
(Optional) The dataset description is populated by the Kendra index selected in Step 3. Edit the description if needed.
-
In the Permissions section, choose from below:
-
Choose Create and use a new service role. By default, Amazon IoT SiteWise automatically creates a service role. This role allows the Amazon IoT SiteWise Assistant to access your Kendra indexes.
-
Choose Use an existing service role, and then choose the target role.
-
-
Choose Create.
The service role created by Amazon IoT SiteWise for the user, if the user chose to Create and use a new service role.
-
- Amazon CLI
-
Create a dataset in Amazon CLI
-
Create an IAM role used to create a dataset. Use the following permissions policy:
JSON- JSON
-
{ "Version":"2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "kendra:Retrieve" ], "Resource": "arn:aws-cn:kendra:*:*:index/*" } ] }
Use the following trust relationship:
JSON- JSON
-
{ "Version":"2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "Service": "iotsitewise.amazonaws.com" }, "Action": "sts:AssumeRole" } ] }
-
Create a file create-dataset.json with the template provided in the example. Populate
datasetId,kendra knowledgeBaseArnandroleArnto connect with this dataset.{ "datasetId": "<UUID>", "datasetName": "DatasetForAssistant", "datasetSource": { "sourceType": "KENDRA", "sourceFormat": "KNOWLEDGE_BASE", "sourceDetail": { "kendra": { "knowledgeBaseArn": "arn:aws:kendra::%s:index/index", "roleArn": "arn:aws:iam::%s:role/role" } } } } -
Create the dataset with the following command:
aws iotsitewise create-dataset --cli-input-jsonfile://create-dataset.json—-region us-east-1
-