public static interface CfnAssetModel.AssetModelCompositeModelProperty
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:
AWS/ALARM_TYPE
.STRING
.Type
property, the type name must be Attribute
and the default value must be IOT_EVENTS
.AWS/ALARM_SOURCE
.STRING
.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 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 .
AWS/ALARM_STATE
.STRUCT
.DataTypeSpec
value must be AWS/ALARM_STATE
.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 software.amazon.awscdk.services.iotsitewise.*; AssetModelCompositeModelProperty assetModelCompositeModelProperty = AssetModelCompositeModelProperty.builder() .name("name") .type("type") // the properties below are optional .compositeModelProperties(List.of(AssetModelPropertyProperty.builder() .dataType("dataType") .logicalId("logicalId") .name("name") .type(PropertyTypeProperty.builder() .typeName("typeName") // the properties below are optional .attribute(AttributeProperty.builder() .defaultValue("defaultValue") .build()) .metric(MetricProperty.builder() .expression("expression") .variables(List.of(ExpressionVariableProperty.builder() .name("name") .value(VariableValueProperty.builder() .propertyLogicalId("propertyLogicalId") // the properties below are optional .hierarchyLogicalId("hierarchyLogicalId") .build()) .build())) .window(MetricWindowProperty.builder() .tumbling(TumblingWindowProperty.builder() .interval("interval") // the properties below are optional .offset("offset") .build()) .build()) .build()) .transform(TransformProperty.builder() .expression("expression") .variables(List.of(ExpressionVariableProperty.builder() .name("name") .value(VariableValueProperty.builder() .propertyLogicalId("propertyLogicalId") // the properties below are optional .hierarchyLogicalId("hierarchyLogicalId") .build()) .build())) .build()) .build()) // the properties below are optional .dataTypeSpec("dataTypeSpec") .unit("unit") .build())) .description("description") .build();
Modifier and Type | Interface and Description |
---|---|
static class |
CfnAssetModel.AssetModelCompositeModelProperty.Builder
A builder for
CfnAssetModel.AssetModelCompositeModelProperty |
static class |
CfnAssetModel.AssetModelCompositeModelProperty.Jsii$Proxy
An implementation for
CfnAssetModel.AssetModelCompositeModelProperty |
Modifier and Type | Method and Description |
---|---|
static CfnAssetModel.AssetModelCompositeModelProperty.Builder |
builder() |
default java.lang.Object |
getCompositeModelProperties()
The asset property definitions for this composite model.
|
default java.lang.String |
getDescription()
The description of the composite model.
|
java.lang.String |
getName()
The name of the composite model.
|
java.lang.String |
getType()
The type of the composite model.
|
java.lang.String getName()
java.lang.String getType()
For alarm composite models, this type is AWS/ALARM
.
default java.lang.Object getCompositeModelProperties()
default java.lang.String getDescription()
static CfnAssetModel.AssetModelCompositeModelProperty.Builder builder()