Skip to content
v2.278.0

CfnAssetModel L1 construct ​

Creates an asset model from specified property and hierarchy definitions.

You create assets from asset models. With asset models, you can easily create assets of the same type that have standardized definitions. Each asset created from a model inherits the asset model's property and hierarchy definitions. For more information, see Defining asset models in the AWS IoT SiteWise User Guide .

You can create three types of asset models, ASSET_MODEL , COMPONENT_MODEL , or an INTERFACE .

  • ASSET_MODEL – (default) An asset model that you can use to create assets. Can't be included as a component in another asset model.
  • COMPONENT_MODEL – A reusable component that you can include in the composite models of other asset models. You can't create assets directly from this type of asset model.
  • INTERFACE – An interface is a type of model that defines a standard structure that can be applied to different asset models.

Example ​

ts
// 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 cfnAssetModel = new iotsitewise.CfnAssetModel(this, 'MyCfnAssetModel', {
  assetModelName: 'assetModelName',

  // the properties below are optional
  assetModelCompositeModels: [{
    name: 'name',
    type: 'type',

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

        // the properties below are optional
        attribute: {
          defaultValue: 'defaultValue',
        },
        metric: {
          expression: 'expression',
          variables: [{
            name: 'name',
            value: {
              hierarchyExternalId: 'hierarchyExternalId',
              hierarchyId: 'hierarchyId',
              hierarchyLogicalId: 'hierarchyLogicalId',
              propertyExternalId: 'propertyExternalId',
              propertyId: 'propertyId',
              propertyLogicalId: 'propertyLogicalId',
              propertyPath: [{
                name: 'name',
              }],
            },
          }],
          window: {
            tumbling: {
              interval: 'interval',

              // the properties below are optional
              offset: 'offset',
            },
          },
        },
        transform: {
          expression: 'expression',
          variables: [{
            name: 'name',
            value: {
              hierarchyExternalId: 'hierarchyExternalId',
              hierarchyId: 'hierarchyId',
              hierarchyLogicalId: 'hierarchyLogicalId',
              propertyExternalId: 'propertyExternalId',
              propertyId: 'propertyId',
              propertyLogicalId: 'propertyLogicalId',
              propertyPath: [{
                name: 'name',
              }],
            },
          }],
        },
      },

      // the properties below are optional
      dataTypeSpec: 'dataTypeSpec',
      externalId: 'externalId',
      id: 'id',
      logicalId: 'logicalId',
      unit: 'unit',
    }],
    description: 'description',
    externalId: 'externalId',
    id: 'id',
    parentAssetModelCompositeModelExternalId: 'parentAssetModelCompositeModelExternalId',
    path: ['path'],
  }],
  assetModelDescription: 'assetModelDescription',
  assetModelExternalId: 'assetModelExternalId',
  assetModelHierarchies: [{
    childAssetModelId: 'childAssetModelId',
    name: 'name',

    // the properties below are optional
    externalId: 'externalId',
    id: 'id',
    logicalId: 'logicalId',
  }],
  assetModelProperties: [{
    dataType: 'dataType',
    name: 'name',
    type: {
      typeName: 'typeName',

      // the properties below are optional
      attribute: {
        defaultValue: 'defaultValue',
      },
      metric: {
        expression: 'expression',
        variables: [{
          name: 'name',
          value: {
            hierarchyExternalId: 'hierarchyExternalId',
            hierarchyId: 'hierarchyId',
            hierarchyLogicalId: 'hierarchyLogicalId',
            propertyExternalId: 'propertyExternalId',
            propertyId: 'propertyId',
            propertyLogicalId: 'propertyLogicalId',
            propertyPath: [{
              name: 'name',
            }],
          },
        }],
        window: {
          tumbling: {
            interval: 'interval',

            // the properties below are optional
            offset: 'offset',
          },
        },
      },
      transform: {
        expression: 'expression',
        variables: [{
          name: 'name',
          value: {
            hierarchyExternalId: 'hierarchyExternalId',
            hierarchyId: 'hierarchyId',
            hierarchyLogicalId: 'hierarchyLogicalId',
            propertyExternalId: 'propertyExternalId',
            propertyId: 'propertyId',
            propertyLogicalId: 'propertyLogicalId',
            propertyPath: [{
              name: 'name',
            }],
          },
        }],
      },
    },

    // the properties below are optional
    dataTypeSpec: 'dataTypeSpec',
    externalId: 'externalId',
    id: 'id',
    logicalId: 'logicalId',
    unit: 'unit',
  }],
  assetModelType: 'assetModelType',
  enforcedAssetModelInterfaceRelationships: [{
    interfaceAssetModelId: 'interfaceAssetModelId',
    propertyMappings: [{
      interfaceAssetModelPropertyExternalId: 'interfaceAssetModelPropertyExternalId',

      // the properties below are optional
      assetModelPropertyExternalId: 'assetModelPropertyExternalId',
      assetModelPropertyLogicalId: 'assetModelPropertyLogicalId',
    }],
  }],
  tags: [{
    key: 'key',
    value: 'value',
  }],
});
python
from aws_cdk import CfnTag
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_iotsitewise as iotsitewise

