UNPKG

1.82 kBTypeScriptView Raw
1import { IResource, Resource } from '@aws-cdk/core';
2import { IAlarmAction } from './alarm-action';
3/**
4 * Interface for Alarm Rule.
5 */
6export interface IAlarmRule {
7 /**
8 * serialized representation of Alarm Rule to be used when building the Composite Alarm resource.
9 */
10 renderAlarmRule(): string;
11}
12/**
13 * Represents a CloudWatch Alarm
14 */
15export interface IAlarm extends IAlarmRule, IResource {
16 /**
17 * Alarm ARN (i.e. arn:aws:cloudwatch:<region>:<account-id>:alarm:Foo)
18 *
19 * @attribute
20 */
21 readonly alarmArn: string;
22 /**
23 * Name of the alarm
24 *
25 * @attribute
26 */
27 readonly alarmName: string;
28}
29/**
30 * The base class for Alarm and CompositeAlarm resources.
31 */
32export declare abstract class AlarmBase extends Resource implements IAlarm {
33 /**
34 * @attribute
35 */
36 abstract readonly alarmArn: string;
37 abstract readonly alarmName: string;
38 protected alarmActionArns?: string[];
39 protected insufficientDataActionArns?: string[];
40 protected okActionArns?: string[];
41 /**
42 * AlarmRule indicating ALARM state for Alarm.
43 */
44 renderAlarmRule(): string;
45 /**
46 * Trigger this action if the alarm fires
47 *
48 * Typically the ARN of an SNS topic or ARN of an AutoScaling policy.
49 */
50 addAlarmAction(...actions: IAlarmAction[]): void;
51 /**
52 * Trigger this action if there is insufficient data to evaluate the alarm
53 *
54 * Typically the ARN of an SNS topic or ARN of an AutoScaling policy.
55 */
56 addInsufficientDataAction(...actions: IAlarmAction[]): void;
57 /**
58 * Trigger this action if the alarm returns from breaching state into ok state
59 *
60 * Typically the ARN of an SNS topic or ARN of an AutoScaling policy.
61 */
62 addOkAction(...actions: IAlarmAction[]): void;
63}