UNPKG

@baselime/cdk

Version:

Define your observability as code using the AWS CDK

25 lines 1.15 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Dashboard = exports.WidgetType = void 0; const aws_cdk_lib_1 = require("aws-cdk-lib"); const config_1 = require("../config"); var dashboard_1 = require("../types/dashboard"); Object.defineProperty(exports, "WidgetType", { enumerable: true, get: function () { return dashboard_1.WidgetType; } }); class Dashboard extends aws_cdk_lib_1.CfnResource { constructor(id, props) { const parameters = Object.assign(Object.assign({}, props.parameters), { widgets: props.parameters.widgets.map(el => (Object.assign(Object.assign({}, el), { query: el.query.ref }))) }); super(config_1.Baselime.getConstruct(), id, { type: "Custom::BaselimeDashboard", properties: { id, ServiceToken: config_1.Baselime.getServiceToken(), BaselimeApiKey: config_1.Baselime.getApiKey(), Description: props.description, Parameters: parameters, Origin: "cdk" }, }); } } exports.Dashboard = Dashboard; //# sourceMappingURL=dashboard.js.map