import type { Construct } from 'constructs'; import type { AlarmMuteRuleReference, IAlarmMuteRuleRef, IAlarmRef } from './cloudwatch.generated'; import * as cdk from '../../core'; /** * Represents an instance of a CloudWatch alarm mute rule. */ export interface IAlarmMuteRule extends cdk.IResource, IAlarmMuteRuleRef { /** * The ARN of the alarm mute rule. * * @attribute */ readonly alarmMuteRuleArn: string; /** * The name of the alarm mute rule. * * @attribute */ readonly alarmMuteRuleName: string; } /** * Represents a calendar date and time. */ export interface CalendarDateTime { /** * The year of the date. */ readonly year: number; /** * The month of the date. Valid range: 1-12 */ readonly month: number; /** * The day of the date. Valid range: 1-31 */ readonly day: number; /** * The hour of the time. Valid range: 0-23 */ readonly hour: number; /** * The minute of the time. Valid range: 0-59 */ readonly minute: number; } /** * Schedule expression for CloudWatch alarm mute rule * * You can choose from three schedule types when configuring your schedule: cron-based and one-time schedules. * Cron-based schedule is recurring schedule. * * @see https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/alarm-mute-rules.html#defining-alarm-mute-rules */ export declare abstract class ScheduleExpression { /** * Construct a one-time schedule from a date. * * @param date The date and time to use. The millisecond part will be ignored. * @param timeZone The time zone to use for interpreting the date. Default: - UTC */ static at(date: CalendarDateTime, timeZone?: cdk.TimeZone): ScheduleExpression; /** * Construct a schedule from a literal schedule expression * @param expression The expression to use. Must be in a format that CloudWatch will recognize * @param timeZone The time zone to use for interpreting the expression. Default: - UTC */ static expression(expression: string, timeZone?: cdk.TimeZone): ScheduleExpression; /** * Create a recurring schedule from a set of cron fields and time zone. */ static cron(options: CronOptions): ScheduleExpression; /** * Retrieve the expression for this schedule */ abstract readonly expressionString: string; /** * Retrieve the expression for this schedule */ abstract readonly timeZone?: cdk.TimeZone; protected constructor(); } /** * Options to configure a cron expression * * All fields are strings so you can use complex expressions. * Absence of a field implies '*'. * * @see https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/alarm-mute-rules.html#defining-alarm-mute-rules */ export interface CronOptions { /** * The minute to run this rule at */ readonly minute: string; /** * The hour to run this rule at * * @default - Every hour */ readonly hour?: string; /** * The day of the month to run this rule at * * @default - Every day of the month */ readonly day?: string; /** * The month to run this rule at * * @default - Every month */ readonly month?: string; /** * The day of the week to run this rule at * * @default - Any day of the week */ readonly weekDay?: string; /** * The timezone to run the schedule in * * @default - TimeZone.ETC_UTC */ readonly timeZone?: cdk.TimeZone; } /** * Options used to configure a CloudWatch alarm mute rule. */ export interface AlarmMuteRuleOptions { /** * The name of the alarm mute rule. This name must be unique within your AWS account and region. * @default - generated by CloudFormation */ readonly alarmMuteRuleName?: string; /** * A description of the alarm mute rule that helps you identify its purpose. * @default - no description */ readonly description?: string; /** * The schedule defines when alarms should be muted. */ readonly schedule: ScheduleExpression; /** * The length of time that alarms remain muted when the schedule activates. * * Minimum: 1 minute, * Maximum: 15 days */ readonly duration: cdk.Duration; /** * The date and time after which the mute rule takes effect. * If not specified, the mute rule takes effect immediately upon creation and the mutes are applied as per the schedule expression. * * This date and time is interpreted according to the schedule timezone, or UTC if no timezone is specified. * * @default - no configuration */ readonly start?: CalendarDateTime; /** * The date and time when the mute rule expires and is no longer evaluated. * After this time, the rule status becomes EXPIRED and will no longer mute the targeted alarms. * * This date and time is interpreted according to the schedule timezone, or UTC if no timezone is specified. * * @default - no configuration */ readonly expire?: CalendarDateTime; /** * A list of tags associated with the alarm mute rule. * Tags help you organize and categorize your AWS resources. * * @default - No tags are applied */ readonly tags?: { [key: string]: string; }; } /** * Properties used to configure a CloudWatch alarm mute rule. */ export interface AlarmMuteRuleProps extends AlarmMuteRuleOptions { /** * The list of alarms that this mute rule targets. You can specify up to 100 alarms. * * @default - no target alarms */ readonly alarms?: IAlarmRef[]; } /** * A CloudWatch Alarm Mute Rule. */ export declare class AlarmMuteRule extends cdk.Resource implements IAlarmMuteRule { /** Uniquely identifies this class. */ static readonly PROPERTY_INJECTION_ID: string; /** * Import an existing CloudWatch alarm mute rule provided an Name. * * @param scope The parent creating construct (usually `this`) * @param id The construct's name * @param alarmMuteRuleName Alarm Mute Rule Name */ static fromAlarmMuteRuleName(scope: Construct, id: string, alarmMuteRuleName: string): IAlarmMuteRule; /** * Import an existing CloudWatch alarm mute rule provided an ARN. * * @param scope The parent creating construct (usually `this`) * @param id The construct's name * @param alarmMuteRuleArn Alarm Mute Rule ARN */ static fromAlarmMuteRuleArn(scope: Construct, id: string, alarmMuteRuleArn: string): IAlarmMuteRule; private readonly alarms; private readonly alarmMuteRule; constructor(scope: Construct, id: string, props: AlarmMuteRuleProps); get alarmMuteRuleRef(): AlarmMuteRuleReference; /** * ARN of this alarm mute rule. * * @attribute */ get alarmMuteRuleArn(): string; /** * Name of this alarm mute rule. * * @attribute */ get alarmMuteRuleName(): string; /** * Add a CloudWatch alarm to mute rule target alarms. */ addAlarm(alarm: IAlarmRef): void; }