cfn_asset_model = iotsitewise.CfnAssetModel(self, "MyCfnAssetModel",
    asset_model_name="assetModelName",

    # the properties below are optional
    asset_model_composite_models=[iotsitewise.CfnAssetModel.AssetModelCompositeModelProperty(
        name="name",
        type="type",

        # the properties below are optional
        composed_asset_model_id="composedAssetModelId",
        composite_model_properties=[iotsitewise.CfnAssetModel.AssetModelPropertyProperty(
            data_type="dataType",
            name="name",
            type=iotsitewise.CfnAssetModel.PropertyTypeProperty(
                type_name="typeName",

                # the properties below are optional
                attribute=iotsitewise.CfnAssetModel.AttributeProperty(
                    default_value="defaultValue"
                ),
                metric=iotsitewise.CfnAssetModel.MetricProperty(
                    expression="expression",
                    variables=[iotsitewise.CfnAssetModel.ExpressionVariableProperty(
                        name="name",
                        value=iotsitewise.CfnAssetModel.VariableValueProperty(
                            hierarchy_external_id="hierarchyExternalId",
                            hierarchy_id="hierarchyId",
                            hierarchy_logical_id="hierarchyLogicalId",
                            property_external_id="propertyExternalId",
                            property_id="propertyId",
                            property_logical_id="propertyLogicalId",
                            property_path=[iotsitewise.CfnAssetModel.PropertyPathDefinitionProperty(
                                name="name"
                            )]
                        )
                    )],
                    window=iotsitewise.CfnAssetModel.MetricWindowProperty(
                        tumbling=iotsitewise.CfnAssetModel.TumblingWindowProperty(
                            interval="interval",

                            # the properties below are optional
                            offset="offset"
                        )
                    )
                ),
                transform=iotsitewise.CfnAssetModel.TransformProperty(
                    expression="expression",
                    variables=[iotsitewise.CfnAssetModel.ExpressionVariableProperty(
                        name="name",
                        value=iotsitewise.CfnAssetModel.VariableValueProperty(
                            hierarchy_external_id="hierarchyExternalId",
                            hierarchy_id="hierarchyId",
                            hierarchy_logical_id="hierarchyLogicalId",
                            property_external_id="propertyExternalId",
                            property_id="propertyId",
                            property_logical_id="propertyLogicalId",
                            property_path=[iotsitewise.CfnAssetModel.PropertyPathDefinitionProperty(
                                name="name"
                            )]
                        )
                    )]
                )
            ),

            # the properties below are optional
            data_type_spec="dataTypeSpec",
            external_id="externalId",
            id="id",
            logical_id="logicalId",
            unit="unit"
        )],
        description="description",
        external_id="externalId",
        id="id",
        parent_asset_model_composite_model_external_id="parentAssetModelCompositeModelExternalId",
        path=["path"]
    )],
    asset_model_description="assetModelDescription",
    asset_model_external_id="assetModelExternalId",
    asset_model_hierarchies=[iotsitewise.CfnAssetModel.AssetModelHierarchyProperty(
        child_asset_model_id="childAssetModelId",
        name="name",

        # the properties below are optional
        external_id="externalId",
        id="id",
        logical_id="logicalId"
    )],
    asset_model_properties=[iotsitewise.CfnAssetModel.AssetModelPropertyProperty(
        data_type="dataType",
        name="name",
        type=iotsitewise.CfnAssetModel.PropertyTypeProperty(
            type_name="typeName",

            # the properties below are optional
            attribute=iotsitewise.CfnAssetModel.AttributeProperty(
                default_value="defaultValue"
            ),
            metric=iotsitewise.CfnAssetModel.MetricProperty(
                expression="expression",
                variables=[iotsitewise.CfnAssetModel.ExpressionVariableProperty(
                    name="name",
                    value=iotsitewise.CfnAssetModel.VariableValueProperty(
                        hierarchy_external_id="hierarchyExternalId",
                        hierarchy_id="hierarchyId",
                        hierarchy_logical_id="hierarchyLogicalId",
                        property_external_id="propertyExternalId",
                        property_id="propertyId",
                        property_logical_id="propertyLogicalId",
                        property_path=[iotsitewise.CfnAssetModel.PropertyPathDefinitionProperty(
                            name="name"
                        )]
                    )
                )],
                window=iotsitewise.CfnAssetModel.MetricWindowProperty(
                    tumbling=iotsitewise.CfnAssetModel.TumblingWindowProperty(
                        interval="interval",

                        # the properties below are optional
                        offset="offset"
                    )
                )
            ),
            transform=iotsitewise.CfnAssetModel.TransformProperty(
                expression="expression",
                variables=[iotsitewise.CfnAssetModel.ExpressionVariableProperty(
                    name="name",
                    value=iotsitewise.CfnAssetModel.VariableValueProperty(
                        hierarchy_external_id="hierarchyExternalId",
                        hierarchy_id="hierarchyId",
                        hierarchy_logical_id="hierarchyLogicalId",
                        property_external_id="propertyExternalId",
                        property_id="propertyId",
                        property_logical_id="propertyLogicalId",
                        property_path=[iotsitewise.CfnAssetModel.PropertyPathDefinitionProperty(
                            name="name"
                        )]
                    )
                )]
            )
        ),

        # the properties below are optional
        data_type_spec="dataTypeSpec",
        external_id="externalId",
        id="id",
        logical_id="logicalId",
        unit="unit"
    )],
    asset_model_type="assetModelType",
    enforced_asset_model_interface_relationships=[iotsitewise.CfnAssetModel.EnforcedAssetModelInterfaceRelationshipProperty(
        interface_asset_model_id="interfaceAssetModelId",
        property_mappings=[iotsitewise.CfnAssetModel.EnforcedAssetModelInterfacePropertyMappingProperty(
            interface_asset_model_property_external_id="interfaceAssetModelPropertyExternalId",

            # the properties below are optional
            asset_model_property_external_id="assetModelPropertyExternalId",
            asset_model_property_logical_id="assetModelPropertyLogicalId"
        )]
    )],
    tags=[CfnTag(
        key="key",
        value="value"
    )]
)
java
// 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.*;

