import * as cloudfront from 'aws-cdk-lib/aws-cloudfront'; import { Construct } from 'constructs'; import { IWatchful } from './watchful'; /** * Options for defining alarms. */ export interface WatchCloudfrontDistributionOptions { /** * Number of allowed errors per minute. If there are more errors than that, an alarm will trigger. * * @defaultValue 0 */ readonly errorsPerMinuteThreshold?: number; /** * Threshold for the cache hit alarm as percentage of the Cloudfront Distribution * * If this is set to 40%, the alarm will be set when the cache hit perentage is * lower than the threshold setting * * @defaultValue 40 */ readonly cacheHitPercent?: number; } /** * Properties for defining a WatchCloudfrontDistribution */ export interface WatchCloudfrontDistributionProps extends WatchCloudfrontDistributionOptions { /** * The reference to IWatchful class. Used internally. */ readonly watchful: IWatchful; /** * The cloudfront distribution that should be watched. * [disable-awslint:ref-via-interface] */ readonly cf: cloudfront.Distribution; } /** * A Construct which creates the following alarms for cloudfront distributions: * * - http-code 5xx * - low cache hits */ export declare class WatchCloudfrontDistribution extends Construct { private readonly watchful; private readonly cf; constructor(scope: Construct, id: string, props: WatchCloudfrontDistributionProps); private create5xxMonitor; private createCacheHitMonitor; }