Skip to content

IoT Analytics

IoT Analytics is a managed service that enables you to collect, store, process, and analyze data generated by your IoT devices. It provides a set of tools to build IoT applications without having to manage the underlying infrastructure.

LocalStack allows you to use the IoT Analytics APIs to create and manage channels, data stores, and pipelines in your local environment. The supported APIs are available on our API Coverage section, which provides information on the extent of IoT Analytics integration with LocalStack.

This guide is designed for users new to Iot Analytics and assumes basic knowledge of the AWS CLI and our awslocal wrapper script.

Start your LocalStack container using your preferred method. We will demonstrate how to create a channel, data store, and pipeline within IoT Analytics using LocalStack.

You can create a channel using the CreateChannel API. Run the following command to create a channel named mychannel:

Terminal window
awslocal iotanalytics create-channel --channel-name mychannel

You can use the DescribeChannel API to check the status of the channel:

Terminal window
awslocal iotanalytics describe-channel --channel-name mychannel
Output
{
"channel": {
"name": "mychannel",
"status": "ACTIVE"
}
}

You can create a data store using the CreateDatastore API. Run the following command to create a data store named mydatastore:

Terminal window
awslocal iotanalytics create-datastore --datastore-name mydatastore

You can use the DescribeDatastore API to check the status of the data store:

Terminal window
awslocal iotanalytics describe-datastore --datastore-name mydatastore
Output
{
"datastore": {
"name": "mydatastore",
"status": "ACTIVE"
}
}

You can create a pipeline using the CreatePipeline API. Run the following command to create a pipeline named mypipeline:

Terminal window
awslocal iotanalytics create-pipeline --cli-input-json file://mypipeline.json

The mypipeline.json file contains the following content:

{
"pipelineName": "mypipeline",
"pipelineActivities": [
{
"channel": {
"name": "mychannelactivity",
"channelName": "mychannel",
"next": "mystoreactivity"
}
},
{
"datastore": {
"name": "mystoreactivity",
"datastoreName": "mydatastore"
}
}
]
}

You can use the DescribePipeline API to check the status of the pipeline:

Terminal window
awslocal iotanalytics describe-pipeline --pipeline-name mypipeline
Output
{
"pipeline": {
"name": "mypipeline"
}
}

The IoT Analytics service provider is currently mocked in LocalStack, and the service does not interface with the IoT Core service.

OperationImplementedImage
Page 1 of 0