CfnAssetModel cfnAssetModel = CfnAssetModel.Builder.create(this, "MyCfnAssetModel")
        .assetModelName("assetModelName")

        // the properties below are optional
        .assetModelCompositeModels(List.of(AssetModelCompositeModelProperty.builder()
                .name("name")
                .type("type")

                // the properties below are optional
                .composedAssetModelId("composedAssetModelId")
                .compositeModelProperties(List.of(AssetModelPropertyProperty.builder()
                        .dataType("dataType")
                        .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()
                                                        .hierarchyExternalId("hierarchyExternalId")
                                                        .hierarchyId("hierarchyId")
                                                        .hierarchyLogicalId("hierarchyLogicalId")
                                                        .propertyExternalId("propertyExternalId")
                                                        .propertyId("propertyId")
                                                        .propertyLogicalId("propertyLogicalId")
                                                        .propertyPath(List.of(PropertyPathDefinitionProperty.builder()
                                                                .name("name")
                                                                .build()))
                                                        .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()
                                                        .hierarchyExternalId("hierarchyExternalId")
                                                        .hierarchyId("hierarchyId")
                                                        .hierarchyLogicalId("hierarchyLogicalId")
                                                        .propertyExternalId("propertyExternalId")
                                                        .propertyId("propertyId")
                                                        .propertyLogicalId("propertyLogicalId")
                                                        .propertyPath(List.of(PropertyPathDefinitionProperty.builder()
                                                                .name("name")
                                                                .build()))
                                                        .build())
                                                .build()))
                                        .build())
                                .build())

                        // the properties below are optional
                        .dataTypeSpec("dataTypeSpec")
                        .externalId("externalId")
                        .id("id")
                        .logicalId("logicalId")
                        .unit("unit")
                        .build()))
                .description("description")
                .externalId("externalId")
                .id("id")
                .parentAssetModelCompositeModelExternalId("parentAssetModelCompositeModelExternalId")
                .path(List.of("path"))
                .build()))
        .assetModelDescription("assetModelDescription")
        .assetModelExternalId("assetModelExternalId")
        .assetModelHierarchies(List.of(AssetModelHierarchyProperty.builder()
                .childAssetModelId("childAssetModelId")
                .name("name")

                // the properties below are optional
                .externalId("externalId")
                .id("id")
                .logicalId("logicalId")
                .build()))
        .assetModelProperties(List.of(AssetModelPropertyProperty.builder()
                .dataType("dataType")
                .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()
                                                .hierarchyExternalId("hierarchyExternalId")
                                                .hierarchyId("hierarchyId")
                                                .hierarchyLogicalId("hierarchyLogicalId")
                                                .propertyExternalId("propertyExternalId")
                                                .propertyId("propertyId")
                                                .propertyLogicalId("propertyLogicalId")
                                                .propertyPath(List.of(PropertyPathDefinitionProperty.builder()
                                                        .name("name")
                                                        .build()))
                                                .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()
                                                .hierarchyExternalId("hierarchyExternalId")
                                                .hierarchyId("hierarchyId")
                                                .hierarchyLogicalId("hierarchyLogicalId")
                                                .propertyExternalId("propertyExternalId")
                                                .propertyId("propertyId")
                                                .propertyLogicalId("propertyLogicalId")
                                                .propertyPath(List.of(PropertyPathDefinitionProperty.builder()
                                                        .name("name")
                                                        .build()))
                                                .build())
                                        .build()))
                                .build())
                        .build())

                // the properties below are optional
                .dataTypeSpec("dataTypeSpec")
                .externalId("externalId")
                .id("id")
                .logicalId("logicalId")
                .unit("unit")
                .build()))
        .assetModelType("assetModelType")
        .enforcedAssetModelInterfaceRelationships(List.of(EnforcedAssetModelInterfaceRelationshipProperty.builder()
                .interfaceAssetModelId("interfaceAssetModelId")
                .propertyMappings(List.of(EnforcedAssetModelInterfacePropertyMappingProperty.builder()
                        .interfaceAssetModelPropertyExternalId("interfaceAssetModelPropertyExternalId")

                        // the properties below are optional
                        .assetModelPropertyExternalId("assetModelPropertyExternalId")
                        .assetModelPropertyLogicalId("assetModelPropertyLogicalId")
                        .build()))
                .build()))
        .tags(List.of(CfnTag.builder()
                .key("key")
                .value("value")
                .build()))
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.IoTSiteWise;

