L2 CDK construct to provision AWS IoT Fleetwise
npm install cdk-aws-iotfleetwise
API Reference
pip install cdk-aws-iotfleetwise
API Reference
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' ) ] ,
} ) ;
To deploy a simple end-to-end example you can use the following commands
yarn install
npx projen && npx 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.
Warning: this construct should be considered at alpha stage and is not feature complete.
Implement updates for all the custom resources
Conditional campaigns
See CONTRIBUTING for more
information.
This code is licensed under the MIT-0 License. See the LICENSE file.
import { Campaign } from 'cdk-aws-iotfleetwise'
new Campaign ( scope : Construct , id : string , props : CampaignProps )
Name
Type
Description
scope
constructs.Construct
No description.
id
string
No description.
props
CampaignProps
No description.
Type: constructs.Construct
Name
Description
toString
Returns a string representation of this construct.
public toString ( ) : string
Returns a string representation of this construct.
Name
Description
isConstruct
Checks if x
is a construct.
import { Campaign } from 'cdk-aws-iotfleetwise'
Campaign . isConstruct ( x : any )
Checks if x
is a construct.
Any object.
Name
Type
Description
node
constructs.Node
The tree node.
arn
string
No description.
name
string
No description.
target
Vehicle
No description.
public readonly node : Node ;
The tree node.
public readonly arn : string ;
public readonly name : string ;
public readonly target : Vehicle ;
The fleet of vehicles.
import { Fleet } from 'cdk-aws-iotfleetwise'
new Fleet ( scope : Construct , id : string , props : FleetProps )
Name
Type
Description
scope
constructs.Construct
No description.
id
string
No description.
props
FleetProps
No description.
Type: constructs.Construct
Name
Description
toString
Returns a string representation of this construct.
public toString ( ) : string
Returns a string representation of this construct.
Name
Description
isConstruct
Checks if x
is a construct.
import { Fleet } from 'cdk-aws-iotfleetwise'
Fleet . isConstruct ( x : any )
Checks if x
is a construct.
Any object.
public readonly node : Node ;
The tree node.
public readonly arn : string ;
public readonly fleetId: string ;
public readonly signalCatalog: SignalCatalog ;
public readonly vehicles: Vehicle [ ] ;
Configures FleetWise logging to CloudWatch logs.
If enabled, this will ensure the log group is accessible,
or create a new one if it is not.
import { Logging } from 'cdk-aws-iotfleetwise'
new Logging ( scope : Construct , id : string , props : LoggingProps )
Name
Type
Description
scope
constructs.Construct
No description.
id
string
No description.
props
LoggingProps
No description.
Type: constructs.Construct
Name
Description
toString
Returns a string representation of this construct.
public toString ( ) : string
Returns a string representation of this construct.
Name
Description
isConstruct
Checks if x
is a construct.
import { Logging } from 'cdk-aws-iotfleetwise'
Logging . isConstruct ( x : any )
Checks if x
is a construct.
Any object.
Name
Type
Description
node
constructs.Node
The tree node.
public readonly node : Node ;
The tree node.
The Signal Catalog represents the list of all signals that you want to collect from all the vehicles.
The AWS IoT Fleetwise preview can only support a single Signal Catalog per account.
import { SignalCatalog } from 'cdk-aws-iotfleetwise'
new SignalCatalog ( scope : Construct , id : string , props : SignalCatalogProps )
Type: constructs.Construct
Name
Description
toString
Returns a string representation of this construct.
public toString ( ) : string
Returns a string representation of this construct.
Name
Description
isConstruct
Checks if x
is a construct.
import { SignalCatalog } from 'cdk-aws-iotfleetwise'
SignalCatalog . isConstruct ( x : any )
Checks if x
is a construct.
Any object.
Name
Type
Description
node
constructs.Node
The tree node.
arn
string
No description.
description
string
No description.
name
string
The name of the signal catalog.
public readonly node : Node ;
The tree node.
public readonly arn : string ;
public readonly description: string ;
public readonly name : string ;
The name of the signal catalog.
The vehicle of a specific type from which IoT FleetWise collect signals.
import { Vehicle } from 'cdk-aws-iotfleetwise'
new Vehicle ( scope : Construct , id : string , props : VehicleProps )
Name
Type
Description
scope
constructs.Construct
No description.
id
string
No description.
props
VehicleProps
No description.
Type: constructs.Construct
Name
Description
toString
Returns a string representation of this construct.
public toString ( ) : string
Returns a string representation of this construct.
Name
Description
isConstruct
Checks if x
is a construct.
import { Vehicle } from 'cdk-aws-iotfleetwise'
Vehicle . isConstruct ( x : any )
Checks if x
is a construct.
Any object.
public readonly node : Node ;
The tree node.
public readonly arn : string ;
public readonly vehicleModel: VehicleModel ;
public readonly vehicleName: string ;
public readonly certificateArn: string ;
public readonly certificateId: string ;
public readonly certificatePem: string ;
public readonly endpointAddress: string ;
public readonly privateKey: string ;
import { VehicleModel } from 'cdk-aws-iotfleetwise'
new VehicleModel ( scope : Construct , id : string , props : VehicleModelProps )
Type: constructs.Construct
Name
Description
toString
Returns a string representation of this construct.
public toString ( ) : string
Returns a string representation of this construct.
Name
Description
isConstruct
Checks if x
is a construct.
import { VehicleModel } from 'cdk-aws-iotfleetwise'
VehicleModel . isConstruct ( x : any )
Checks if x
is a construct.
Any object.
public readonly node : Node ;
The tree node.
public readonly name : string ;
public readonly signalCatalog: SignalCatalog ;
AttributeVehicleSignalProps
Attribute Signal - needed when creating a vehicle with attributes.
import { AttributeVehicleSignalProps } from 'cdk-aws-iotfleetwise'
const attributeVehicleSignalProps : AttributeVehicleSignalProps = { ... }
fullyQualifiedName
Required
public readonly fullyQualifiedName: string ;
import { CampaignProps } from 'cdk-aws-iotfleetwise'
const campaignProps : CampaignProps = { ... }
public readonly collectionScheme: CollectionScheme ;
dataDestinationConfigs
Required
public readonly dataDestinationConfigs: DataDestinationConfig [ ] ;
public readonly name : string ;
public readonly signals: CampaignSignal [ ] ;
public readonly target : Vehicle ;
public readonly autoApprove: boolean ;
import { CanVehicleInterfaceProps } from 'cdk-aws-iotfleetwise'
const canVehicleInterfaceProps : CanVehicleInterfaceProps = { ... }
public readonly interfaceId: string ;
public readonly name : string ;
public readonly protocolName: string ;
public readonly protocolVersion: string ;
import { CanVehicleSignalProps } from 'cdk-aws-iotfleetwise'
const canVehicleSignalProps : CanVehicleSignalProps = { ... }
public readonly factor: number ;
fullyQualifiedName
Required
public readonly fullyQualifiedName: string ;
public readonly interfaceId: string ;
public readonly isBigEndian: boolean ;
public readonly isSigned: boolean ;
public readonly length: number ;
public readonly messageId: number ;
public readonly offset: number ;
public readonly startBit: number ;
public readonly name : string ;
Interface.
import { FleetProps } from 'cdk-aws-iotfleetwise'
const fleetProps : FleetProps = { ... }
public readonly fleetId: string ;
public readonly signalCatalog: SignalCatalog ;
public readonly description: string ;
public readonly vehicles: Vehicle [ ] ;
FleetWise Logging Properties.
import { LoggingProps } from 'cdk-aws-iotfleetwise'
const loggingProps : LoggingProps = { ... }
public readonly enableLogging: string ;
public readonly logGroupName: string ;
Name of log group to configure.
This can be either single name
such as AWSIoTFleetWiseLogs
or a fully pathed entry such as:
/iot/FleetWiseLogs
public readonly keepLogGroup: boolean ;
SignalCatalogActuatorProps
import { SignalCatalogActuatorProps } from 'cdk-aws-iotfleetwise'
const signalCatalogActuatorProps : SignalCatalogActuatorProps = { ... }
public readonly dataType: string ;
fullyQualifiedName
Required
public readonly fullyQualifiedName: string ;
public readonly allowedValues: string [ ] ;
public readonly assignedValue: string ;
public readonly description: string ;
public readonly max : number ;
public readonly min : number ;
public readonly unit : string ;
SignalCatalogAttributeProps
import { SignalCatalogAttributeProps } from 'cdk-aws-iotfleetwise'
const signalCatalogAttributeProps : SignalCatalogAttributeProps = { ... }
public readonly dataType: string ;
fullyQualifiedName
Required
public readonly fullyQualifiedName: string ;
public readonly allowedValues: string [ ] ;
public readonly assignedValue: string ;
public readonly defaultValue: string ;
public readonly description: string ;
public readonly max : number ;
public readonly min : number ;
public readonly unit : string ;
import { SignalCatalogBranchProps } from 'cdk-aws-iotfleetwise'
const signalCatalogBranchProps : SignalCatalogBranchProps = { ... }
fullyQualifiedName
Required
public readonly fullyQualifiedName: string ;
public readonly description: string ;
import { SignalCatalogProps } from 'cdk-aws-iotfleetwise'
const signalCatalogProps : SignalCatalogProps = { ... }
Name
Type
Description
deregister
boolean
Deregister FleetWise on stack deletion.
description
string
Description of the Signal Catalog.
name
string
Name of the Signal Catalog.
nodes
SignalCatalogNode []
An array of signal nodes.
vssFile
string
A YAML file that conforms to the Vehicle Signal Specification format and contains a list of signals. If provided, the contents of the file, along with the prefix
property will be appended after any SignalCatalogNode
objects provided.
vssGeneratePrefixBranch
boolean
If set to true, this will parse the vssPrefix into branch nodes.
vssPrefix
string
A prefix to prepend to the fully qualified names found in the VSS file.
public readonly deregister: boolean ;
Type: boolean
Default: false
Deregister FleetWise on stack deletion.
If set to 'true', FleetWise will be deregistered from the Timestream
destination.
public readonly description: string ;
Type: string
Default: None
Description of the Signal Catalog.
If not provided no description is set.
public readonly name : string ;
Type: string
Default: default
Name of the Signal Catalog.
If not provided, default value is used.
public readonly nodes : SignalCatalogNode [ ] ;
An array of signal nodes.
Nodes are a general abstraction of a signal.
A node can be specified as an actuator, attribute, branch, or sensor. See SignalCatalogBranch
,
SignalCatalogSensor
, SignalCatalogActuator
, or SignalCatalogAttribute
for creating nodes.
public readonly vssFile: string ;
Type: string
Default: None
A YAML file that conforms to the Vehicle Signal Specification format and contains a list of signals. If provided, the contents of the file, along with the prefix
property will be appended after any SignalCatalogNode
objects provided.
vssGeneratePrefixBranch
Optional
public readonly vssGeneratePrefixBranch: boolean ;
Type: boolean
Default: true
If set to true, this will parse the vssPrefix into branch nodes.
For instance if OBD.MyData
was
provided, the OBD.MyData
will be parsed into branch nodes of OBD
and OBD.MyData
. By default
this is set to true. If you define branches in another way such as via SignalCatalogNode
, set this
to false to suppress creation of branch nodes.
public readonly vssPrefix: string ;
Type: string
Default: None
A prefix to prepend to the fully qualified names found in the VSS file.
The format of the prefix
is in dotted notation, and will be the prepended to all signal names.
For instance, with the prefix of OBD.MyData
and signal names of PidA
and PidB
will be combined
to create OBD.MyData.PidA
and OBD.MyData.PidB
.
import { SignalCatalogSensorProps } from 'cdk-aws-iotfleetwise'
const signalCatalogSensorProps : SignalCatalogSensorProps = { ... }
public readonly dataType: string ;
fullyQualifiedName
Required
public readonly fullyQualifiedName: string ;
public readonly allowedValues: string [ ] ;
public readonly description: string ;
public readonly max : number ;
public readonly min : number ;
public readonly unit : string ;
import { VehicleModelProps } from 'cdk-aws-iotfleetwise'
const vehicleModelProps : VehicleModelProps = { ... }
public readonly name : string ;
networkInterfaces
Required
public readonly networkInterfaces: VehicleInterface [ ] ;
public readonly signalCatalog: SignalCatalog ;
public readonly description: string ;
networkFileDefinitions
Optional
public readonly networkFileDefinitions: NetworkFileDefinition [ ] ;
public readonly signals: VehicleSignal [ ] ;
Interface.
import { VehicleProps } from 'cdk-aws-iotfleetwise'
const vehicleProps : VehicleProps = { ... }
public readonly createIotThing: boolean ;
public readonly vehicleModel: VehicleModel ;
public readonly vehicleName: string ;
public readonly attributes: { [ key : string ] : string } ;
Type: {[ key: string ]: string}
import { AttributeVehicleSignal } from 'cdk-aws-iotfleetwise'
new AttributeVehicleSignal ( props : AttributeVehicleSignalProps )
Name
Description
toObject
No description.
public toObject ( ) : object
import { CampaignSignal } from 'cdk-aws-iotfleetwise'
new CampaignSignal ( name : string , maxSampleCount ?: number, minimumSamplingInterval ?: Duration )
minimumSamplingInterval
Optional
Type: aws-cdk-lib.Duration
Name
Description
toObject
No description.
public toObject ( ) : object
import { CanDefinition } from 'cdk-aws-iotfleetwise'
new CanDefinition ( networkInterface : string, signalsMap : { [ key : string ] : string} , canDbcFiles : string[ ] )
Type: {[ key: string ]: string}
Name
Description
toObject
No description.
public toObject ( ) : object
import { CanVehicleInterface } from 'cdk-aws-iotfleetwise'
new CanVehicleInterface ( props : CanVehicleInterfaceProps )
Name
Description
toObject
No description.
public toObject ( ) : object
import { CanVehicleSignal } from 'cdk-aws-iotfleetwise'
new CanVehicleSignal ( props : CanVehicleSignalProps )
Name
Description
toObject
No description.
public toObject ( ) : object
import { CollectionScheme } from 'cdk-aws-iotfleetwise'
new CollectionScheme ( )
Name
Description
toObject
No description.
public toObject ( ) : object
import { DataDestinationConfig } from 'cdk-aws-iotfleetwise'
new DataDestinationConfig ( )
Name
Description
toObject
No description.
public toObject ( ) : object
import { NetworkFileDefinition } from 'cdk-aws-iotfleetwise'
new NetworkFileDefinition ( )
Name
Description
toObject
No description.
public toObject ( ) : object
import { S3ConfigProperty } from 'cdk-aws-iotfleetwise'
new S3ConfigProperty ( bucketArn : string, dataFormat ?: string, prefix ?: string , storageCompressionFormat ?: string)
storageCompressionFormat
Optional
Name
Description
toObject
No description.
public toObject ( ) : object
import { SignalCatalogActuator } from 'cdk-aws-iotfleetwise'
new SignalCatalogActuator ( props : SignalCatalogActuatorProps )
Name
Description
toObject
No description.
public toObject ( ) : object
import { SignalCatalogAttribute } from 'cdk-aws-iotfleetwise'
new SignalCatalogAttribute ( props : SignalCatalogAttributeProps )
Name
Description
toObject
No description.
public toObject ( ) : object
import { SignalCatalogBranch } from 'cdk-aws-iotfleetwise'
new SignalCatalogBranch ( props : SignalCatalogBranchProps )
Name
Description
toObject
No description.
public toObject ( ) : object
import { SignalCatalogNode } from 'cdk-aws-iotfleetwise'
new SignalCatalogNode ( )
Name
Description
toObject
No description.
public toObject ( ) : object
import { SignalCatalogSensor } from 'cdk-aws-iotfleetwise'
new SignalCatalogSensor ( props : SignalCatalogSensorProps )
Name
Description
toObject
No description.
public toObject ( ) : object
TimeBasedCollectionScheme
import { TimeBasedCollectionScheme } from 'cdk-aws-iotfleetwise'
new TimeBasedCollectionScheme ( period : Duration )
Name
Type
Description
period
aws-cdk-lib.Duration
No description.
Type: aws-cdk-lib.Duration
Name
Description
toObject
No description.
public toObject ( ) : object
import { TimestreamConfigProperty } from 'cdk-aws-iotfleetwise'
new TimestreamConfigProperty ( executionRoleArn : string, timestreamTableArn : string)
timestreamTableArn
Required
Name
Description
toObject
No description.
public toObject ( ) : object
import { VehicleInterface } from 'cdk-aws-iotfleetwise'
new VehicleInterface ( )
Name
Description
toObject
No description.
public toObject ( ) : object
import { VehicleSignal } from 'cdk-aws-iotfleetwise'
new VehicleSignal ( )
Name
Description
toObject
No description.
public toObject ( ) : object