@baselime/cdk
Version:
Define your observability as code using the AWS CDK
62 lines (61 loc) • 2.12 kB
TypeScript
import { Construct } from "constructs";
import { Channel } from './types/alert';
interface BaselimeConfiguration {
/**
* The Baselime API key
*/
readonly apiKey: string;
/**
* The region to deploy this Observability as Code to.
*
* @default - Defaults to the CDK_DEPLOY_REGION environment variable
*/
readonly region?: string;
/**
* The channel to send all the alerts by default.
*/
readonly defaultChannel?: Channel;
/**
* Wether or not to add a filter on stack name to all the queries
* When `disableStackFilter` is set to `true`, this filter is removed:
* `$baselime.stackId = stackName`
*
* @default - Defaults to false
*/
readonly disableStackFilter?: boolean;
/**
* The AWS Account ID where Baselime is deployed.
* Change this property only if you have self-deployed the entire Baselime BackEnd
*
* @default - Defaults to the Baselime AWS Account ID
*/
readonly _account?: string;
}
export declare namespace Baselime {
/**
* Initialize Baselime CDK. Make sure to use this method in the beginning of the stack.
*
* @param {Construct} target
* @param {BaselimeConfiguration} options
* @example
* import { Baselime } from '@baselime/cdk'
* import * as cdk from 'aws-cdk-lib'
* import { Construct } from 'constructs'
*
* export class ExamplesStack extends cdk.Stack {
* constructor(scope: Construct, id: string, props?: cdk.StackProps) {
* super(scope, id, props)
*
* Baselime.init(this, {
* apiKey: process.env.BASELIME_API_KEY, // Ideally use SSM or Secrets Manager
* defaultChannel: { type: "slack", targets: ["baselime-alerts"] },
* });
*/
function init(target: Construct, options: BaselimeConfiguration): void;
function getConstruct(): Construct;
function getApiKey(): string;
function getServiceToken(): string;
function getDefaultChannel(): Channel | undefined;
function getDisableStackFilter(): boolean | undefined;
}
export {};