var cfnAssetModel = new CfnAssetModel(this, "MyCfnAssetModel", new CfnAssetModelProps {
    AssetModelName = "assetModelName",

    // the properties below are optional
    AssetModelCompositeModels = new [] { new AssetModelCompositeModelProperty {
        Name = "name",
        Type = "type",

        // the properties below are optional
        ComposedAssetModelId = "composedAssetModelId",
        CompositeModelProperties = new [] { new AssetModelPropertyProperty {
            DataType = "dataType",
            Name = "name",
            Type = new PropertyTypeProperty {
                TypeName = "typeName",

                // the properties below are optional
                Attribute = new AttributeProperty {
                    DefaultValue = "defaultValue"
                },
                Metric = new MetricProperty {
                    Expression = "expression",
                    Variables = new [] { new ExpressionVariableProperty {
                        Name = "name",
                        Value = new VariableValueProperty {
                            HierarchyExternalId = "hierarchyExternalId",
                            HierarchyId = "hierarchyId",
                            HierarchyLogicalId = "hierarchyLogicalId",
                            PropertyExternalId = "propertyExternalId",
                            PropertyId = "propertyId",
                            PropertyLogicalId = "propertyLogicalId",
                            PropertyPath = new [] { new PropertyPathDefinitionProperty {
                                Name = "name"
                            } }
                        }
                    } },
                    Window = new MetricWindowProperty {
                        Tumbling = new TumblingWindowProperty {
                            Interval = "interval",

                            // the properties below are optional
                            Offset = "offset"
                        }
                    }
                },
                Transform = new TransformProperty {
                    Expression = "expression",
                    Variables = new [] { new ExpressionVariableProperty {
                        Name = "name",
                        Value = new VariableValueProperty {
                            HierarchyExternalId = "hierarchyExternalId",
                            HierarchyId = "hierarchyId",
                            HierarchyLogicalId = "hierarchyLogicalId",
                            PropertyExternalId = "propertyExternalId",
                            PropertyId = "propertyId",
                            PropertyLogicalId = "propertyLogicalId",
                            PropertyPath = new [] { new PropertyPathDefinitionProperty {
                                Name = "name"
                            } }
                        }
                    } }
                }
            },

            // the properties below are optional
            DataTypeSpec = "dataTypeSpec",
            ExternalId = "externalId",
            Id = "id",
            LogicalId = "logicalId",
            Unit = "unit"
        } },
        Description = "description",
        ExternalId = "externalId",
        Id = "id",
        ParentAssetModelCompositeModelExternalId = "parentAssetModelCompositeModelExternalId",
        Path = new [] { "path" }
    } },
    AssetModelDescription = "assetModelDescription",
    AssetModelExternalId = "assetModelExternalId",
    AssetModelHierarchies = new [] { new AssetModelHierarchyProperty {
        ChildAssetModelId = "childAssetModelId",
        Name = "name",

        // the properties below are optional
        ExternalId = "externalId",
        Id = "id",
        LogicalId = "logicalId"
    } },
    AssetModelProperties = new [] { new AssetModelPropertyProperty {
        DataType = "dataType",
        Name = "name",
        Type = new PropertyTypeProperty {
            TypeName = "typeName",

            // the properties below are optional
            Attribute = new AttributeProperty {
                DefaultValue = "defaultValue"
            },
            Metric = new MetricProperty {
                Expression = "expression",
                Variables = new [] { new ExpressionVariableProperty {
                    Name = "name",
                    Value = new VariableValueProperty {
                        HierarchyExternalId = "hierarchyExternalId",
                        HierarchyId = "hierarchyId",
                        HierarchyLogicalId = "hierarchyLogicalId",
                        PropertyExternalId = "propertyExternalId",
                        PropertyId = "propertyId",
                        PropertyLogicalId = "propertyLogicalId",
                        PropertyPath = new [] { new PropertyPathDefinitionProperty {
                            Name = "name"
                        } }
                    }
                } },
                Window = new MetricWindowProperty {
                    Tumbling = new TumblingWindowProperty {
                        Interval = "interval",

                        // the properties below are optional
                        Offset = "offset"
                    }
                }
            },
            Transform = new TransformProperty {
                Expression = "expression",
                Variables = new [] { new ExpressionVariableProperty {
                    Name = "name",
                    Value = new VariableValueProperty {
                        HierarchyExternalId = "hierarchyExternalId",
                        HierarchyId = "hierarchyId",
                        HierarchyLogicalId = "hierarchyLogicalId",
                        PropertyExternalId = "propertyExternalId",
                        PropertyId = "propertyId",
                        PropertyLogicalId = "propertyLogicalId",
                        PropertyPath = new [] { new PropertyPathDefinitionProperty {
                            Name = "name"
                        } }
                    }
                } }
            }
        },

        // the properties below are optional
        DataTypeSpec = "dataTypeSpec",
        ExternalId = "externalId",
        Id = "id",
        LogicalId = "logicalId",
        Unit = "unit"
    } },
    AssetModelType = "assetModelType",
    EnforcedAssetModelInterfaceRelationships = new [] { new EnforcedAssetModelInterfaceRelationshipProperty {
        InterfaceAssetModelId = "interfaceAssetModelId",
        PropertyMappings = new [] { new EnforcedAssetModelInterfacePropertyMappingProperty {
            InterfaceAssetModelPropertyExternalId = "interfaceAssetModelPropertyExternalId",

            // the properties below are optional
            AssetModelPropertyExternalId = "assetModelPropertyExternalId",
            AssetModelPropertyLogicalId = "assetModelPropertyLogicalId"
        } }
    } },
    Tags = new [] { new CfnTag {
        Key = "key",
        Value = "value"
    } }
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnAssetModel := awscdk.Aws_iotsitewise.NewCfnAssetModel(this, jsii.String("MyCfnAssetModel"), &CfnAssetModelProps{
	AssetModelName: jsii.String("assetModelName"),

	// the properties below are optional
	AssetModelCompositeModels: []interface{}{
		&AssetModelCompositeModelProperty{
			Name: jsii.String("name"),
			Type: jsii.String("type"),

			// the properties below are optional
			ComposedAssetModelId: jsii.String("composedAssetModelId"),
			CompositeModelProperties: []interface{}{
				&AssetModelPropertyProperty{
					DataType: jsii.String("dataType"),
					Name: jsii.String("name"),
					Type: &PropertyTypeProperty{
						TypeName: jsii.String("typeName"),

						// the properties below are optional
						Attribute: &AttributeProperty{
							DefaultValue: jsii.String("defaultValue"),
						},
						Metric: &MetricProperty{
							Expression: jsii.String("expression"),
							Variables: []interface{}{
								&ExpressionVariableProperty{
									Name: jsii.String("name"),
									Value: &VariableValueProperty{
										HierarchyExternalId: jsii.String("hierarchyExternalId"),
										HierarchyId: jsii.String("hierarchyId"),
										HierarchyLogicalId: jsii.String("hierarchyLogicalId"),
										PropertyExternalId: jsii.String("propertyExternalId"),
										PropertyId: jsii.String("propertyId"),
										PropertyLogicalId: jsii.String("propertyLogicalId"),
										PropertyPath: []interface{}{
											&PropertyPathDefinitionProperty{
												Name: jsii.String("name"),
											},
										},
									},
								},
							},
							Window: &MetricWindowProperty{
								Tumbling: &TumblingWindowProperty{
									Interval: jsii.String("interval"),

									// the properties below are optional
									Offset: jsii.String("offset"),
								},
							},
						},
						Transform: &TransformProperty{
							Expression: jsii.String("expression"),
							Variables: []interface{}{
								&ExpressionVariableProperty{
									Name: jsii.String("name"),
									Value: &VariableValueProperty{
										HierarchyExternalId: jsii.String("hierarchyExternalId"),
										HierarchyId: jsii.String("hierarchyId"),
										HierarchyLogicalId: jsii.String("hierarchyLogicalId"),
										PropertyExternalId: jsii.String("propertyExternalId"),
										PropertyId: jsii.String("propertyId"),
										PropertyLogicalId: jsii.String("propertyLogicalId"),
										PropertyPath: []interface{}{
											&PropertyPathDefinitionProperty{
												Name: jsii.String("name"),
											},
										},
									},
								},
							},
						},
					},

					// the properties below are optional
					DataTypeSpec: jsii.String("dataTypeSpec"),
					ExternalId: jsii.String("externalId"),
					Id: jsii.String("id"),
					LogicalId: jsii.String("logicalId"),
					Unit: jsii.String("unit"),
				},
			},
			Description: jsii.String("description"),
			ExternalId: jsii.String("externalId"),
			Id: jsii.String("id"),
			ParentAssetModelCompositeModelExternalId: jsii.String("parentAssetModelCompositeModelExternalId"),
			Path: []*string{
				jsii.String("path"),
			},
		},
	},
	AssetModelDescription: jsii.String("assetModelDescription"),
	AssetModelExternalId: jsii.String("assetModelExternalId"),
	AssetModelHierarchies: []interface{}{
		&AssetModelHierarchyProperty{
			ChildAssetModelId: jsii.String("childAssetModelId"),
			Name: jsii.String("name"),

			// the properties below are optional
			ExternalId: jsii.String("externalId"),
			Id: jsii.String("id"),
			LogicalId: jsii.String("logicalId"),
		},
	},
	AssetModelProperties: []interface{}{
		&AssetModelPropertyProperty{
			DataType: jsii.String("dataType"),
			Name: jsii.String("name"),
			Type: &PropertyTypeProperty{
				TypeName: jsii.String("typeName"),

				// the properties below are optional
				Attribute: &AttributeProperty{
					DefaultValue: jsii.String("defaultValue"),
				},
				Metric: &MetricProperty{
					Expression: jsii.String("expression"),
					Variables: []interface{}{
						&ExpressionVariableProperty{
							Name: jsii.String("name"),
							Value: &VariableValueProperty{
								HierarchyExternalId: jsii.String("hierarchyExternalId"),
								HierarchyId: jsii.String("hierarchyId"),
								HierarchyLogicalId: jsii.String("hierarchyLogicalId"),
								PropertyExternalId: jsii.String("propertyExternalId"),
								PropertyId: jsii.String("propertyId"),
								PropertyLogicalId: jsii.String("propertyLogicalId"),
								PropertyPath: []interface{}{
									&PropertyPathDefinitionProperty{
										Name: jsii.String("name"),
									},
								},
							},
						},
					},
					Window: &MetricWindowProperty{
						Tumbling: &TumblingWindowProperty{
							Interval: jsii.String("interval"),

							// the properties below are optional
							Offset: jsii.String("offset"),
						},
					},
				},
				Transform: &TransformProperty{
					Expression: jsii.String("expression"),
					Variables: []interface{}{
						&ExpressionVariableProperty{
							Name: jsii.String("name"),
							Value: &VariableValueProperty{
								HierarchyExternalId: jsii.String("hierarchyExternalId"),
								HierarchyId: jsii.String("hierarchyId"),
								HierarchyLogicalId: jsii.String("hierarchyLogicalId"),
								PropertyExternalId: jsii.String("propertyExternalId"),
								PropertyId: jsii.String("propertyId"),
								PropertyLogicalId: jsii.String("propertyLogicalId"),
								PropertyPath: []interface{}{
									&PropertyPathDefinitionProperty{
										Name: jsii.String("name"),
									},
								},
							},
						},
					},
				},
			},

			// the properties below are optional
			DataTypeSpec: jsii.String("dataTypeSpec"),
			ExternalId: jsii.String("externalId"),
			Id: jsii.String("id"),
			LogicalId: jsii.String("logicalId"),
			Unit: jsii.String("unit"),
		},
	},
	AssetModelType: jsii.String("assetModelType"),
	EnforcedAssetModelInterfaceRelationships: []interface{}{
		&EnforcedAssetModelInterfaceRelationshipProperty{
			InterfaceAssetModelId: jsii.String("interfaceAssetModelId"),
			PropertyMappings: []interface{}{
				&EnforcedAssetModelInterfacePropertyMappingProperty{
					InterfaceAssetModelPropertyExternalId: jsii.String("interfaceAssetModelPropertyExternalId"),

					// the properties below are optional
					AssetModelPropertyExternalId: jsii.String("assetModelPropertyExternalId"),
					AssetModelPropertyLogicalId: jsii.String("assetModelPropertyLogicalId"),
				},
			},
		},
	},
	Tags: []CfnTag{
		&CfnTag{
			Key: jsii.String("key"),
			Value: jsii.String("value"),
		},
	},
})

Initializer ​

ts
new CfnAssetModel(scope: Construct, id: string, props: CfnAssetModelProps)
python
CfnAssetModel(scope: Construct, id: str, props: CfnAssetModelProps)
java
new CfnAssetModel(Construct scope, String id, CfnAssetModelProps props)
csharp
new CfnAssetModel(Construct scope, string id, CfnAssetModelProps props)
go
NewCfnAssetModel(Scope Construct, Id *string, Props CfnAssetModelProps)

Construct Props ​

assetModelCompositeModelsoptionalIResolvable | IResolvable | CfnAssetModel.AssetModelCompositeModelProperty[]asset_model_composite_modelsoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, AssetModelCompositeModelProperty]]]assetModelCompositeModelsoptionalIResolvableAssetModelCompositeModelsoptionalIResolvableAssetModelCompositeModelsoptionalinterface{} #
The composite models that are part of this asset model.
notes

