import * as cloudfront from '@aws-cdk/aws-cloudfront'; import * as cdk from '@aws-cdk/core'; import { IWatchful } from './watchful'; /** * Options for defining alarms. * * @stability stable */ export interface WatchCloudfrontDistributionOptions { /** * Number of allowed errors per minute. * * If there are more errors than that, an alarm will trigger. * * @default 0 * @stability stable */ 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 * * @default 40 * @stability stable */ readonly cacheHitPercent?: number; } /** * Properties for defining a WatchCloudfrontDistribution. * * @stability stable */ export interface WatchCloudfrontDistributionProps extends WatchCloudfrontDistributionOptions { /** * The reference to IWatchful class. * * Used internally. * * @stability stable */ readonly watchful: IWatchful; /** * The cloudfront distribution that should be watched. * * [disable-awslint:ref-via-interface] * * @stability stable */ readonly cf: cloudfront.Distribution; } /** * A Construct which creates the following alarms for cloudfront distributions:. * * - http-code 5xx * - low cache hits * * @stability stable */ export declare class WatchCloudfrontDistribution extends cdk.Construct { private readonly watchful; private readonly cf; /** * @stability stable */ constructor(scope: cdk.Construct, id: string, props: WatchCloudfrontDistributionProps); private create5xxMonitor; private createCacheHitMonitor; }