Class CloudWatchSetAlarmStateActionProps
(experimental) Configuration properties of an action for CloudWatch alarm.
Inheritance
System.Object
CloudWatchSetAlarmStateActionProps
Namespace: Amazon.CDK.AWS.IoT.Actions
Assembly: Amazon.CDK.AWS.IoT.Actions.dll
Syntax (csharp)
public class CloudWatchSetAlarmStateActionProps : Object, ICloudWatchSetAlarmStateActionProps, ICommonActionProps
Syntax (vb)
Public Class CloudWatchSetAlarmStateActionProps
Inherits Object
Implements ICloudWatchSetAlarmStateActionProps, ICommonActionProps
Remarks
Stability: Experimental
ExampleMetadata: infused
Examples
using Amazon.CDK.AWS.CloudWatch;
var metric = new Metric(new MetricProps {
Namespace = "MyNamespace",
MetricName = "MyMetric",
Dimensions = new Dictionary<string, object> { { "MyDimension", "MyDimensionValue" } }
});
var alarm = new Alarm(this, "MyAlarm", new AlarmProps {
Metric = metric,
Threshold = 100,
EvaluationPeriods = 3,
DatapointsToAlarm = 2
});
var topicRule = new TopicRule(this, "TopicRule", new TopicRuleProps {
Sql = IotSql.FromStringAsVer20160323("SELECT topic(2) as device_id FROM 'device/+/data'"),
Actions = new [] {
new CloudWatchSetAlarmStateAction(alarm, new CloudWatchSetAlarmStateActionProps {
Reason = "AWS Iot Rule action is triggered",
AlarmStateToSet = AlarmState.ALARM
}) }
});
Synopsis
Constructors
CloudWatchSetAlarmStateActionProps() |
Properties
AlarmStateToSet | (experimental) The value of the alarm state to set. |
Reason | (experimental) The reason for the alarm change. |
Role | (experimental) The IAM role that allows access to AWS service. |
Constructors
CloudWatchSetAlarmStateActionProps()
public CloudWatchSetAlarmStateActionProps()
Properties
AlarmStateToSet
(experimental) The value of the alarm state to set.
public AlarmState AlarmStateToSet { get; set; }
Property Value
Remarks
Stability: Experimental
Reason
(experimental) The reason for the alarm change.
public string Reason { get; set; }
Property Value
System.String
Remarks
Default: None
Stability: Experimental
Role
(experimental) The IAM role that allows access to AWS service.
public IRole Role { get; set; }
Property Value
Remarks
Default: a new role will be created
Stability: Experimental