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: tsDatabaseConstruct,
  table: tsHeartBeatTableConstruct,
  nodes: [
    new SignalCatalogBranch({
      fullyQualifiedName: 'Vehicle',
    }),
    new SignalCatalogSensor({
      fullyQualifiedName: 'Vehicle.EngineTorque',
      dataType: 'DOUBLE',
    }),
  ],
});

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

const vin100 = new Vehicle(stack, 'vin100', {
  vehicleName: '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 compile
# Define Amazon Timestream as fleetwise storage destination
npx cdk -a lib/integ.full.js deploy -c key_name=mykey
# Define Amazon S3 as fleetwise storage destination
npx cdk -a lib/integ.full.js deploy -c key_name=mykey -c use_s3=true

Where mykey is an existing keypair name present in your account. 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, data will start to show up in your Timestream table.

TODO

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

  • 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.3.0.tar.gz (11.8 MB view details)

Uploaded Source

Built Distribution

cdk_aws_iotfleetwise-0.3.0-py3-none-any.whl (11.8 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cdk-aws-iotfleetwise-0.3.0.tar.gz
  • Upload date:
  • Size: 11.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for cdk-aws-iotfleetwise-0.3.0.tar.gz
Algorithm Hash digest
SHA256 adecccad908682e69e4970a1e5597d54e990e1cc155365562cfc01c1f1f2a0aa
MD5 48b3f893f16c9b10620783c8c983651c
BLAKE2b-256 29ab503026f93728f82fd2ad00a2f7eb902205f0567531bc109996d2aa37cf7f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cdk_aws_iotfleetwise-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 672e7d7fd9d02e4df5bcd8654f5bb27609df89e8ee7660b77e087777e027f8e6
MD5 e465fe1846dcbd4258f9d23ecc29d445
BLAKE2b-256 3efcf7b2878641d843c1121f5e7a3a5232640c5c6ba7c11db56120ad75228b8d

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