1 | import { Handler } from "../handler";
|
2 |
|
3 | export type CloudWatchAlarmHandler = Handler<CloudWatchAlarmEvent, void>;
|
4 |
|
5 | export interface CloudWatchAlarmEvent {
|
6 | source: string;
|
7 | alarmArn: string;
|
8 | accountId: string;
|
9 | time: string;
|
10 | region: string;
|
11 | alarmData: CloudWatchAlarmData;
|
12 | }
|
13 |
|
14 | export interface CloudWatchAlarmState {
|
15 | value: string;
|
16 | reason: string;
|
17 | timestamp: string;
|
18 | reasonData?: string;
|
19 | actionsSuppressedBy?: string;
|
20 | actionsSuppressedReason?: string;
|
21 | }
|
22 |
|
23 | export interface CloudWatchMetric {
|
24 | namespace: string;
|
25 | name: string;
|
26 | dimensions?: Record<string, string>;
|
27 | }
|
28 |
|
29 | export interface CloudWatchMetricStat {
|
30 | metric: CloudWatchMetric;
|
31 | period: number;
|
32 | stat: string;
|
33 | unit?: string;
|
34 | }
|
35 |
|
36 | export interface CloudWatchAlarmMetric {
|
37 | id: string;
|
38 | metricStat: CloudWatchMetricStat;
|
39 | returnData: boolean;
|
40 | }
|
41 |
|
42 | export interface CloudWatchAlarmExpression {
|
43 | id: string;
|
44 | expression: string;
|
45 | label: string;
|
46 | returnData: boolean;
|
47 | }
|
48 |
|
49 | export type CloudWatchAlarmMetricDataQuery = CloudWatchAlarmMetric | CloudWatchAlarmExpression;
|
50 |
|
51 | export interface CloudWatchAlarmConfiguration {
|
52 | metrics: CloudWatchAlarmMetricDataQuery[];
|
53 | description?: string;
|
54 | }
|
55 |
|
56 | export interface CloudWatchAlarmCompositeConfiguration {
|
57 | alarmRule: string;
|
58 | description?: string;
|
59 | actionsSuppressor?: string;
|
60 | actionsSuppressorWaitPeriod?: number;
|
61 | actionsSuppressorExtensionPeriod?: number;
|
62 | }
|
63 |
|
64 | export interface CloudWatchAlarmData {
|
65 | alarmName: string;
|
66 | state: CloudWatchAlarmState;
|
67 | previousState: CloudWatchAlarmState;
|
68 | configuration: CloudWatchAlarmConfiguration | CloudWatchAlarmCompositeConfiguration;
|
69 | }
|