Skip to content
v2.278.0

BehaviorProperty Struct ​

A Device Defender security profile behavior.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_iot as iot } from 'aws-cdk-lib';
const behaviorProperty: iot.CfnSecurityProfile.BehaviorProperty = {
  name: 'name',

  // the properties below are optional
  criteria: {
    comparisonOperator: 'comparisonOperator',
    consecutiveDatapointsToAlarm: 123,
    consecutiveDatapointsToClear: 123,
    durationSeconds: 123,
    mlDetectionConfig: {
      confidenceLevel: 'confidenceLevel',
    },
    statisticalThreshold: {
      statistic: 'statistic',
    },
    value: {
      cidrs: ['cidrs'],
      count: 'count',
      number: 123,
      numbers: [123],
      ports: [123],
      strings: ['strings'],
    },
  },
  exportMetric: false,
  metric: 'metric',
  metricDimension: {
    dimensionName: 'dimensionName',

    // the properties below are optional
    operator: 'operator',
  },
  suppressAlerts: false,
};
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_iot as iot

behavior_property = iot.CfnSecurityProfile.BehaviorProperty(
    name="name",

    # the properties below are optional
    criteria=iot.CfnSecurityProfile.BehaviorCriteriaProperty(
        comparison_operator="comparisonOperator",
        consecutive_datapoints_to_alarm=123,
        consecutive_datapoints_to_clear=123,
        duration_seconds=123,
        ml_detection_config=iot.CfnSecurityProfile.MachineLearningDetectionConfigProperty(
            confidence_level="confidenceLevel"
        ),
        statistical_threshold=iot.CfnSecurityProfile.StatisticalThresholdProperty(
            statistic="statistic"
        ),
        value=iot.CfnSecurityProfile.MetricValueProperty(
            cidrs=["cidrs"],
            count="count",
            number=123,
            numbers=[123],
            ports=[123],
            strings=["strings"]
        )
    ),
    export_metric=False,
    metric="metric",
    metric_dimension=iot.CfnSecurityProfile.MetricDimensionProperty(
        dimension_name="dimensionName",

        # the properties below are optional
        operator="operator"
    ),
    suppress_alerts=False
)
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.iot.*;

BehaviorProperty behaviorProperty = BehaviorProperty.builder()
        .name("name")

        // the properties below are optional
        .criteria(BehaviorCriteriaProperty.builder()
                .comparisonOperator("comparisonOperator")
                .consecutiveDatapointsToAlarm(123)
                .consecutiveDatapointsToClear(123)
                .durationSeconds(123)
                .mlDetectionConfig(MachineLearningDetectionConfigProperty.builder()
                        .confidenceLevel("confidenceLevel")
                        .build())
                .statisticalThreshold(StatisticalThresholdProperty.builder()
                        .statistic("statistic")
                        .build())
                .value(MetricValueProperty.builder()
                        .cidrs(List.of("cidrs"))
                        .count("count")
                        .number(123)
                        .numbers(List.of(123))
                        .ports(List.of(123))
                        .strings(List.of("strings"))
                        .build())
                .build())
        .exportMetric(false)
        .metric("metric")
        .metricDimension(MetricDimensionProperty.builder()
                .dimensionName("dimensionName")

                // the properties below are optional
                .operator("operator")
                .build())
        .suppressAlerts(false)
        .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.IoT;

var behaviorProperty = new BehaviorProperty {
    Name = "name",

    // the properties below are optional
    Criteria = new BehaviorCriteriaProperty {
        ComparisonOperator = "comparisonOperator",
        ConsecutiveDatapointsToAlarm = 123,
        ConsecutiveDatapointsToClear = 123,
        DurationSeconds = 123,
        MlDetectionConfig = new MachineLearningDetectionConfigProperty {
            ConfidenceLevel = "confidenceLevel"
        },
        StatisticalThreshold = new StatisticalThresholdProperty {
            Statistic = "statistic"
        },
        Value = new MetricValueProperty {
            Cidrs = new [] { "cidrs" },
            Count = "count",
            Number = 123,
            Numbers = new [] { 123 },
            Ports = new [] { 123 },
            Strings = new [] { "strings" }
        }
    },
    ExportMetric = false,
    Metric = "metric",
    MetricDimension = new MetricDimensionProperty {
        DimensionName = "dimensionName",

        // the properties below are optional
        Operator = "operator"
    },
    SuppressAlerts = false
};
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"

behaviorProperty := &BehaviorProperty{
	Name: jsii.String("name"),

	// the properties below are optional
	Criteria: &BehaviorCriteriaProperty{
		ComparisonOperator: jsii.String("comparisonOperator"),
		ConsecutiveDatapointsToAlarm: jsii.Number(123),
		ConsecutiveDatapointsToClear: jsii.Number(123),
		DurationSeconds: jsii.Number(123),
		MlDetectionConfig: &MachineLearningDetectionConfigProperty{
			ConfidenceLevel: jsii.String("confidenceLevel"),
		},
		StatisticalThreshold: &StatisticalThresholdProperty{
			Statistic: jsii.String("statistic"),
		},
		Value: &MetricValueProperty{
			Cidrs: []*string{
				jsii.String("cidrs"),
			},
			Count: jsii.String("count"),
			Number: jsii.Number(123),
			Numbers: []interface{}{
				jsii.Number(123),
			},
			Ports: []interface{}{
				jsii.Number(123),
			},
			Strings: []*string{
				jsii.String("strings"),
			},
		},
	},
	ExportMetric: jsii.Boolean(false),
	Metric: jsii.String("metric"),
	MetricDimension: &MetricDimensionProperty{
		DimensionName: jsii.String("dimensionName"),

		// the properties below are optional
		Operator: jsii.String("operator"),
	},
	SuppressAlerts: jsii.Boolean(false),
}

Properties ​

criteriaoptionalIResolvable | CfnSecurityProfile.BehaviorCriteriaPropertycriteriaoptionaltyping.Union[IResolvable, BehaviorCriteriaProperty]criteriaoptionalIResolvableCriteriaoptionalIResolvableCriteriaoptionalinterface{} #
The criteria that determine if a device is behaving normally in regard to the `metric` .

In the AWS IoT console, you can choose to be sent an alert through Amazon SNS when AWS IoT Device Defender detects that a device is behaving anomalously.

exportMetricoptionalboolean | IResolvableexport_metricoptionaltyping.Union[bool, IResolvable]exportMetricoptionalBooleanExportMetricoptionalboolExportMetricoptionalinterface{} #
Value indicates exporting metrics related to the behavior when it is true.
metricoptionalstringmetricoptionalstrmetricoptionalStringMetricoptionalstringMetricoptional*string #
What is measured by the behavior.
metricDimensionoptionalIResolvable | CfnSecurityProfile.MetricDimensionPropertymetric_dimensionoptionaltyping.Union[IResolvable, MetricDimensionProperty]metricDimensionoptionalIResolvableMetricDimensionoptionalIResolvableMetricDimensionoptionalinterface{} #
The dimension of the metric.
namestringnamestrnameStringNamestringName*string required #
The name you've given to the behavior.
suppressAlertsoptionalboolean | IResolvablesuppress_alertsoptionaltyping.Union[bool, IResolvable]suppressAlertsoptionalBooleanSuppressAlertsoptionalboolSuppressAlertsoptionalinterface{} #
The alert status.

If you set the value to true , alerts will be suppressed.