aws-cdk-lib.aws_iotsitewise.CfnAssetModel.AssetModelCompositeModelProperty

interface AssetModelCompositeModelProperty

LanguageType name
.NETAmazon.CDK.AWS.IoTSiteWise.CfnAssetModel.AssetModelCompositeModelProperty
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsiotsitewise#CfnAssetModel_AssetModelCompositeModelProperty
Javasoftware.amazon.awscdk.services.iotsitewise.CfnAssetModel.AssetModelCompositeModelProperty
Pythonaws_cdk.aws_iotsitewise.CfnAssetModel.AssetModelCompositeModelProperty
TypeScript aws-cdk-lib » aws_iotsitewise » CfnAssetModel » AssetModelCompositeModelProperty

Contains information about a composite model in an asset model.

This object contains the asset property definitions that you define in the composite model. You can use composite asset models to define alarms on this asset model.

If you use the AssetModelCompositeModel property to create an alarm, you must use the following information to define three asset model properties:

  • Use an asset model property to specify the alarm type.

  • The name must be AWS/ALARM_TYPE .

  • The data type must be STRING .

  • For the Type property, the type name must be Attribute and the default value must be IOT_EVENTS .

  • Use an asset model property to specify the alarm source.

  • The name must be AWS/ALARM_SOURCE .

  • The data type must be STRING .

  • For the Type property, the type name must be Attribute and the default value must be the ARN of the alarm model that you created in AWS IoT Events .

For the ARN of the alarm model, you can use the Fn::Sub intrinsic function to substitute the AWS::Partition , AWS::Region , and AWS::AccountId variables in an input string with values that you specify.

For example, Fn::Sub: "arn:${AWS::Partition}:iotevents:${AWS::Region}:${AWS::AccountId}:alarmModel/TestAlarmModel" .

Replace TestAlarmModel with the name of your alarm model.

For more information about using the Fn::Sub intrinsic function, see Fn::Sub .

  • Use an asset model property to specify the state of the alarm.

  • The name must be AWS/ALARM_STATE .

  • The data type must be STRUCT .

  • The DataTypeSpec value must be AWS/ALARM_STATE .

  • For the Type property, the type name must be Measurement .

At the bottom of this page, we provide a YAML example that you can modify to create an alarm.

Example

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_iotsitewise as iotsitewise } from 'aws-cdk-lib';
const assetModelCompositeModelProperty: iotsitewise.CfnAssetModel.AssetModelCompositeModelProperty = {
  name: 'name',
  type: 'type',

  // the properties below are optional
  compositeModelProperties: [{
    dataType: 'dataType',
    logicalId: 'logicalId',
    name: 'name',
    type: {
      typeName: 'typeName',

      // the properties below are optional
      attribute: {
        defaultValue: 'defaultValue',
      },
      metric: {
        expression: 'expression',
        variables: [{
          name: 'name',
          value: {
            propertyLogicalId: 'propertyLogicalId',

            // the properties below are optional
            hierarchyLogicalId: 'hierarchyLogicalId',
          },
        }],
        window: {
          tumbling: {
            interval: 'interval',

            // the properties below are optional
            offset: 'offset',
          },
        },
      },
      transform: {
        expression: 'expression',
        variables: [{
          name: 'name',
          value: {
            propertyLogicalId: 'propertyLogicalId',

            // the properties below are optional
            hierarchyLogicalId: 'hierarchyLogicalId',
          },
        }],
      },
    },

    // the properties below are optional
    dataTypeSpec: 'dataTypeSpec',
    unit: 'unit',
  }],
  description: 'description',
};

Properties

NameTypeDescription
namestringThe name of the composite model.
typestringThe type of the composite model.
compositeModelProperties?IResolvable | IResolvable | AssetModelPropertyProperty[]The asset property definitions for this composite model.
description?stringThe description of the composite model.

name

Type: string

The name of the composite model.


type

Type: string

The type of the composite model.

For alarm composite models, this type is AWS/ALARM .


compositeModelProperties?

Type: IResolvable | IResolvable | AssetModelPropertyProperty[] (optional)

The asset property definitions for this composite model.


description?

Type: string (optional)

The description of the composite model.