Skip to main content

L2 CDK construct to provision AWS IoT Fleetwise

Project description

NPM version PyPI version release

cdk-aws-iotfleetwise

L2 CDK construct to provision AWS IoT Fleetwise

Install

Typescript

npm install cdk-aws-iotfleetwise

API Reference

Python

pip install cdk-aws-iotfleetwise

API Reference

Sample

import { SignalCatalog,
         VehicleModel,
         Vehicle,
         Campaign,
         CanVehicleInterface,
         CanVehicleSignal,
         SignalCatalogBranch,
         TimeBasedCollectionScheme
         } from 'cdk-aws-iotfleetwise';

const signalCatalog = new SignalCatalog(stack, 'SignalCatalog', {
  database,
  table,
  role,
  nodes: [
    new SignalCatalogBranch('Vehicle', 'Vehicle'),
    new SignalCatalogSensor('EngineTorque', 'Vehicle.EngineTorque', 'DOUBLE'),
  ],
});

const model_a = new VehicleModel(stack, 'ModelA', {
  signalCatalog,
  name: 'modelA',
  description: 'Model A vehicle',
  networkInterfaces: [new CanVehicleInterface('1', 'vcan0')],
  signals: [
    new CanVehicleSignal('EngineTorque', 'Vehicle.EngineTorque', '1',
      401, // messageId
      1.0, // factor
      true, // isBigEndian
      false, // isSigned
      8, // lenght
      0.0, // offset
      9), // startBit
  ],
});

const vin100 = new Vehicle(stack, 'vin100', {
  vehicleId: 'vin100',
  vehicleModel: model_a,
  createIotThing: true
});

new Campaign(stack, 'Campaign', {
  name: 'TimeBasedCampaign',
  target: vin100,
  collectionScheme: new TimeBasedCollectionScheme(cdk.Duration.seconds(10)),
  signals: [
    new CampaignSignal('Vehicle.EngineTorque'),
  ],
});

Getting started

To deploy a simple end-to-end example you can use the following commands

yarn install
projen && projen build
npx cdk -a lib/integ.full.js deploy

The deploy takes about 15 mins mostly due to compilation of the IoT FleetWise agent in the EC2 instance that simulate the vehicle. Once deploy is finshed, approve the campaign with the command:

aws iotfleetwise update-campaign --campaign-name FwTimeBasedCampaign --action APPROVE

and data will start to show up in the Timestream table.

TODO

Warning: this construct should be considered at alpha stage and is not feature complete.

  • Apply the least priviledge principle to roles
  • Implement updates for all the custom resources
  • Conditional campaigns

Security

See CONTRIBUTING for more information.

License

This code is licensed under the MIT-0 License. See the LICENSE file.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cdk-aws-iotfleetwise-0.2.8.tar.gz (16.8 MB view details)

Uploaded Source

Built Distribution

cdk_aws_iotfleetwise-0.2.8-py3-none-any.whl (16.8 MB view details)

Uploaded Python 3

File details

Details for the file cdk-aws-iotfleetwise-0.2.8.tar.gz.

File metadata

  • Download URL: cdk-aws-iotfleetwise-0.2.8.tar.gz
  • Upload date:
  • Size: 16.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.5

File hashes

Hashes for cdk-aws-iotfleetwise-0.2.8.tar.gz
Algorithm Hash digest
SHA256 09acc7318871fcfd4f50d6ca9b9a04566ac284d1249db89f507a977bc433c89d
MD5 cf0edb5ea6b1760aa392fde6bf5df025
BLAKE2b-256 50c2377790109f6553abe5ba09be2d066fbd2dbc1c281638432d124ffc829244

See more details on using hashes here.

File details

Details for the file cdk_aws_iotfleetwise-0.2.8-py3-none-any.whl.

File metadata

File hashes

Hashes for cdk_aws_iotfleetwise-0.2.8-py3-none-any.whl
Algorithm Hash digest
SHA256 20c3131ab355715d89246c2d332256e8edc8b341648e2b1f09ba428db87051c3
MD5 31e1136bf327095325333f1091b4e9c6
BLAKE2b-256 a957d973f48b81ea35e612115dd3207dae7cfdde2ec353e18deadb82f1653220

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page