Skip to content
v2.278.0

CfnAssetProps Struct ​

Properties for defining a CfnAsset.

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 cfnAssetProps: iotsitewise.CfnAssetProps = {
  assetModelId: 'assetModelId',
  assetName: 'assetName',

  // the properties below are optional
  assetDescription: 'assetDescription',
  assetExternalId: 'assetExternalId',
  assetHierarchies: [{
    childAssetId: 'childAssetId',

    // the properties below are optional
    externalId: 'externalId',
    id: 'id',
    logicalId: 'logicalId',
  }],
  assetProperties: [{
    alias: 'alias',
    externalId: 'externalId',
    id: 'id',
    logicalId: 'logicalId',
    notificationState: 'notificationState',
    unit: 'unit',
  }],
  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_props = iotsitewise.CfnAssetProps(
    asset_model_id="assetModelId",
    asset_name="assetName",

    # the properties below are optional
    asset_description="assetDescription",
    asset_external_id="assetExternalId",
    asset_hierarchies=[iotsitewise.CfnAsset.AssetHierarchyProperty(
        child_asset_id="childAssetId",

        # the properties below are optional
        external_id="externalId",
        id="id",
        logical_id="logicalId"
    )],
    asset_properties=[iotsitewise.CfnAsset.AssetPropertyProperty(
        alias="alias",
        external_id="externalId",
        id="id",
        logical_id="logicalId",
        notification_state="notificationState",
        unit="unit"
    )],
    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.*;

CfnAssetProps cfnAssetProps = CfnAssetProps.builder()
        .assetModelId("assetModelId")
        .assetName("assetName")

        // the properties below are optional
        .assetDescription("assetDescription")
        .assetExternalId("assetExternalId")
        .assetHierarchies(List.of(AssetHierarchyProperty.builder()
                .childAssetId("childAssetId")

                // the properties below are optional
                .externalId("externalId")
                .id("id")
                .logicalId("logicalId")
                .build()))
        .assetProperties(List.of(AssetPropertyProperty.builder()
                .alias("alias")
                .externalId("externalId")
                .id("id")
                .logicalId("logicalId")
                .notificationState("notificationState")
                .unit("unit")
                .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 cfnAssetProps = new CfnAssetProps {
    AssetModelId = "assetModelId",
    AssetName = "assetName",

    // the properties below are optional
    AssetDescription = "assetDescription",
    AssetExternalId = "assetExternalId",
    AssetHierarchies = new [] { new AssetHierarchyProperty {
        ChildAssetId = "childAssetId",

        // the properties below are optional
        ExternalId = "externalId",
        Id = "id",
        LogicalId = "logicalId"
    } },
    AssetProperties = new [] { new AssetPropertyProperty {
        Alias = "alias",
        ExternalId = "externalId",
        Id = "id",
        LogicalId = "logicalId",
        NotificationState = "notificationState",
        Unit = "unit"
    } },
    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"

cfnAssetProps := &CfnAssetProps{
	AssetModelId: jsii.String("assetModelId"),
	AssetName: jsii.String("assetName"),

	// the properties below are optional
	AssetDescription: jsii.String("assetDescription"),
	AssetExternalId: jsii.String("assetExternalId"),
	AssetHierarchies: []interface{}{
		&AssetHierarchyProperty{
			ChildAssetId: jsii.String("childAssetId"),

			// the properties below are optional
			ExternalId: jsii.String("externalId"),
			Id: jsii.String("id"),
			LogicalId: jsii.String("logicalId"),
		},
	},
	AssetProperties: []interface{}{
		&AssetPropertyProperty{
			Alias: jsii.String("alias"),
			ExternalId: jsii.String("externalId"),
			Id: jsii.String("id"),
			LogicalId: jsii.String("logicalId"),
			NotificationState: jsii.String("notificationState"),
			Unit: jsii.String("unit"),
		},
	},
	Tags: []CfnTag{
		&CfnTag{
			Key: jsii.String("key"),
			Value: jsii.String("value"),
		},
	},
}

Properties ​

assetDescriptionoptionalstringasset_descriptionoptionalstrassetDescriptionoptionalStringAssetDescriptionoptionalstringAssetDescriptionoptional*string #
The ID of the asset, in UUID format.
assetExternalIdoptionalstringasset_external_idoptionalstrassetExternalIdoptionalStringAssetExternalIdoptionalstringAssetExternalIdoptional*string #
The external ID of the asset model composite model.

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

assetHierarchiesoptionalIResolvable | IResolvable | CfnAsset.AssetHierarchyProperty[]asset_hierarchiesoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, AssetHierarchyProperty]]]assetHierarchiesoptionalIResolvableAssetHierarchiesoptionalIResolvableAssetHierarchiesoptionalinterface{} #
A list of asset hierarchies that each contain a `hierarchyId` .

A hierarchy specifies allowed parent/child asset relationships.

assetModelIdstring | IAssetModelRefasset_model_idtyping.Union[str, IAssetModelRef]assetModelIdStringAssetModelIdstringAssetModelIdinterface{} required #
The ID of the asset model from which to create the asset.
notes

This can be either the actual ID in UUID format, or else externalId: followed by the external ID, if it has one. For more information, see Referencing objects with external IDs in the AWS IoT SiteWise User Guide .

assetNamestringasset_namestrassetNameStringAssetNamestringAssetName*string required #
A friendly name for the asset.
assetPropertiesoptionalIResolvable | IResolvable | CfnAsset.AssetPropertyProperty[]asset_propertiesoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, AssetPropertyProperty]]]assetPropertiesoptionalIResolvableAssetPropertiesoptionalIResolvableAssetPropertiesoptionalinterface{} #
The list of asset properties for the asset.

This object doesn't include properties that you define in composite models. You can find composite model properties in the assetCompositeModels object.

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 .