It groups properties (such as attributes, measurements, transforms, and metrics) and child composite models that model parts of your industrial equipment. Each composite model has a type that defines the properties that the composite model supports. Use composite models to define alarms on this asset model.

When creating custom composite models, you need to use CreateAssetModelCompositeModel . For more information, see Creating custom composite models (Components) in the AWS IoT SiteWise User Guide .

assetModelDescriptionoptionalstringasset_model_descriptionoptionalstrassetModelDescriptionoptionalStringAssetModelDescriptionoptionalstringAssetModelDescriptionoptional*string #
A description for the asset model.
assetModelExternalIdoptionalstringasset_model_external_idoptionalstrassetModelExternalIdoptionalStringAssetModelExternalIdoptionalstringAssetModelExternalIdoptional*string #
The external ID of the asset model.

For more information, see Using external IDs in the AWS IoT SiteWise User Guide .

assetModelHierarchiesoptionalIResolvable | IResolvable | CfnAssetModel.AssetModelHierarchyProperty[]asset_model_hierarchiesoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, AssetModelHierarchyProperty]]]assetModelHierarchiesoptionalIResolvableAssetModelHierarchiesoptionalIResolvableAssetModelHierarchiesoptionalinterface{} #
The hierarchy definitions of the asset model.
notes

Each hierarchy specifies an asset model whose assets can be children of any other assets created from this asset model. For more information, see Asset hierarchies in the AWS IoT SiteWise User Guide .

You can specify up to 10 hierarchies per asset model. For more information, see Quotas in the AWS IoT SiteWise User Guide .

assetModelNamestringasset_model_namestrassetModelNameStringAssetModelNamestringAssetModelName*string required #
A unique name for the asset model.
assetModelPropertiesoptionalIResolvable | IResolvable | CfnAssetModel.AssetModelPropertyProperty[]asset_model_propertiesoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, AssetModelPropertyProperty]]]assetModelPropertiesoptionalIResolvableAssetModelPropertiesoptionalIResolvableAssetModelPropertiesoptionalinterface{} #
The property definitions of the asset model.
notes

For more information, see Asset properties in the AWS IoT SiteWise User Guide .

You can specify up to 200 properties per asset model. For more information, see Quotas in the AWS IoT SiteWise User Guide .

assetModelTypeoptionalstringasset_model_typeoptionalstrassetModelTypeoptionalStringAssetModelTypeoptionalstringAssetModelTypeoptional*string #
The type of asset model.
notes
  • ASSET_MODEL – (default) An asset model that you can use to create assets. Can't be included as a component in another asset model.
  • COMPONENT_MODEL – A reusable component that you can include in the composite models of other asset models. You can't create assets directly from this type of asset model.
  • INTERFACE – An interface is a type of model that defines a standard structure that can be applied to different asset models.
