AWS::IoTSiteWise::AssetModel AssetModelCompositeModel
Contains information about a composite model in an asset model. This object contains the asset property definitions that you define in the composite model.
Syntax
To declare this entity in your AWS CloudFormation template, use the following syntax:
JSON
{ "ComposedAssetModelId" :
String
, "CompositeModelProperties" :[ AssetModelProperty, ... ]
, "Description" :String
, "ExternalId" :String
, "Id" :String
, "Name" :String
, "ParentAssetModelCompositeModelExternalId" :String
, "Path" :[ String, ... ]
, "Type" :String
}
YAML
ComposedAssetModelId:
String
CompositeModelProperties:- AssetModelProperty
Description:String
ExternalId:String
Id:String
Name:String
ParentAssetModelCompositeModelExternalId:String
Path:- String
Type:String
Properties
ComposedAssetModelId
-
The ID of a component model which is reused to create this composite model.
Required: No
Type: String
Update requires: No interruption
CompositeModelProperties
-
The asset property definitions for this composite model.
Required: No
Type: Array of AssetModelProperty
Update requires: No interruption
Description
-
The description of the composite model.
Note
If the composite model is a
component-model-based
composite model, the description is inherited from theCOMPONENT_MODEL
asset model and cannot be changed.Required: No
Type: String
Update requires: No interruption
ExternalId
-
The external ID of a composite model on this asset model. For more information, see Using external IDs in the AWS IoT SiteWise User Guide.
Note
One of
ExternalId
orPath
must be specified.Required: No
Type: String
Pattern:
[a-zA-Z0-9_][a-zA-Z_\-0-9.:]*[a-zA-Z0-9_]+
Minimum:
2
Maximum:
128
Update requires: No interruption
Id
-
The ID of the asset model composite model.
Note
This is a return value and can't be set.
Required: No
Type: String
Pattern:
^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
Minimum:
36
Maximum:
36
Update requires: No interruption
Name
-
The name of the composite model.
Required: Yes
Type: String
Update requires: No interruption
ParentAssetModelCompositeModelExternalId
-
The external ID of the parent composite model. For more information, see Using external IDs in the AWS IoT SiteWise User Guide.
Required: No
Type: String
Pattern:
[a-zA-Z0-9_][a-zA-Z_\-0-9.:]*[a-zA-Z0-9_]+
Minimum:
2
Maximum:
128
Update requires: No interruption
Path
-
The structured path to the property from the root of the asset using property names. Path is used as the ID if the asset model is a derived composite model.
Note
One of
ExternalId
orPath
must be specified.Required: No
Type: Array of String
Update requires: No interruption
Type
-
The type of the composite model. For alarm composite models, this type is
AWS/ALARM
.Required: Yes
Type: String
Update requires: No interruption
Examples
Create an alarm model
You can modify the following example to create an alarm model.
Note
Replace TestAlarmModel
with the name of your alarm model.
YAML
Resources: AssetModelWithAlarmCompositeModel: Type: AWS::IoTSiteWise::AssetModel Properties: AssetModelName: AssetModelWithValidAlarmCompositeModel AssetModelDescription: AssetModelWithValidAlarmCompositeModel AssetModelCompositeModels: - Description: compositeModel created by cfn Name: TestAlarmCompositeModel Type: AWS/ALARM CompositeModelProperties: - LogicalId: MyLogicalId_for_ALARM_TYPE_1 Name: AWS/ALARM_TYPE DataType: STRING Type: TypeName: Attribute Attribute: DefaultValue: IOT_EVENTS - LogicalId: MyLogicalId_for_ALARM_SOURCE_1 Name: AWS/ALARM_SOURCE DataType: STRING Type: TypeName: Attribute Attribute: DefaultValue: Fn::Sub: "arn:${AWS::Partition}:iotevents:${AWS::Region}:${AWS::AccountId}:alarmModel/TestAlarmModel" - LogicalId: MyLogicalId_for_ALARM_STATE_1 Name: AWS/ALARM_STATE DataType: STRUCT DataTypeSpec: AWS/ALARM_STATE Type: TypeName: Measurement
Create a component-model-based
composite model
You can modify the following example to create a
component-model-based
composite model.
YAML
Resources: MainAssetModel: Type: AWS::IoTSiteWise::AssetModel Properties: AssetModelExternalId: AssetModelName: AssetModelWithCustomComposites AssetModelDescription: Asset model with custom composite models AssetModelProperties: - Name: metric_property ExternalId: metric_property_external_id DataType: DOUBLE Type: TypeName: Transform Transform: Expression: abs(avgtemp) Variables: - Name: avgtemp Value: PropertyPath: - Name: AssetModelWithCustomComposites - Name: CompositeModel3 - Name: ComponentModel1CompositeModel - Name: ComponentModel2Property AssetModelCompositeModels: - ExternalId: CompositeModelExternalId1 Type: CUSTOM Name: CompositeModel1 CompositeModelProperties: - Name: CompositeModel1Property ExternalId: CompositeModel1PropertyExternalId DataType: DOUBLE Type: TypeName: Measurement - ExternalId: CompositeModelExternalId2 Type: CUSTOM Name: CompositeModel2 ParentAssetModelCompositeModelExternalId: CompositeModelExternalId1 CompositeModelProperties: - Name: CompositeModel2Property ExternalId: CompositeModel2PropertyExternalId DataType: DOUBLE Type: TypeName: Measurement - ExternalId: CompositeModelExternalId3 Type: CUSTOM Name: CompositeModel3 ComposedAssetModelId: !Ref ComponentModel1 - Path: - AssetModelWithCustomComposites - CompositeModel3 - ComponentModel1CompositeModel ExternalId: DerivedCompositeExternalId Type: CUSTOM Name: ComponentModel1CompositeModel CompositeModelProperties: - Name: ComponentModel2Property ExternalId: DerivedCompositePropertyExternalId DataType: DOUBLE Type: TypeName: Measurement ComponentModel1: Type: AWS::IoTSiteWise::AssetModel Properties: AssetModelExternalId: ComponentModel1ExternalId AssetModelType: COMPONENT_MODEL AssetModelName: ComponentModel1 AssetModelCompositeModels: - ExternalId: ComponentModel1CompositeModel ComposedAssetModelId: !Ref ComponentModel2 Name: ComponentModel1CompositeModel Type: CUSTOM ComponentModel2: Type: AWS::IoTSiteWise::AssetModel Properties: AssetModelExternalId: ComponentModel2ExternalId AssetModelType: COMPONENT_MODEL AssetModelName: ComponentModel2 AssetModelProperties: - Name: ComponentModel2Property ExternalId: ComponentModel2PropertyExternalId DataType: DOUBLE Type: TypeName: Measurement