@khulnasoft/cdk
Version:
Define your observability as code using the AWS CDK
62 lines (61 loc) • 2.1 kB
TypeScript
import { Construct } from "constructs";
import { Channel } from './types/alert';
interface KengineConfiguration {
/**
* The Kengine 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:
* `$kengine.stackId = stackName`
*
* @default - Defaults to false
*/
readonly disableStackFilter?: boolean;
/**
* The AWS Account ID where Kengine is deployed.
* Change this property only if you have self-deployed the entire Kengine BackEnd
*
* @default - Defaults to the Kengine AWS Account ID
*/
readonly _account?: string;
}
export declare namespace Kengine {
/**
* Initialize Kengine CDK. Make sure to use this method in the beginning of the stack.
*
* @param {Construct} target
* @param {KengineConfiguration} options
* @example
* import { Kengine } from '@khulnasoft/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)
*
* Kengine.init(this, {
* apiKey: process.env.KENGINE_API_KEY, // Ideally use SSM or Secrets Manager
* defaultChannel: { type: "slack", targets: ["kengine-alerts"] },
* });
*/
function init(target: Construct, options: KengineConfiguration): void;
function getConstruct(): Construct;
function getApiKey(): string;
function getServiceToken(): string;
function getDefaultChannel(): Channel | undefined;
function getDisableStackFilter(): boolean | undefined;
}
export {};