enforcedAssetModelInterfaceRelationshipsoptionalIResolvable | IResolvable | CfnAssetModel.EnforcedAssetModelInterfaceRelationshipProperty[]enforced_asset_model_interface_relationshipsoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, EnforcedAssetModelInterfaceRelationshipProperty]]]enforcedAssetModelInterfaceRelationshipsoptionalIResolvableEnforcedAssetModelInterfaceRelationshipsoptionalIResolvableEnforcedAssetModelInterfaceRelationshipsoptionalinterface{} #
a list of asset model and interface relationships.
tagsoptionalCfnTag[]tagsoptionaltyping.List[CfnTag]tagsoptionalList<CfnTag>TagsoptionalCfnTag[]Tagsoptional*[]CfnTag #
A list of key-value pairs that contain metadata for the asset.

For more information, see Tagging your AWS IoT SiteWise resources in the AWS IoT SiteWise User Guide .

Properties ​

assetModelCompositeModelsmay be undefinedIResolvable | IResolvable | CfnAssetModel.AssetModelCompositeModelProperty[]asset_model_composite_modelsmay be undefinedtyping.Union[IResolvable, typing.List[typing.Union[IResolvable, AssetModelCompositeModelProperty]]]assetModelCompositeModelsmay be undefinedIResolvableAssetModelCompositeModelsmay be undefinedIResolvableAssetModelCompositeModelsmay be undefinedinterface{} #
The composite models that are part of this asset model.
assetModelDescriptionmay be undefinedstringasset_model_descriptionmay be undefinedstrassetModelDescriptionmay be undefinedStringAssetModelDescriptionmay be undefinedstringAssetModelDescriptionmay be undefined*string #
A description for the asset model.
assetModelExternalIdmay be undefinedstringasset_model_external_idmay be undefinedstrassetModelExternalIdmay be undefinedStringAssetModelExternalIdmay be undefinedstringAssetModelExternalIdmay be undefined*string #
The external ID of the asset model.
assetModelHierarchiesmay be undefinedIResolvable | IResolvable | CfnAssetModel.AssetModelHierarchyProperty[]asset_model_hierarchiesmay be undefinedtyping.Union[IResolvable, typing.List[typing.Union[IResolvable, AssetModelHierarchyProperty]]]assetModelHierarchiesmay be undefinedIResolvableAssetModelHierarchiesmay be undefinedIResolvableAssetModelHierarchiesmay be undefinedinterface{} #
The hierarchy definitions of the asset model.
assetModelNamestringasset_model_namestrassetModelNameStringAssetModelNamestringAssetModelName*string #
A unique name for the asset model.
assetModelPropertiesmay be undefinedIResolvable | IResolvable | CfnAssetModel.AssetModelPropertyProperty[]asset_model_propertiesmay be undefinedtyping.Union[IResolvable, typing.List[typing.Union[IResolvable, AssetModelPropertyProperty]]]assetModelPropertiesmay be undefinedIResolvableAssetModelPropertiesmay be undefinedIResolvableAssetModelPropertiesmay be undefinedinterface{} #
The property definitions of the asset model.
assetModelRefAssetModelReferenceasset_model_refAssetModelReferenceassetModelRefAssetModelReferenceAssetModelRefAssetModelReferenceAssetModelRefAssetModelReference #
A reference to a AssetModel resource.
assetModelTypemay be undefinedstringasset_model_typemay be undefinedstrassetModelTypemay be undefinedStringAssetModelTypemay be undefinedstringAssetModelTypemay be undefined*string #
The type of asset model.
attrAssetModelArnstringattr_asset_model_arnstrattrAssetModelArnStringAttrAssetModelArnstringAttrAssetModelArn*string #
The ARN of the asset model, which has the following format.
attrAssetModelIdstringattr_asset_model_idstrattrAssetModelIdStringAttrAssetModelIdstringAttrAssetModelId*string #
The ID of the asset model.
CFN_RESOURCE_TYPE_NAMEstringCFN_RESOURCE_TYPE_NAMEstrCFN_RESOURCE_TYPE_NAMEStringCFN_RESOURCE_TYPE_NAMEstringCFN_RESOURCE_TYPE_NAME*string static #
The CloudFormation resource type name for this resource class.
Options for this resource, such as condition, update policy etc.
cfnResourceTypestringcfn_resource_typestrcfnResourceTypeStringCfnResourceTypestringCfnResourceType*string #
AWS resource type.
creationStackstring[]creation_stacktyping.List[str]creationStackList<String>CreationStackstring[]CreationStack*[]*string #
enforcedAssetModelInterfaceRelationshipsmay be undefinedIResolvable | IResolvable | CfnAssetModel.EnforcedAssetModelInterfaceRelationshipProperty[]enforced_asset_model_interface_relationshipsmay be undefinedtyping.Union[IResolvable, typing.List[typing.Union[IResolvable, EnforcedAssetModelInterfaceRelationshipProperty]]]enforcedAssetModelInterfaceRelationshipsmay be undefinedIResolvableEnforcedAssetModelInterfaceRelationshipsmay be undefinedIResolvableEnforcedAssetModelInterfaceRelationshipsmay be undefinedinterface{} #
a list of asset model and interface relationships.
logicalIdstringlogical_idstrlogicalIdStringLogicalIdstringLogicalId*string #
The logical ID for this CloudFormation stack element.

The logical ID of the element is calculated from the path of the resource node in the construct tree.

To override this value, use overrideLogicalId(newLogicalId).

nodeNodenodeNodenodeNodeNodeNodeNodeNode #
The tree node.
refstringrefstrrefStringRefstringRef*string #
Return a string that will be resolved to a CloudFormation `{ Ref }` for this element.

If, by any chance, the intrinsic reference of a resource is not a string, you could coerce it to an IResolvable through Lazy.any({ produce: resource.ref }).

stackStackstackStackstackStackStackStackStackStack #
The stack in which this element is defined.

CfnElements must be defined within a stack scope (directly or indirectly).

Tag Manager which manages the tags for this resource.
tagsRawmay be undefinedCfnTag[]tags_rawmay be undefinedtyping.List[CfnTag]tagsRawmay be undefinedList<CfnTag>TagsRawmay be undefinedCfnTag[]TagsRawmay be undefined*[]CfnTag #
A list of key-value pairs that contain metadata for the asset.

Methods ​

addDeletionOverride(path: string): voiddef add_deletion_override(self, path: str) -> Nonepublic void addDeletionOverride(String path)public void AddDeletionOverride(string path)func AddDeletionOverride(Path *string) #
Syntactic sugar for `addOverride(path, undefined)`.
1 parameter

Parameters

  • pathpathpathpathPath — The path of the value to delete.
addDependency(target: CfnResource): voiddef add_dependency(self, target: CfnResource) -> Nonepublic void addDependency(CfnResource target)public void AddDependency(CfnResource target)func AddDependency(Target CfnResource) deprecated #
Use `addResourceDependency` instead.

