Class CloudWatchSetAlarmStateAction
(experimental) The action to change the state of an Amazon CloudWatch alarm.
Inheritance
System.Object
CloudWatchSetAlarmStateAction
Implements
Namespace: Amazon.CDK.AWS.IoT.Actions.Alpha
Assembly: Amazon.CDK.AWS.IoT.Actions.Alpha.dll
Syntax (csharp)
public class CloudWatchSetAlarmStateAction : DeputyBase, IAction
Syntax (vb)
Public Class CloudWatchSetAlarmStateAction
Inherits DeputyBase
Implements IAction
Remarks
Stability: Experimental
ExampleMetadata: infused
Examples
using Amazon.CDK.AWS.CloudWatch;
var metric = new Metric(new MetricProps {
Namespace = "MyNamespace",
MetricName = "MyMetric",
DimensionsMap = new Dictionary<string, string> { { "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
CloudWatchSetAlarmStateAction(IAlarm, ICloudWatchSetAlarmStateActionProps) | |
CloudWatchSetAlarmStateAction(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
CloudWatchSetAlarmStateAction(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Constructors
CloudWatchSetAlarmStateAction(IAlarm, ICloudWatchSetAlarmStateActionProps)
public CloudWatchSetAlarmStateAction(IAlarm alarm, ICloudWatchSetAlarmStateActionProps props)
Parameters
- alarm IAlarm
- props ICloudWatchSetAlarmStateActionProps
Remarks
Stability: Experimental
CloudWatchSetAlarmStateAction(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected CloudWatchSetAlarmStateAction(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
CloudWatchSetAlarmStateAction(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected CloudWatchSetAlarmStateAction(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props