import { aws_cloudwatch as cloudwatch, aws_codepipeline as cpipeline } from 'aws-cdk-lib'; import { Construct } from 'constructs'; export interface PipelineWatcherProps { /** * The CloudWatch metric namespace to which metrics should be sent */ metricNamespace: string; /** * The CloudWatch metric name for failures. */ failureMetricName: string; /** * Code Pipeline to monitor for failed stages */ pipeline: cpipeline.IPipeline; /** * Set the pipelineName of the alarm description. * * Description is set to 'Pipeline has failed stages' * * @default pipeline's name */ title?: string; } /** * Construct which watches a Code Pipeline for failed stages and raises an alarm * if there are any failed stages. * * A function runs every minute and calls GetPipelineState for the provided pipeline's * name, counts the number of failed stages and emits a JSON log { failedCount: <number> }. * A metric filter is then configured to track this value as a CloudWatch metric, and * a corresponding alarm is set to fire when the maximim value of a single 5-minute interval * is >= 1. */ export declare class PipelineWatcher extends Construct { readonly alarm: cloudwatch.Alarm; constructor(parent: Construct, name: string, props: PipelineWatcherProps); }