aws-cdk-lib
Version:
Version 2 of the AWS Cloud Development Kit library
77 lines (76 loc) • 2.51 kB
TypeScript
import type { IAlarmAction } from './alarm-action';
import type { IResource } from '../../core';
import { Resource } from '../../core';
import type { IArrayBox } from '../../core/lib/helpers-internal';
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;
/** @internal */
protected readonly _alarmActionArns: IArrayBox<string>;
/** @internal */
protected readonly _insufficientDataActionArns: IArrayBox<string>;
/** @internal */
protected readonly _okActionArns: IArrayBox<string>;
protected get alarmActionArns(): string[] | undefined;
protected set alarmActionArns(value: string[] | undefined);
protected get insufficientDataActionArns(): string[] | undefined;
protected set insufficientDataActionArns(value: string[] | undefined);
protected get okActionArns(): string[] | undefined;
protected set okActionArns(value: string[] | undefined);
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;
}