This method has been renamed to addResourceDependency to more clearly set it apart from construct.node.addDependency. See the documentation of that function for more details.

addDependsOn(target: CfnResource): voiddef add_depends_on(self, target: CfnResource) -> Nonepublic void addDependsOn(CfnResource target)public void AddDependsOn(CfnResource target)func AddDependsOn(Target CfnResource) deprecated #
Use `addResourceDependency` instead.
notes

This can be used for resources across stacks (or nested stack) boundaries and the dependency will automatically be transferred to the relevant scope.

This method has been renamed to addResourceDependency, which makes it more clear that this method operates at a different level from the construct-level construct.node.addDependency() mechanism.

addMetadata(key: string, value: any): voiddef add_metadata(self, key: str, value: Any) -> Nonepublic void addMetadata(String key, Object value)public void AddMetadata(string key, object value)func AddMetadata(Key *string, Value interface{}) #
Add a value to the CloudFormation Resource Metadata.
addOverride(path: string, value: any): voiddef add_override(self, path: str, value: Any) -> Nonepublic void addOverride(String path, Object value)public void AddOverride(string path, object value)func AddOverride(Path *string, Value interface{}) #
Adds an override to the synthesized CloudFormation resource.
notes · 2 parameters

To add a property override, either use addPropertyOverride or prefix path with "Properties." (i.e. Properties.TopicName).

If the override is nested, separate each nested level using a dot (.) in the path parameter. If there is an array as part of the nesting, specify the index in the path.

To include a literal . in the property name, prefix with a \. In most programming languages you will need to write this as "\\." because the \ itself will need to be escaped.

For example,

typescript
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');

would add the overrides

json
"Properties": {
  "GlobalSecondaryIndexes": [
    {
      "Projection": {
        "NonKeyAttributes": [ "myattribute" ]
        ...
      }
      ...
    },
    {
      "ProjectionType": "INCLUDE"
      ...
    },
  ]
  ...
}

The value argument to addOverride will not be processed or translated in any way. Pass raw JSON values in here with the correct capitalization for CloudFormation. If you pass CDK classes or structs, they will be rendered with lowercased key names, and CloudFormation will reject the template.

Parameters

  • pathpathpathpathPath — - The path of the property, you can use dot notation to override values in complex types.
  • valuevaluevaluevalueValue — - The value.
addPropertyDeletionOverride(propertyPath: string): voiddef add_property_deletion_override(self, property_path: str) -> Nonepublic void addPropertyDeletionOverride(String propertyPath)public void AddPropertyDeletionOverride(string propertyPath)func AddPropertyDeletionOverride(PropertyPath *string) #
Adds an override that deletes the value of a property from the resource definition.
1 parameter

Parameters

  • propertyPathproperty_pathpropertyPathpropertyPathPropertyPath — The path to the property.
addPropertyOverride(propertyPath: string, value: any): voiddef add_property_override(self, property_path: str, value: Any) -> Nonepublic void addPropertyOverride(String propertyPath, Object value)public void AddPropertyOverride(string propertyPath, object value)func AddPropertyOverride(PropertyPath *string, Value interface{}) #
Adds an override to a resource property.

Syntactic sugar for addOverride("Properties.<...>", value).

2 parameters

Parameters

  • propertyPathproperty_pathpropertyPathpropertyPathPropertyPath — The path of the property.
  • valuevaluevaluevalueValue — The value.
addResourceDependency(target: CfnResource, reason?: string): voiddef add_resource_dependency(self, target: CfnResource, reason: typing.Optional[str] = None) -> Nonepublic void addResourceDependency(CfnResource target, String reason)public void AddResourceDependency(CfnResource target, string? reason = null)func AddResourceDependency(Target CfnResource, Reason *string) #
Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
notes

This can be used for resources across stacks (or nested stack) boundaries and the dependency will automatically be transferred to the relevant scope.

This method only adds dependencies between L1 resources. If you are looking for a generic construct-to-construct dependency mechanism that works for all constructs including L2s, use construct.node.addDependency instead.

applyCrossStackReferenceStrength(strength: ReferenceStrength): voiddef apply_cross_stack_reference_strength(self, strength: ReferenceStrength) -> Nonepublic void applyCrossStackReferenceStrength(ReferenceStrength strength)public void ApplyCrossStackReferenceStrength(ReferenceStrength strength)func ApplyCrossStackReferenceStrength(Strength ReferenceStrength) #
Sets the cross-stack reference strength for this resource.

When set, any cross-stack reference to this resource will use the specified strength instead of the global default from the consuming stack's context.

1 parameter

Parameters

  • strengthstrengthstrengthstrengthStrength — - The reference strength to use for this resource.
applyRemovalPolicy(policy?: RemovalPolicy, options?: RemovalPolicyOptions): voiddef apply_removal_policy(self, policy: typing.Optional[RemovalPolicy] = None, options: typing.Optional[RemovalPolicyOptions] = None) -> Nonepublic void applyRemovalPolicy(RemovalPolicy policy, RemovalPolicyOptions options)public void ApplyRemovalPolicy(RemovalPolicy? policy = null, RemovalPolicyOptions? options = null)func ApplyRemovalPolicy(Policy RemovalPolicy, Options RemovalPolicyOptions) #
Sets the deletion policy of the resource based on the removal policy specified.
notes

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN). In some cases, a snapshot can be taken of the resource prior to deletion (RemovalPolicy.SNAPSHOT). A list of resources that support this policy can be found in the following link:

