1 | import { Construct } from 'constructs';
|
2 | import { IAlarmAction } from './alarm-action';
|
3 | import { AlarmBase, IAlarm } from './alarm-base';
|
4 | import { HorizontalAnnotation } from './graph';
|
5 | import { CreateAlarmOptions } from './metric';
|
6 | import { IMetric } from './metric-types';
|
7 |
|
8 |
|
9 |
|
10 | export interface AlarmProps extends CreateAlarmOptions {
|
11 | |
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 | readonly metric: IMetric;
|
18 | }
|
19 |
|
20 |
|
21 |
|
22 | export declare enum ComparisonOperator {
|
23 | |
24 |
|
25 |
|
26 | GREATER_THAN_OR_EQUAL_TO_THRESHOLD = "GreaterThanOrEqualToThreshold",
|
27 | |
28 |
|
29 |
|
30 | GREATER_THAN_THRESHOLD = "GreaterThanThreshold",
|
31 | |
32 |
|
33 |
|
34 | LESS_THAN_THRESHOLD = "LessThanThreshold",
|
35 | |
36 |
|
37 |
|
38 | LESS_THAN_OR_EQUAL_TO_THRESHOLD = "LessThanOrEqualToThreshold",
|
39 | |
40 |
|
41 |
|
42 |
|
43 | LESS_THAN_LOWER_OR_GREATER_THAN_UPPER_THRESHOLD = "LessThanLowerOrGreaterThanUpperThreshold",
|
44 | |
45 |
|
46 |
|
47 |
|
48 | GREATER_THAN_UPPER_THRESHOLD = "GreaterThanUpperThreshold",
|
49 | |
50 |
|
51 |
|
52 |
|
53 | LESS_THAN_LOWER_THRESHOLD = "LessThanLowerThreshold"
|
54 | }
|
55 |
|
56 |
|
57 |
|
58 | export declare enum TreatMissingData {
|
59 | |
60 |
|
61 |
|
62 | BREACHING = "breaching",
|
63 | |
64 |
|
65 |
|
66 | NOT_BREACHING = "notBreaching",
|
67 | |
68 |
|
69 |
|
70 | IGNORE = "ignore",
|
71 | |
72 |
|
73 |
|
74 | MISSING = "missing"
|
75 | }
|
76 |
|
77 |
|
78 |
|
79 | export declare class Alarm extends AlarmBase {
|
80 | |
81 |
|
82 |
|
83 |
|
84 |
|
85 |
|
86 |
|
87 | static fromAlarmArn(scope: Construct, id: string, alarmArn: string): IAlarm;
|
88 | |
89 |
|
90 |
|
91 |
|
92 |
|
93 | readonly alarmArn: string;
|
94 | |
95 |
|
96 |
|
97 |
|
98 |
|
99 | readonly alarmName: string;
|
100 | |
101 |
|
102 |
|
103 | readonly metric: IMetric;
|
104 | |
105 |
|
106 |
|
107 | private readonly annotation;
|
108 | constructor(scope: Construct, id: string, props: AlarmProps);
|
109 | /**
|
110 | * Turn this alarm into a horizontal annotation
|
111 | *
|
112 | * This is useful if you want to represent an Alarm in a non-AlarmWidget.
|
113 | * An `AlarmWidget` can directly show an alarm, but it can only show a
|
114 | * single alarm and no other metrics. Instead, you can convert the alarm to
|
115 | * a HorizontalAnnotation and add it as an annotation to another graph.
|
116 | *
|
117 | * This might be useful if:
|
118 | *
|
119 | * - You want to show multiple alarms inside a single graph, for example if
|
120 | * you have both a "small margin/long period" alarm as well as a
|
121 | * "large margin/short period" alarm.
|
122 | *
|
123 | * - You want to show an Alarm line in a graph with multiple metrics in it.
|
124 | */
|
125 | toAnnotation(): HorizontalAnnotation;
|
126 | /**
|
127 | * Trigger this action if the alarm fires
|
128 | *
|
129 | * Typically the ARN of an SNS topic or ARN of an AutoScaling policy.
|
130 | */
|
131 | addAlarmAction(...actions: IAlarmAction[]): void;
|
132 | private validateActionArn;
|
133 | private renderMetric;
|
134 | /**
|
135 | * Validate that if a region is in the given stat config, they match the Alarm
|
136 | */
|
137 | private validateMetricStat;
|
138 | /**
|
139 | * Validates that the expression config does not specify searchAccount or searchRegion props
|
140 | * as search expressions are not supported by Alarms.
|
141 | */
|
142 | private validateMetricExpression;
|
143 | /**
|
144 | * Determine if the accountId property should be included in the metric.
|
145 | */
|
146 | private requiresAccountId;
|
147 | }
|