UNPKG

cdk-monitoring-constructs

Version:

[![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/cdklabs/cdk-monitoring-constructs) [![NPM version](https://badge.fury.io/js/cdk-monitoring-constructs.svg)](https://badge

41 lines (40 loc) 1.87 kB
import { IWidget } from "aws-cdk-lib/aws-cloudwatch"; import { IFunction } from "aws-cdk-lib/aws-lambda"; import { BaseMonitoringProps, DaysSinceUpdateThreshold, Monitoring, MonitoringScope } from "../../common"; import { SecretsManagerSecretMetricFactoryProps } from "./SecretsManagerSecretMetricFactory"; export interface IPublisherConsumer { consume(lambdaFunction: IFunction): void; } export interface SecretsManagerSecretMonitoringOptions extends BaseMonitoringProps { readonly addDaysSinceLastChangeAlarm?: Record<string, DaysSinceUpdateThreshold>; readonly addDaysSinceLastRotationAlarm?: Record<string, DaysSinceUpdateThreshold>; /** * @default - true, if `addDaysSinceLastRotationAlarm` is set, otherwise `false`. */ readonly showLastRotationWidget?: boolean; /** * Provides access to the underlying metrics publisher Lambda function. * This may be useful if you want to monitor the function itself. */ readonly usePublisher?: IPublisherConsumer; } /** * Monitoring props for Secrets Manager secrets. */ export interface SecretsManagerSecretMonitoringProps extends SecretsManagerSecretMetricFactoryProps, SecretsManagerSecretMonitoringOptions { } export declare class SecretsManagerSecretMonitoring extends Monitoring { protected readonly title: string; private readonly showLastRotationWidget; private readonly alarmFactory; private readonly daysSinceLastChangeMetric; private readonly daysSinceLastChangeAnnotations; private readonly daysSinceLastRotationMetric; private readonly daysSinceLastRotationAnnotations; constructor(scope: MonitoringScope, props: SecretsManagerSecretMonitoringProps); private getDaysSinceLastChangeWidget; private getDaysSinceLastRotationWidget; private getTitleWidget; widgets(): IWidget[]; summaryWidgets(): IWidget[]; }