Class CfnDetectorModel
A CloudFormation AWS::IoTEvents::DetectorModel
.
Inherited Members
Namespace: Amazon.CDK.AWS.IoTEvents
Assembly: Amazon.CDK.AWS.IoTEvents.dll
Syntax (csharp)
public class CfnDetectorModel : CfnResource, IConstruct, IDependable, IInspectable
Syntax (vb)
Public Class CfnDetectorModel
Inherits CfnResource
Implements IConstruct, IDependable, IInspectable
Remarks
The AWS::IoTEvents::DetectorModel resource creates a detector model. You create a detector model (a model of your equipment or process) using states . For each state, you define conditional (Boolean) logic that evaluates the incoming inputs to detect significant events. When an event is detected, it can change the state or trigger custom-built or predefined actions using other AWS services. You can define additional events that trigger actions when entering or exiting a state and, optionally, when a condition is met. For more information, see How to Use AWS IoT Events in the AWS IoT Events Developer Guide .
When you successfully update a detector model (using the AWS IoT Events console, AWS IoT Events API or CLI commands, or AWS CloudFormation ) all detector instances created by the model are reset to their initial states. (The detector's state
, and the values of any variables and timers are reset.)
When you successfully update a detector model (using the AWS IoT Events console, AWS IoT Events API or CLI commands, or AWS CloudFormation ) the version number of the detector model is incremented. (A detector model with version number 1 before the update has version number 2 after the update succeeds.)
If you attempt to update a detector model using AWS CloudFormation and the update does not succeed, the system may, in some cases, restore the original detector model. When this occurs, the detector model's version is incremented twice (for example, from version 1 to version 3) and the detector instances are reset.
Also, be aware that if you attempt to update several detector models at once using AWS CloudFormation , some updates may succeed and others fail. In this case, the effects on each detector model's detector instances and version number depend on whether the update succeeded or failed, with the results as stated.
CloudformationResource: AWS::IoTEvents::DetectorModel
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.IoTEvents;
var cfnDetectorModel = new CfnDetectorModel(this, "MyCfnDetectorModel", new CfnDetectorModelProps {
DetectorModelDefinition = new DetectorModelDefinitionProperty {
InitialStateName = "initialStateName",
States = new [] { new StateProperty {
StateName = "stateName",
// the properties below are optional
OnEnter = new OnEnterProperty {
Events = new [] { new EventProperty {
EventName = "eventName",
// the properties below are optional
Actions = new [] { new ActionProperty {
ClearTimer = new ClearTimerProperty {
TimerName = "timerName"
},
DynamoDb = new DynamoDBProperty {
HashKeyField = "hashKeyField",
HashKeyValue = "hashKeyValue",
TableName = "tableName",
// the properties below are optional
HashKeyType = "hashKeyType",
Operation = "operation",
Payload = new PayloadProperty {
ContentExpression = "contentExpression",
Type = "type"
},
PayloadField = "payloadField",
RangeKeyField = "rangeKeyField",
RangeKeyType = "rangeKeyType",
RangeKeyValue = "rangeKeyValue"
},
DynamoDBv2 = new DynamoDBv2Property {
TableName = "tableName",
// the properties below are optional
Payload = new PayloadProperty {
ContentExpression = "contentExpression",
Type = "type"
}
},
Firehose = new FirehoseProperty {
DeliveryStreamName = "deliveryStreamName",
// the properties below are optional
Payload = new PayloadProperty {
ContentExpression = "contentExpression",
Type = "type"
},
Separator = "separator"
},
IotEvents = new IotEventsProperty {
InputName = "inputName",
// the properties below are optional
Payload = new PayloadProperty {
ContentExpression = "contentExpression",
Type = "type"
}
},
IotSiteWise = new IotSiteWiseProperty {
PropertyValue = new AssetPropertyValueProperty {
Value = new AssetPropertyVariantProperty {
BooleanValue = "booleanValue",
DoubleValue = "doubleValue",
IntegerValue = "integerValue",
StringValue = "stringValue"
},
// the properties below are optional
Quality = "quality",
Timestamp = new AssetPropertyTimestampProperty {
TimeInSeconds = "timeInSeconds",
// the properties below are optional
OffsetInNanos = "offsetInNanos"
}
},
// the properties below are optional
AssetId = "assetId",
EntryId = "entryId",
PropertyAlias = "propertyAlias",
PropertyId = "propertyId"
},
IotTopicPublish = new IotTopicPublishProperty {
MqttTopic = "mqttTopic",
// the properties below are optional
Payload = new PayloadProperty {
ContentExpression = "contentExpression",
Type = "type"
}
},
Lambda = new LambdaProperty {
FunctionArn = "functionArn",
// the properties below are optional
Payload = new PayloadProperty {
ContentExpression = "contentExpression",
Type = "type"
}
},
ResetTimer = new ResetTimerProperty {
TimerName = "timerName"
},
SetTimer = new SetTimerProperty {
TimerName = "timerName",
// the properties below are optional
DurationExpression = "durationExpression",
Seconds = 123
},
SetVariable = new SetVariableProperty {
Value = "value",
VariableName = "variableName"
},
Sns = new SnsProperty {
TargetArn = "targetArn",
// the properties below are optional
Payload = new PayloadProperty {
ContentExpression = "contentExpression",
Type = "type"
}
},
Sqs = new SqsProperty {
QueueUrl = "queueUrl",
// the properties below are optional
Payload = new PayloadProperty {
ContentExpression = "contentExpression",
Type = "type"
},
UseBase64 = false
}
} },
Condition = "condition"
} }
},
OnExit = new OnExitProperty {
Events = new [] { new EventProperty {
EventName = "eventName",
// the properties below are optional
Actions = new [] { new ActionProperty {
ClearTimer = new ClearTimerProperty {
TimerName = "timerName"
},
DynamoDb = new DynamoDBProperty {
HashKeyField = "hashKeyField",
HashKeyValue = "hashKeyValue",
TableName = "tableName",
// the properties below are optional
HashKeyType = "hashKeyType",
Operation = "operation",
Payload = new PayloadProperty {
ContentExpression = "contentExpression",
Type = "type"
},
PayloadField = "payloadField",
RangeKeyField = "rangeKeyField",
RangeKeyType = "rangeKeyType",
RangeKeyValue = "rangeKeyValue"
},
DynamoDBv2 = new DynamoDBv2Property {
TableName = "tableName",
// the properties below are optional
Payload = new PayloadProperty {
ContentExpression = "contentExpression",
Type = "type"
}
},
Firehose = new FirehoseProperty {
DeliveryStreamName = "deliveryStreamName",
// the properties below are optional
Payload = new PayloadProperty {
ContentExpression = "contentExpression",
Type = "type"
},
Separator = "separator"
},
IotEvents = new IotEventsProperty {
InputName = "inputName",
// the properties below are optional
Payload = new PayloadProperty {
ContentExpression = "contentExpression",
Type = "type"
}
},
IotSiteWise = new IotSiteWiseProperty {
PropertyValue = new AssetPropertyValueProperty {
Value = new AssetPropertyVariantProperty {
BooleanValue = "booleanValue",
DoubleValue = "doubleValue",
IntegerValue = "integerValue",
StringValue = "stringValue"
},
// the properties below are optional
Quality = "quality",
Timestamp = new AssetPropertyTimestampProperty {
TimeInSeconds = "timeInSeconds",
// the properties below are optional
OffsetInNanos = "offsetInNanos"
}
},
// the properties below are optional
AssetId = "assetId",
EntryId = "entryId",
PropertyAlias = "propertyAlias",
PropertyId = "propertyId"
},
IotTopicPublish = new IotTopicPublishProperty {
MqttTopic = "mqttTopic",
// the properties below are optional
Payload = new PayloadProperty {
ContentExpression = "contentExpression",
Type = "type"
}
},
Lambda = new LambdaProperty {
FunctionArn = "functionArn",
// the properties below are optional
Payload = new PayloadProperty {
ContentExpression = "contentExpression",
Type = "type"
}
},
ResetTimer = new ResetTimerProperty {
TimerName = "timerName"
},
SetTimer = new SetTimerProperty {
TimerName = "timerName",
// the properties below are optional
DurationExpression = "durationExpression",
Seconds = 123
},
SetVariable = new SetVariableProperty {
Value = "value",
VariableName = "variableName"
},
Sns = new SnsProperty {
TargetArn = "targetArn",
// the properties below are optional
Payload = new PayloadProperty {
ContentExpression = "contentExpression",
Type = "type"
}
},
Sqs = new SqsProperty {
QueueUrl = "queueUrl",
// the properties below are optional
Payload = new PayloadProperty {
ContentExpression = "contentExpression",
Type = "type"
},
UseBase64 = false
}
} },
Condition = "condition"
} }
},
OnInput = new OnInputProperty {
Events = new [] { new EventProperty {
EventName = "eventName",
// the properties below are optional
Actions = new [] { new ActionProperty {
ClearTimer = new ClearTimerProperty {
TimerName = "timerName"
},
DynamoDb = new DynamoDBProperty {
HashKeyField = "hashKeyField",
HashKeyValue = "hashKeyValue",
TableName = "tableName",
// the properties below are optional
HashKeyType = "hashKeyType",
Operation = "operation",
Payload = new PayloadProperty {
ContentExpression = "contentExpression",
Type = "type"
},
PayloadField = "payloadField",
RangeKeyField = "rangeKeyField",
RangeKeyType = "rangeKeyType",
RangeKeyValue = "rangeKeyValue"
},
DynamoDBv2 = new DynamoDBv2Property {
TableName = "tableName",
// the properties below are optional
Payload = new PayloadProperty {
ContentExpression = "contentExpression",
Type = "type"
}
},
Firehose = new FirehoseProperty {
DeliveryStreamName = "deliveryStreamName",
// the properties below are optional
Payload = new PayloadProperty {
ContentExpression = "contentExpression",
Type = "type"
},
Separator = "separator"
},
IotEvents = new IotEventsProperty {
InputName = "inputName",
// the properties below are optional
Payload = new PayloadProperty {
ContentExpression = "contentExpression",
Type = "type"
}
},
IotSiteWise = new IotSiteWiseProperty {
PropertyValue = new AssetPropertyValueProperty {
Value = new AssetPropertyVariantProperty {
BooleanValue = "booleanValue",
DoubleValue = "doubleValue",
IntegerValue = "integerValue",
StringValue = "stringValue"
},
// the properties below are optional
Quality = "quality",
Timestamp = new AssetPropertyTimestampProperty {
TimeInSeconds = "timeInSeconds",
// the properties below are optional
OffsetInNanos = "offsetInNanos"
}
},
// the properties below are optional
AssetId = "assetId",
EntryId = "entryId",
PropertyAlias = "propertyAlias",
PropertyId = "propertyId"
},
IotTopicPublish = new IotTopicPublishProperty {
MqttTopic = "mqttTopic",
// the properties below are optional
Payload = new PayloadProperty {
ContentExpression = "contentExpression",
Type = "type"
}
},
Lambda = new LambdaProperty {
FunctionArn = "functionArn",
// the properties below are optional
Payload = new PayloadProperty {
ContentExpression = "contentExpression",
Type = "type"
}
},
ResetTimer = new ResetTimerProperty {
TimerName = "timerName"
},
SetTimer = new SetTimerProperty {
TimerName = "timerName",
// the properties below are optional
DurationExpression = "durationExpression",
Seconds = 123
},
SetVariable = new SetVariableProperty {
Value = "value",
VariableName = "variableName"
},
Sns = new SnsProperty {
TargetArn = "targetArn",
// the properties below are optional
Payload = new PayloadProperty {
ContentExpression = "contentExpression",
Type = "type"
}
},
Sqs = new SqsProperty {
QueueUrl = "queueUrl",
// the properties below are optional
Payload = new PayloadProperty {
ContentExpression = "contentExpression",
Type = "type"
},
UseBase64 = false
}
} },
Condition = "condition"
} },
TransitionEvents = new [] { new TransitionEventProperty {
Condition = "condition",
EventName = "eventName",
NextState = "nextState",
// the properties below are optional
Actions = new [] { new ActionProperty {
ClearTimer = new ClearTimerProperty {
TimerName = "timerName"
},
DynamoDb = new DynamoDBProperty {
HashKeyField = "hashKeyField",
HashKeyValue = "hashKeyValue",
TableName = "tableName",
// the properties below are optional
HashKeyType = "hashKeyType",
Operation = "operation",
Payload = new PayloadProperty {
ContentExpression = "contentExpression",
Type = "type"
},
PayloadField = "payloadField",
RangeKeyField = "rangeKeyField",
RangeKeyType = "rangeKeyType",
RangeKeyValue = "rangeKeyValue"
},
DynamoDBv2 = new DynamoDBv2Property {
TableName = "tableName",
// the properties below are optional
Payload = new PayloadProperty {
ContentExpression = "contentExpression",
Type = "type"
}
},
Firehose = new FirehoseProperty {
DeliveryStreamName = "deliveryStreamName",
// the properties below are optional
Payload = new PayloadProperty {
ContentExpression = "contentExpression",
Type = "type"
},
Separator = "separator"
},
IotEvents = new IotEventsProperty {
InputName = "inputName",
// the properties below are optional
Payload = new PayloadProperty {
ContentExpression = "contentExpression",
Type = "type"
}
},
IotSiteWise = new IotSiteWiseProperty {
PropertyValue = new AssetPropertyValueProperty {
Value = new AssetPropertyVariantProperty {
BooleanValue = "booleanValue",
DoubleValue = "doubleValue",
IntegerValue = "integerValue",
StringValue = "stringValue"
},
// the properties below are optional
Quality = "quality",
Timestamp = new AssetPropertyTimestampProperty {
TimeInSeconds = "timeInSeconds",
// the properties below are optional
OffsetInNanos = "offsetInNanos"
}
},
// the properties below are optional
AssetId = "assetId",
EntryId = "entryId",
PropertyAlias = "propertyAlias",
PropertyId = "propertyId"
},
IotTopicPublish = new IotTopicPublishProperty {
MqttTopic = "mqttTopic",
// the properties below are optional
Payload = new PayloadProperty {
ContentExpression = "contentExpression",
Type = "type"
}
},
Lambda = new LambdaProperty {
FunctionArn = "functionArn",
// the properties below are optional
Payload = new PayloadProperty {
ContentExpression = "contentExpression",
Type = "type"
}
},
ResetTimer = new ResetTimerProperty {
TimerName = "timerName"
},
SetTimer = new SetTimerProperty {
TimerName = "timerName",
// the properties below are optional
DurationExpression = "durationExpression",
Seconds = 123
},
SetVariable = new SetVariableProperty {
Value = "value",
VariableName = "variableName"
},
Sns = new SnsProperty {
TargetArn = "targetArn",
// the properties below are optional
Payload = new PayloadProperty {
ContentExpression = "contentExpression",
Type = "type"
}
},
Sqs = new SqsProperty {
QueueUrl = "queueUrl",
// the properties below are optional
Payload = new PayloadProperty {
ContentExpression = "contentExpression",
Type = "type"
},
UseBase64 = false
}
} }
} }
}
} }
},
RoleArn = "roleArn",
// the properties below are optional
DetectorModelDescription = "detectorModelDescription",
DetectorModelName = "detectorModelName",
EvaluationMethod = "evaluationMethod",
Key = "key",
Tags = new [] { new CfnTag {
Key = "key",
Value = "value"
} }
});
Synopsis
Constructors
CfnDetectorModel(Construct, String, ICfnDetectorModelProps) | Create a new |
CfnDetectorModel(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
CfnDetectorModel(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Properties
CFN_RESOURCE_TYPE_NAME | The CloudFormation resource type name for this resource class. |
CfnProperties | |
DetectorModelDefinition | Information that defines how a detector operates. |
DetectorModelDescription | A brief description of the detector model. |
DetectorModelName | The name of the detector model. |
EvaluationMethod | Information about the order in which events are evaluated and how actions are executed. |
Key | The value used to identify a detector instance. |
RoleArn | The ARN of the role that grants permission to AWS IoT Events to perform its operations. |
Tags | An array of key-value pairs to apply to this resource. |
Methods
Inspect(TreeInspector) | Examines the CloudFormation resource and discloses attributes. |
RenderProperties(IDictionary<String, Object>) |
Constructors
CfnDetectorModel(Construct, String, ICfnDetectorModelProps)
Create a new AWS::IoTEvents::DetectorModel
.
public CfnDetectorModel(Construct scope, string id, ICfnDetectorModelProps props)
Parameters
- scope Construct
- scope in which this resource is defined.
- id System.String
- scoped id of the resource.
- props ICfnDetectorModelProps
- resource properties.
CfnDetectorModel(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected CfnDetectorModel(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
CfnDetectorModel(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected CfnDetectorModel(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Properties
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
public static string CFN_RESOURCE_TYPE_NAME { get; }
Property Value
System.String
CfnProperties
protected override IDictionary<string, object> CfnProperties { get; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.Object>
Overrides
DetectorModelDefinition
Information that defines how a detector operates.
public virtual object DetectorModelDefinition { get; set; }
Property Value
System.Object
Remarks
DetectorModelDescription
A brief description of the detector model.
public virtual string DetectorModelDescription { get; set; }
Property Value
System.String
Remarks
DetectorModelName
The name of the detector model.
public virtual string DetectorModelName { get; set; }
Property Value
System.String
Remarks
EvaluationMethod
Information about the order in which events are evaluated and how actions are executed.
public virtual string EvaluationMethod { get; set; }
Property Value
System.String
Remarks
Key
The value used to identify a detector instance.
public virtual string Key { get; set; }
Property Value
System.String
Remarks
When a device or system sends input, a new detector instance with a unique key value is created. AWS IoT Events can continue to route input to its corresponding detector instance based on this identifying information.
This parameter uses a JSON-path expression to select the attribute-value pair in the message payload that is used for identification. To route the message to the correct detector instance, the device must send a message payload that contains the same attribute-value.
RoleArn
The ARN of the role that grants permission to AWS IoT Events to perform its operations.
public virtual string RoleArn { get; set; }
Property Value
System.String
Remarks
Tags
An array of key-value pairs to apply to this resource.
public virtual TagManager Tags { get; }
Property Value
Remarks
For more information, see Tag .
Methods
Inspect(TreeInspector)
Examines the CloudFormation resource and discloses attributes.
public virtual void Inspect(TreeInspector inspector)
Parameters
- inspector TreeInspector
- tree inspector to collect and process attributes.
RenderProperties(IDictionary<String, Object>)
protected override IDictionary<string, object> RenderProperties(IDictionary<string, object> props)
Parameters
- props System.Collections.Generic.IDictionary<System.String, System.Object>
Returns
System.Collections.Generic.IDictionary<System.String, System.Object>