aws / aws-cdk-rfcs

RFCs for the AWS CDK

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

IoT Sitewise L2 Construct

yamatatsu opened this issue · comments

Description

I would like to implement IoT Sitewise L2 Construct. It has already got some votes (see, aws/aws-cdk#11451). Also, the resource relationships in Sitewise are complex, so there is worth expressing in CDK I think.

Roles

Role User
Proposed by @yamatatsu
Author(s) @alias, @alias, @alias
API Bar Raiser @alias
Stakeholders @alias, @alias, @alias

See RFC Process for details

Workflow

  • Tracking issue created (label: status/proposed)
  • API bar raiser assigned (ping us at #aws-cdk-rfcs if needed)
  • Kick off meeting
  • RFC pull request submitted (label: status/review)
  • Community reach out (via Slack and/or Twitter)
  • API signed-off (label api-approved applied to pull request)
  • Final comments period (label: status/final-comments-period)
  • Approved and merged (label: status/approved)
  • Execution plan submitted (label: status/planning)
  • Plan approved and merged (label: status/implementing)
  • Implementation complete (label: status/done)

Author is responsible to progress the RFC according to this checklist, and
apply the relevant labels to this issue so that the RFC table in README gets
updated.

What is the status of this RFC? I would like to resume work on this. Should I create a new RFC ticket, or can someone re-open this issue?

Thanks for reopening @rix0rrr . I have posted a message on slack searching for a bar raiser (assuming one is needed).

Here are some of my API ideas for Asset Models:

Create an Asset Model

const generatorModel = new sw.AssetModel(this, 'GeneratorModel', {
  name: 'Generator model 262966 Doppler',
});

Add properties to an asset model

const serialNum = new sw.Attribute({
  name: 'serial',
  defaultValue: 'noserial',
  dataType: sw.DataType.STRING,
});
generatorModel.addAttribute(serialNum);

const watts_1m = new sw.Measurement({
  name: 'watts_1m',
  unit: 'Watts/min',
  dataType: sw.DataType.DOUBLE,
});
generatorModel.addMeasurement(watts_1m);

const watts_5m = new sw.Metric({
  name: 'sum_watts_5m',
  expression: 'sum(watts_1m)',
  dataType: sw.DataType.DOUBLE,
  tumblingWindow: { interval: '5m' },
  variables: [{ name: 'watts_1m', property: watts_1m }],
});
generatorModel.addMetric(watts_5m);

Create an asset hierarchy

The addChild method returns the child, so you can chain calls and construct
nested hierarchies.

The addChildren method returns the parent, so you can chain calls to construct
wide hierarchies.

const nuclearPlant = new AssetModel(this, 'NuclearPlant', { name: 'Nuclear Power Plant' });

const steamPlant = new AssetModel(this, 'SteamPlant', { name: 'Steam Plant' });
const boiler = new AssetModel(this, 'Boiler', { name: 'Boiler model A' });
const reactor = new AssetModel(this, 'Reactor', { name: 'Uranium reactor' });
const controlRods = new AssetModel(this, 'Control', { name: 'Control Rods' });

const generationPlant = new AssetModel(this, 'GenerationPlant', { name: 'Generation' });
const turbine = new AssetModel(this, 'Turbine', { name: 'Steam Turbine model B' });
const generator = new AssetModel(this, 'Generator', { name: 'Generator model C' });
const cooler = new AssetModel(this, 'Cooler', { name: 'Generator cooler' });
const coolantPump = new AssetModel(this, 'Pump', { name: 'Coolant Pump' });
const transformer = new AssetModel(this, 'Transformer');

reactor.addChild(controlRods);

generator
  .addChild(cooler)
    .addChild(coolantPump);

nuclearPlant
  .addChildren(
    steamPlant
      .addChildren(boiler, reactor)
  )
  .addChildren(
    generationPlant
      .addChildren(turbine, generator, transformer)
  )

Ultimately, one of my visions would be to create a curated repository of asset models for industrial equipment, ideally maintained by manufacturers themselves. Much like we have the constructs library with reusable patterns we could have a one-stop-shop for asset models.

Closing this ticket. We believe the functionality is beneficial, but does not intersect with the core framework and should be vended and maintained separately.