Skip to content
v2.278.0

TransformProperty Struct ​

Contains an asset transform property.

A transform is a one-to-one mapping of a property's data points from one form to another. For example, you can use a transform to convert a Celsius data stream to Fahrenheit by applying the transformation expression to each data point of the Celsius stream. A transform can only have a data type of DOUBLE and consume properties with data types of INTEGER or DOUBLE .

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

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 transformProperty: iotsitewise.CfnAssetModel.TransformProperty = {
  expression: 'expression',
  variables: [{
    name: 'name',
    value: {
      hierarchyExternalId: 'hierarchyExternalId',
      hierarchyId: 'hierarchyId',
      hierarchyLogicalId: 'hierarchyLogicalId',
      propertyExternalId: 'propertyExternalId',
      propertyId: 'propertyId',
      propertyLogicalId: 'propertyLogicalId',
      propertyPath: [{
        name: 'name',
      }],
    },
  }],
};
python
# 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

transform_property = 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"
            )]
        )
    )]
)
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.*;

TransformProperty transformProperty = 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();
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 transformProperty = 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"
            } }
        }
    } }
};
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"

transformProperty := &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"),
					},
				},
			},
		},
	},
}

Properties ​

expressionstringexpressionstrexpressionStringExpressionstringExpression*string required #
The mathematical expression that defines the transformation function.
notes

You can specify up to 10 variables per expression. You can specify up to 10 functions per expression.

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

variablesIResolvable | IResolvable | CfnAssetModel.ExpressionVariableProperty[]variablestyping.Union[IResolvable, typing.List[typing.Union[IResolvable, ExpressionVariableProperty]]]variablesIResolvableVariablesIResolvableVariablesinterface{} required #
The list of variables used in the expression.