67 lines
1.9 KiB
TypeScript
67 lines
1.9 KiB
TypeScript
import type { IAlarmAction } from './alarm-action';
|
|
import type { IResource } from '../../core';
|
|
import { Resource } from '../../core';
|
|
import type { IAlarmRef, AlarmReference } from '../../interfaces/generated/aws-cloudwatch-interfaces.generated';
|
|
/**
|
|
* Interface for Alarm Rule.
|
|
*/
|
|
export interface IAlarmRule {
|
|
/**
|
|
* serialized representation of Alarm Rule to be used when building the Composite Alarm resource.
|
|
*/
|
|
renderAlarmRule(): string;
|
|
}
|
|
/**
|
|
* Represents a CloudWatch Alarm
|
|
*/
|
|
export interface IAlarm extends IAlarmRule, IResource, IAlarmRef {
|
|
/**
|
|
* Alarm ARN (i.e. arn:aws:cloudwatch:<region>:<account-id>:alarm:Foo)
|
|
*
|
|
* @attribute
|
|
*/
|
|
readonly alarmArn: string;
|
|
/**
|
|
* Name of the alarm
|
|
*
|
|
* @attribute
|
|
*/
|
|
readonly alarmName: string;
|
|
}
|
|
/**
|
|
* The base class for Alarm and CompositeAlarm resources.
|
|
*/
|
|
export declare abstract class AlarmBase extends Resource implements IAlarm {
|
|
/**
|
|
* @attribute
|
|
*/
|
|
abstract readonly alarmArn: string;
|
|
abstract readonly alarmName: string;
|
|
protected alarmActionArns?: string[];
|
|
protected insufficientDataActionArns?: string[];
|
|
protected okActionArns?: string[];
|
|
get alarmRef(): AlarmReference;
|
|
/**
|
|
* AlarmRule indicating ALARM state for Alarm.
|
|
*/
|
|
renderAlarmRule(): string;
|
|
/**
|
|
* Trigger this action if the alarm fires
|
|
*
|
|
* Typically SnsAction or AutoScalingAction.
|
|
*/
|
|
addAlarmAction(...actions: IAlarmAction[]): void;
|
|
/**
|
|
* Trigger this action if there is insufficient data to evaluate the alarm
|
|
*
|
|
* Typically SnsAction or AutoScalingAction.
|
|
*/
|
|
addInsufficientDataAction(...actions: IAlarmAction[]): void;
|
|
/**
|
|
* Trigger this action if the alarm returns from breaching state into ok state
|
|
*
|
|
* Typically SnsAction or AutoScalingAction.
|
|
*/
|
|
addOkAction(...actions: IAlarmAction[]): void;
|
|
}
|