interface AssetModelCompositeModelProperty
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.IoTSiteWise.CfnAssetModel.AssetModelCompositeModelProperty |
Java | software.amazon.awscdk.services.iotsitewise.CfnAssetModel.AssetModelCompositeModelProperty |
Python | aws_cdk.aws_iotsitewise.CfnAssetModel.AssetModelCompositeModelProperty |
TypeScript | @aws-cdk/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 beAttribute
and the default value must beIOT_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 beAttribute
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 theAWS::Partition
,AWS::Region
, andAWS::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 beAWS/ALARM_STATE
.For the
Type
property, the type name must beMeasurement
.
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 * as iotsitewise from '@aws-cdk/aws-iotsitewise';
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
Name | Type | Description |
---|---|---|
name | string | The name of the composite model. |
type | string | The type of the composite model. |
composite | IResolvable | IResolvable | Asset [] | The asset property definitions for this composite model. |
description? | string | The 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
|
Asset
[]
(optional)
The asset property definitions for this composite model.
description?
Type:
string
(optional)
The description of the composite model.