AWS IoT Application Kit is an open source client-side library that enables IoT application developers to simplify the development of complex IoT applications by leveraging performant reusable components from AWS IoT App Kit which abstract critical technical considerations expected from a realtime web application - handling streaming data, caching, preloading data, dynamic aggregation and preventing request fragmentation. This abstraction allows IoT application developers to focus on building custom user experiences and worrying less about underlying technical complexities.
This project deploys an AWS CDK stack named OpcuaSimulatorStack
which deploys the following AWS resources to create a Node-RED based OPC-UA server simulating telemetry for an industrial juice bottling line:
- EC2 Instance with Node-RED, AWS IoT Greengrass V2 core. This Greengrass core device also acts as an AWS IoT Sitewise gateway to ingest simulated telemetry data via OPC-UA.
- AWS IoT Sitewise asset models and corresponding assets representing machines in the bottling line.
- Other AWS IoT resources (AWS IoT Keys and Certificates, Policies, Greengrass deployment) needed by Greengrass.
- A standalone ReactJS application (expected to be run locally) implementing AWS IoT App Kit in
assets/react-app
folder.
Representation of machines in the industrial bottling line simulated with OpcuaSimulatorStack.
The following is required to deploy this solution:
- AWS CLI
- AWS CDK
- An AWS CLI profile with permissions to deploy stacks via AWS CloudFormation
- A default VPC present in your AWS account
- Clone this repository
git clone https://github.com/aws-samples/aws-iot-app-kit-demo iot-app-kit-demo
- Change to the project directory
cd iot-app-kit-demo
- Install dependencies for the AWS CDK. Note, this is for the infrastructure only.
npm ci
- Configure your account and region for CDK deployment.
cdk bootstrap aws://<ACCOUNT-NUMBER>/<REGION>
- Deploy the cdk stack named OpcuaSimulatorStack. When prompted with “Do you wish to deploy these changes (y/n)?” Enter Y.
cdk deploy OpcuaSimulatorStack
Please refer to the README to run the demo ReactJS application locally.
The cdk.json
file tells the CDK Toolkit how to execute your app.
Useful commands
npm run build
compile typescript to jsnpm run watch
watch for changes and compilenpm run test
perform the jest unit testscdk deploy
deploy this stack to your default AWS account/regioncdk diff
compare deployed stack with current statecdk synth
emits the synthesized CloudFormation template