arnForAssetModel(resource: IAssetModelRef): string@staticmethod def arn_for_asset_model(resource: IAssetModelRef) -> strpublic static String arnForAssetModel(IAssetModelRef resource)public static string ArnForAssetModel(IAssetModelRef resource)func ArnForAssetModel(Resource IAssetModelRef) *string static #
cfnPropertyName(cdkPropertyName: string): stringdef cfn_property_name(self, cdk_property_name: str) -> strpublic String cfnPropertyName(String cdkPropertyName)public string CfnPropertyName(string cdkPropertyName)func CfnPropertyName(CdkPropertyName *string) *string #
fromAssetModelArn(scope: Construct, id: string, arn: string): IAssetModelRef@staticmethod def from_asset_model_arn(scope: Construct, id: str, arn: str) -> IAssetModelRefpublic static IAssetModelRef fromAssetModelArn(Construct scope, String id, String arn)public static IAssetModelRef FromAssetModelArn(Construct scope, string id, string arn)func FromAssetModelArn(Scope Construct, Id *string, Arn *string) IAssetModelRef static #
Creates a new IAssetModelRef from an ARN.
fromAssetModelId(scope: Construct, id: string, assetModelId: string): IAssetModelRef@staticmethod def from_asset_model_id(scope: Construct, id: str, asset_model_id: str) -> IAssetModelRefpublic static IAssetModelRef fromAssetModelId(Construct scope, String id, String assetModelId)public static IAssetModelRef FromAssetModelId(Construct scope, string id, string assetModelId)func FromAssetModelId(Scope Construct, Id *string, AssetModelId *string) IAssetModelRef static #
Creates a new IAssetModelRef from a assetModelId.
getAtt(attributeName: string, typeHint?: ResolutionTypeHint): Referencedef get_att(self, attribute_name: str, type_hint: typing.Optional[ResolutionTypeHint] = None) -> Referencepublic Reference getAtt(String attributeName, ResolutionTypeHint typeHint)public Reference GetAtt(string attributeName, ResolutionTypeHint? typeHint = null)func GetAtt(AttributeName *string, TypeHint ResolutionTypeHint) Reference #
Returns a token for an runtime attribute of this resource.

Ideally, use generated attribute accessors (e.g. resource.arn), but this can be used for future compatibility in case there is no generated attribute.

1 parameter

Parameters

  • attributeNameattribute_nameattributeNameattributeNameAttributeName — The name of the attribute.
getMetadata(key: string): anydef get_metadata(self, key: str) -> Anypublic Object getMetadata(String key)public object GetMetadata(string key)func GetMetadata(Key *string) interface{} #
Retrieve a value value from the CloudFormation Resource Metadata.
inspect(inspector: TreeInspector): voiddef inspect(self, inspector: TreeInspector) -> Nonepublic void inspect(TreeInspector inspector)public void Inspect(TreeInspector inspector)func Inspect(Inspector TreeInspector) #
Examines the CloudFormation resource and discloses attributes.
1 parameter

Parameters

  • inspectorinspectorinspectorinspectorInspector — tree inspector to collect and process attributes.
isCfnAssetModel(x: any): boolean@staticmethod def is_cfn_asset_model(x: Any) -> boolpublic static Boolean isCfnAssetModel(Object x)public static bool IsCfnAssetModel(object x)func IsCfnAssetModel(X interface{}) *bool static #
Checks whether the given object is a CfnAssetModel.
isCfnElement(x: any): boolean@staticmethod def is_cfn_element(x: Any) -> boolpublic static Boolean isCfnElement(Object x)public static bool IsCfnElement(object x)func IsCfnElement(X interface{}) *bool static #
Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).

Uses duck-typing instead of instanceof to allow stack elements from different versions of this library to be included in the same stack.

returns

Returns: The construct as a stack element or undefined if it is not a stack element.

isCfnResource(x: any): boolean@staticmethod def is_cfn_resource(x: Any) -> boolpublic static Boolean isCfnResource(Object x)public static bool IsCfnResource(object x)func IsCfnResource(X interface{}) *bool static #
Check whether the given object is a CfnResource.
isConstruct(x: any): boolean@staticmethod def is_construct(x: Any) -> boolpublic static Boolean isConstruct(Object x)public static bool IsConstruct(object x)func IsConstruct(X interface{}) *bool static #
Checks if `x` is a construct.
notes · 1 parameter · returns

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

Parameters

  • xxxxX — Any object.

Returns: true if x is an object created from a class which extends Construct.

obtainDependencies(): Stack | CfnResource[]def obtain_dependencies(self, ) -> typing.List[typing.Union[Stack, CfnResource]]public List<Stack> obtainDependencies()public Stack[] ObtainDependencies()func ObtainDependencies() *[]interface{} #
Retrieves an array of resources and stacks this resource depends on.

For resources depended on directly, returns the CfnResource object. For dependencies on other stacks, returns the Stack object. The order of the array is not guaranteed.

overrideLogicalId(newLogicalId: string): voiddef override_logical_id(self, new_logical_id: str) -> Nonepublic void overrideLogicalId(String newLogicalId)public void OverrideLogicalId(string newLogicalId)func OverrideLogicalId(NewLogicalId *string) #
Overrides the auto-generated logical ID with a specific ID.
1 parameter

Parameters

  • newLogicalIdnew_logical_idnewLogicalIdnewLogicalIdNewLogicalId — The new logical ID to use for this stack element.
removeDependency(target: CfnResource): voiddef remove_dependency(self, target: CfnResource) -> Nonepublic void removeDependency(CfnResource target)public void RemoveDependency(CfnResource target)func RemoveDependency(Target CfnResource) deprecated #
Use `removeResourceDependency` instead

This can be used for resources across stacks (including nested stacks) and the dependency will automatically be removed from the relevant scope.

removeResourceDependency(target: CfnResource): voiddef remove_resource_dependency(self, target: CfnResource) -> Nonepublic void removeResourceDependency(CfnResource target)public void RemoveResourceDependency(CfnResource target)func RemoveResourceDependency(Target CfnResource) #
Indicates that this resource no longer depends on another resource.

This can be used for resources across stacks (including nested stacks) and the dependency will automatically be removed from the relevant scope.

replaceDependency(target: CfnResource, newTarget: CfnResource): voiddef replace_dependency(self, target: CfnResource, new_target: CfnResource) -> Nonepublic void replaceDependency(CfnResource target, CfnResource newTarget)public void ReplaceDependency(CfnResource target, CfnResource newTarget)func ReplaceDependency(Target CfnResource, NewTarget CfnResource) #
Replaces one dependency with another.
2 parameters

Parameters

  • targettargettargettargetTarget — The dependency to replace.
  • newTargetnew_targetnewTargetnewTargetNewTarget — The new dependency to add.
toString(): stringdef to_string(self, ) -> strpublic String toString()public string ToString()func ToString() *string #
Returns a string representation of this construct.
returns

Returns: a string representation of this resource

with(...mixins: IMixin[]): IConstructdef with(self, mixins: IMixin) -> IConstructpublic IConstruct with(IMixin mixins)public IConstruct With(IMixin mixins)func With(Mixins IMixin) IConstruct #
Applies one or more mixins to this construct.

Mixins are applied in order. The list of constructs is captured at the start of the call, so constructs added by a mixin will not be visited. Use multiple with() calls if subsequent mixins should apply to added constructs.