├── .gitignore ├── .npmignore ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── bin └── cdk-lambda-dashboard.ts ├── cdk.json ├── img └── Transactions_Lambda_Dashboard.PNG ├── jest.config.js ├── lib ├── cdk-lambda-dashboard-stack.ts └── cdk-transactions-api-lambda-construct.ts ├── package-lock.json ├── package.json ├── src ├── BeginTransaction.ts ├── GetTransaction.ts └── UpdateTransaction.ts ├── test └── cdk-lambda-dashboard.test.ts └── tsconfig.json /.gitignore: -------------------------------------------------------------------------------- 1 | *.js 2 | !jest.config.js 3 | *.d.ts 4 | node_modules 5 | 6 | # CDK asset staging directory 7 | .cdk.staging 8 | cdk.out 9 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | *.ts 2 | !*.d.ts 3 | 4 | # CDK asset staging directory 5 | .cdk.staging 6 | cdk.out 7 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | ## Code of Conduct 2 | This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct). 3 | For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact 4 | opensource-codeofconduct@amazon.com with any additional questions or comments. 5 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing Guidelines 2 | 3 | Thank you for your interest in contributing to our project. Whether it's a bug report, new feature, correction, or additional 4 | documentation, we greatly value feedback and contributions from our community. 5 | 6 | Please read through this document before submitting any issues or pull requests to ensure we have all the necessary 7 | information to effectively respond to your bug report or contribution. 8 | 9 | 10 | ## Reporting Bugs/Feature Requests 11 | 12 | We welcome you to use the GitHub issue tracker to report bugs or suggest features. 13 | 14 | When filing an issue, please check existing open, or recently closed, issues to make sure somebody else hasn't already 15 | reported the issue. Please try to include as much information as you can. Details like these are incredibly useful: 16 | 17 | * A reproducible test case or series of steps 18 | * The version of our code being used 19 | * Any modifications you've made relevant to the bug 20 | * Anything unusual about your environment or deployment 21 | 22 | 23 | ## Contributing via Pull Requests 24 | Contributions via pull requests are much appreciated. Before sending us a pull request, please ensure that: 25 | 26 | 1. You are working against the latest source on the *main* branch. 27 | 2. You check existing open, and recently merged, pull requests to make sure someone else hasn't addressed the problem already. 28 | 3. You open an issue to discuss any significant work - we would hate for your time to be wasted. 29 | 30 | To send us a pull request, please: 31 | 32 | 1. Fork the repository. 33 | 2. Modify the source; please focus on the specific change you are contributing. If you also reformat all the code, it will be hard for us to focus on your change. 34 | 3. Ensure local tests pass. 35 | 4. Commit to your fork using clear commit messages. 36 | 5. Send us a pull request, answering any default questions in the pull request interface. 37 | 6. Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation. 38 | 39 | GitHub provides additional document on [forking a repository](https://help.github.com/articles/fork-a-repo/) and 40 | [creating a pull request](https://help.github.com/articles/creating-a-pull-request/). 41 | 42 | 43 | ## Finding contributions to work on 44 | Looking at the existing issues is a great way to find something to contribute on. As our projects, by default, use the default GitHub issue labels (enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any 'help wanted' issues is a great place to start. 45 | 46 | 47 | ## Code of Conduct 48 | This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct). 49 | For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact 50 | opensource-codeofconduct@amazon.com with any additional questions or comments. 51 | 52 | 53 | ## Security issue notifications 54 | If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/). Please do **not** create a public github issue. 55 | 56 | 57 | ## Licensing 58 | 59 | See the [LICENSE](LICENSE) file for our project's licensing. We will ask you to confirm the licensing of your contribution. 60 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the "Software"), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 7 | the Software, and to permit persons to whom the Software is furnished to do so. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 10 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 11 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 12 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 13 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 14 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CloudWatch Lambda Dashboards using CDK 2 | 3 | This project is an example of building a CloudWatch Dashboard for Lambdas to visualize the Invocations, Concurrent Executions, Duration, and Errors. The CDK Stack provided uses the CloudWatch Metric and GraphWidget classes to visualize the graphs. The project also includes a sample Lambda functions with API Gateway integrations to showcase the dashboards. The stack adds one row for each Lambda to the Dashboard to get a single view for selected metrics and alarms to help you assess the health of your Lambda resources. Invocations, Duration, Errors, and Concurrent Execution Metrics are the selected metrics. 4 | 5 | ## Getting started 6 | 7 | To get started, clone this [cdk-lambda-dashboard](https://github.com/aws-samples/aws-cdk-lambda-cloudwatch-dashboard). The repository contains a [CDK App](bin/cdk-lambda-dashboard.ts) in TypeScript that deploys a [CDK Stack](lib/cdk-lambda-dashboard-stack.ts). 8 | 9 | To see or the edit the CloudWatch dashboard, please refer [CDK App](bin/cdk-lambda-dashboard.ts). 10 | 11 | ### CDK Concepts 12 | 13 | This topic describes some of the concepts \(the why and how\) behind the AWS CDK\. 14 | 15 | AWS CDK apps are composed of building blocks known as [Constructs](https://docs.aws.amazon.com/cdk/latest/guide/constructs.html), which are composed together to form [stacks](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_core.Stack.html) and [apps](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_core.App.html)\. 16 | 17 | Please visit [here](https://docs.aws.amazon.com/cdk/latest/guide/core_concepts.html) for further referene. 18 | 19 | ### Prerequisites 20 | 21 | To run the sample, you will need: 22 | 23 | 1. An AWS Account into which you will deploy services. Be sure that you have permissions to deploy resources in the AWS Account 24 | 2. CDK Setup is completed by following [this guide](https://docs.aws.amazon.com/cdk/latest/guide/getting_started.html#getting_started_prerequisites) 25 | 3. Node setup is completed by following [this guide](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) 26 | 4. Configure your AWS profile using the [quickstart guide](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-quickstart.html) 27 | 28 | ### Deployment 29 | 30 | To deploy the sample, perform the following: 31 | 32 | 1. Clone the [cdk-lambda-dashboard](https://github.com/aws-samples/aws-cdk-lambda-cloudwatch-dashboard) to your local 33 | 2. Run `npm install` to install the necessary node modules needed for the project 34 | 3. Run `npm run build` to compile the project 35 | 4. Run `cdk synth` to see the CloudFormation template 36 | 5. Run `cdk deploy` to deploy the Stack 37 | 6. Upon successful deployment, you can go into CloudWatch to see the Dashboard (see/edit the [cdk-lambda-dashboard.ts](bin/cdk-lambda-dashboard.ts) for Dashboard name). A sample snapshot is listed here. 38 | 39 | ![LambdaDashboard](img/Transactions_Lambda_Dashboard.PNG) 40 | 41 | ### Clean up your Stack 42 | 43 | You can delete the stack by running `cdk destroy`. 44 | 45 | ## Useful commands 46 | 47 | * `npm run build` compile typescript to js 48 | * `npm run watch` watch for changes and compile 49 | * `npm run test` perform the jest unit tests 50 | * `cdk deploy` deploy this stack to your default AWS account/region 51 | * `cdk diff` compare deployed stack with current state 52 | * `cdk synth` emits the synthesized CloudFormation template 53 | * `cdk destroy` delete this stack from your default AWS Account/region 54 | 55 | ## Reference Documentation 56 | 57 | * [Configuring the AWS CLI ](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) 58 | * [What is the AWS CDK?](https://docs.aws.amazon.com/cdk/latest/guide/home.html) 59 | * [Using Amazon CloudWatch dashboards](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Dashboards.html) 60 | 61 | ## Security 62 | 63 | See [CONTRIBUTING](CONTRIBUTING.md) for more information. 64 | 65 | ## License 66 | 67 | This library is licensed under the MIT-0 License. See the [LICENSE](LICENSE) file. 68 | -------------------------------------------------------------------------------- /bin/cdk-lambda-dashboard.ts: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | import * as cdk from '@aws-cdk/core'; 3 | import { CdkLambdaDashboardStack } from '../lib/cdk-lambda-dashboard-stack'; 4 | import { TransactionsAPI } from '../lib/cdk-transactions-api-lambda-construct'; 5 | 6 | const app = new cdk.App(); 7 | 8 | const lambdaDashboardStack = new CdkLambdaDashboardStack(app, 'TransactionsLambdaDashboardStack', { 9 | dashboardName: "TransactionsLambdaDashboard" 10 | }); 11 | 12 | const transactionsApi = new TransactionsAPI(lambdaDashboardStack, "TransactionsApi"); 13 | 14 | lambdaDashboardStack.addLambda("BeginTransaction", "BeginTransaction"); 15 | lambdaDashboardStack.addLambda("UpdateTransaction", "UpdateTransaction"); 16 | lambdaDashboardStack.addLambda("GetTransaction", "GetTransaction"); 17 | -------------------------------------------------------------------------------- /cdk.json: -------------------------------------------------------------------------------- 1 | { 2 | "app": "npx ts-node --prefer-ts-exts bin/cdk-lambda-dashboard.ts", 3 | "context": { 4 | "@aws-cdk/aws-apigateway:usagePlanKeyOrderInsensitiveId": true, 5 | "@aws-cdk/core:enableStackNameDuplicates": "true", 6 | "aws-cdk:enableDiffNoFail": "true", 7 | "@aws-cdk/core:stackRelativeExports": "true", 8 | "@aws-cdk/aws-ecr-assets:dockerIgnoreSupport": true, 9 | "@aws-cdk/aws-secretsmanager:parseOwnedSecretName": true, 10 | "@aws-cdk/aws-kms:defaultKeyPolicies": true, 11 | "@aws-cdk/aws-s3:grantWriteWithoutAcl": true, 12 | "@aws-cdk/aws-ecs-patterns:removeDefaultDesiredCount": true, 13 | "@aws-cdk/aws-rds:lowercaseDbIdentifier": true, 14 | "@aws-cdk/aws-efs:defaultEncryptionAtRest": true, 15 | "@aws-cdk/aws-lambda:recognizeVersionProps": true, 16 | "@aws-cdk/aws-cloudfront:defaultSecurityPolicyTLSv1.2_2021": true 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /img/Transactions_Lambda_Dashboard.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/aws-cdk-lambda-cloudwatch-dashboard/33b05abd1dace758a70d169cb36da9c7bcd869c0/img/Transactions_Lambda_Dashboard.PNG -------------------------------------------------------------------------------- /jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | testEnvironment: 'node', 3 | roots: ['/test'], 4 | testMatch: ['**/*.test.ts'], 5 | transform: { 6 | '^.+\\.tsx?$': 'ts-jest' 7 | } 8 | }; 9 | -------------------------------------------------------------------------------- /lib/cdk-lambda-dashboard-stack.ts: -------------------------------------------------------------------------------- 1 | import * as cdk from '@aws-cdk/core'; 2 | import { Dashboard, GraphWidget, Metric } from '@aws-cdk/aws-cloudwatch'; 3 | 4 | export interface LambdaDashboardsStackProps extends cdk.StackProps { 5 | dashboardName: string; 6 | } 7 | 8 | export class CdkLambdaDashboardStack extends cdk.Stack { 9 | 10 | protected readonly lambdaDashboard: Dashboard; 11 | 12 | protected readonly invocations = new Metric({ 13 | namespace: "AWS/Lambda", 14 | metricName: "Invocations", 15 | statistic: "sum" 16 | }); 17 | 18 | protected readonly duration = new Metric({ 19 | namespace: "AWS/Lambda", 20 | metricName: "Duration", 21 | statistic: "min" 22 | }); 23 | 24 | protected readonly errors = new Metric({ 25 | namespace: "AWS/Lambda", 26 | metricName: "Errors", 27 | statistic: "sum" 28 | }); 29 | 30 | protected readonly throttles = new Metric({ 31 | namespace: "AWS/Lambda", 32 | metricName: "Throttles", 33 | statistic: "sum" 34 | }); 35 | 36 | protected readonly provisionedConcurrencySpillovers = new Metric({ 37 | namespace: "AWS/Lambda", 38 | metricName: "ProvisionedConcurrencySpilloverInvocations", 39 | statistic: "sum" 40 | }); 41 | 42 | protected readonly concurrentExecutions = new Metric({ 43 | namespace: "AWS/Lambda", 44 | metricName: "ConcurrentExecutions", 45 | statistic: "sum" 46 | }); 47 | 48 | protected readonly provisionedConcurrentExecutions = new Metric({ 49 | namespace: "AWS/Lambda", 50 | metricName: "ProvisionedConcurrentExecutions", 51 | statistic: "sum" 52 | }); 53 | 54 | protected readonly provisionedConcurrencyUtilization = new Metric({ 55 | namespace: "AWS/Lambda", 56 | metricName: "ProvisionedConcurrencyUtilization", 57 | statistic: "sum" 58 | }); 59 | 60 | constructor(scope: cdk.App, id: string, props: LambdaDashboardsStackProps) { 61 | super(scope, id, props); 62 | 63 | this.lambdaDashboard = new Dashboard(this, props.dashboardName, { 64 | dashboardName: props.dashboardName 65 | }); 66 | } 67 | 68 | // adds one row to dashboard for each lambda function 69 | public addLambda(functionName: string, displayName: string) { 70 | 71 | const dimensions = { 72 | "FunctionName": functionName 73 | }; 74 | 75 | this.lambdaDashboard.addWidgets( 76 | new GraphWidget({ 77 | title: displayName + " Invocations", 78 | left: [ 79 | this.invocations.with({ 80 | dimensions: dimensions, 81 | }), 82 | 83 | ] 84 | }), 85 | 86 | new GraphWidget({ 87 | title: displayName + " Duration", 88 | left: [ 89 | this.duration.with({ 90 | dimensions: dimensions, 91 | }), 92 | this.duration.with({ 93 | dimensions: dimensions, 94 | statistic: "avg" 95 | }), 96 | this.duration.with({ 97 | dimensions: dimensions, 98 | statistic: "max" 99 | }), 100 | ] 101 | }), 102 | 103 | new GraphWidget({ 104 | title: displayName + " Errors", 105 | left: [ 106 | this.errors.with({ 107 | dimensions: dimensions, 108 | }), 109 | this.throttles.with({ 110 | dimensions: dimensions, 111 | }), 112 | this.provisionedConcurrencySpillovers.with({ 113 | dimensions: dimensions, 114 | }) 115 | ] 116 | }), 117 | 118 | new GraphWidget({ 119 | title: displayName + " ConcurrentExecutions", 120 | right: [ 121 | this.concurrentExecutions.with({ 122 | dimensions: dimensions, 123 | }), 124 | this.provisionedConcurrentExecutions.with({ 125 | dimensions: dimensions, 126 | }), 127 | this.provisionedConcurrencyUtilization.with({ 128 | dimensions: dimensions, 129 | }) 130 | ] 131 | }), 132 | ); 133 | } 134 | } 135 | -------------------------------------------------------------------------------- /lib/cdk-transactions-api-lambda-construct.ts: -------------------------------------------------------------------------------- 1 | import * as cdk from '@aws-cdk/core'; 2 | import * as apigateway from "@aws-cdk/aws-apigateway"; 3 | import * as lambda from "@aws-cdk/aws-lambda"; 4 | 5 | export class TransactionsAPI extends cdk.Construct { 6 | constructor(scope: cdk.Construct, id: string) { 7 | super(scope, id); 8 | 9 | const getTransactionHandler = new lambda.Function(this, "GetTransaction", { 10 | functionName: "GetTransaction", 11 | runtime: lambda.Runtime.NODEJS_14_X, 12 | code: lambda.Code.fromAsset("src"), 13 | handler: "GetTransaction.handler", 14 | }); 15 | 16 | const beginTransactionHandler = new lambda.Function(this, "BeginTransaction", { 17 | functionName: "BeginTransaction", 18 | runtime: lambda.Runtime.NODEJS_14_X, 19 | code: lambda.Code.fromAsset("src"), 20 | handler: "BeginTransaction.handler", 21 | }); 22 | 23 | const updateTransactionHandler = new lambda.Function(this, "UpdateTransaction", { 24 | functionName: "UpdateTransaction", 25 | runtime: lambda.Runtime.NODEJS_14_X, 26 | code: lambda.Code.fromAsset("src"), 27 | handler: "UpdateTransaction.handler", 28 | }); 29 | 30 | const transactionsApi = new apigateway.RestApi(this, "TransactionsAPI", { 31 | restApiName: "Transactions API", 32 | description: "Critical Transactions API" 33 | }); 34 | 35 | const transactions = transactionsApi.root.addResource("transactions") 36 | const transaction = transactions.addResource("{transaction_id}") 37 | 38 | const beginTransactionIntegration = new apigateway.LambdaIntegration(beginTransactionHandler, { 39 | requestTemplates: { "application/json": '{ "statusCode": "200" }' } 40 | }); 41 | transactions.addMethod("POST", beginTransactionIntegration); 42 | 43 | const getTransactionIntegration = new apigateway.LambdaIntegration(getTransactionHandler, { 44 | requestTemplates: { "application/json": '{ "statusCode": "200" }' } 45 | }); 46 | transaction.addMethod("GET", getTransactionIntegration); 47 | 48 | 49 | const updateTransactionIntegration = new apigateway.LambdaIntegration(updateTransactionHandler, { 50 | requestTemplates: { "application/json": '{ "statusCode": "200" }' } 51 | }); 52 | transaction.addMethod("PUT", updateTransactionIntegration); 53 | } 54 | } -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cdk-lambda-dashboard", 3 | "version": "0.1.0", 4 | "bin": { 5 | "cdk-lambda-dashboard": "bin/cdk-lambda-dashboard.js" 6 | }, 7 | "scripts": { 8 | "build": "tsc", 9 | "watch": "tsc -w", 10 | "test": "jest", 11 | "cdk": "cdk" 12 | }, 13 | "devDependencies": { 14 | "@aws-cdk/assert": "1.126.0", 15 | "@types/aws-lambda": "^8.10.84", 16 | "@types/jest": "^26.0.10", 17 | "@types/node": "10.17.27", 18 | "aws-cdk": "1.128.0", 19 | "jest": "^27.3.1", 20 | "ts-jest": "^27.0.0", 21 | "ts-node": "^9.0.0", 22 | "typescript": "^3.9.10" 23 | }, 24 | "dependencies": { 25 | "@aws-cdk/aws-apigateway": "^1.128.0", 26 | "@aws-cdk/aws-cloudwatch": "1.128.0", 27 | "@aws-cdk/aws-lambda": "^1.128.0", 28 | "@aws-cdk/core": "1.128.0", 29 | "@types/uuid": "^8.3.1", 30 | "aws-sdk": "^2.1008.0" 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/BeginTransaction.ts: -------------------------------------------------------------------------------- 1 | import { APIGatewayProxyEvent } from "aws-lambda"; 2 | 3 | exports.handler = async function (event: APIGatewayProxyEvent) { 4 | var method = event.httpMethod; 5 | 6 | if (method === "POST") { 7 | return { 8 | statusCode: 200, 9 | headers: {}, 10 | body: event.body 11 | }; 12 | } 13 | 14 | return { 15 | statusCode: 400, 16 | headers: {}, 17 | body: "Bad Request - Only POST is allowed" 18 | }; 19 | } 20 | -------------------------------------------------------------------------------- /src/GetTransaction.ts: -------------------------------------------------------------------------------- 1 | import { APIGatewayProxyEvent } from "aws-lambda"; 2 | 3 | exports.handler = async function (event: APIGatewayProxyEvent) { 4 | var method = event.httpMethod; 5 | 6 | if (method === "GET") { 7 | 8 | const transaction_id = event.pathParameters ? event.pathParameters["transaction_id"] : null; 9 | 10 | var body = { 11 | transaction_id: transaction_id 12 | } 13 | 14 | return { 15 | statusCode: 200, 16 | headers: {}, 17 | body: JSON.stringify(body) 18 | }; 19 | } 20 | 21 | return { 22 | statusCode: 400, 23 | headers: {}, 24 | body: "Bad Request - Only GET is allowed" 25 | }; 26 | } 27 | -------------------------------------------------------------------------------- /src/UpdateTransaction.ts: -------------------------------------------------------------------------------- 1 | import { APIGatewayProxyEvent } from "aws-lambda"; 2 | 3 | exports.handler = async function (event: APIGatewayProxyEvent) { 4 | var method = event.httpMethod; 5 | 6 | if (method === "PUT") { 7 | 8 | const transaction_id = event.pathParameters ? event.pathParameters["transaction_id"] : null; 9 | 10 | var body = { 11 | transaction_id: transaction_id 12 | } 13 | 14 | return { 15 | statusCode: 200, 16 | headers: {}, 17 | body: JSON.stringify(body) 18 | }; 19 | } 20 | 21 | return { 22 | statusCode: 400, 23 | headers: {}, 24 | body: "Bad Request - Only PUT is allowed" 25 | }; 26 | } 27 | -------------------------------------------------------------------------------- /test/cdk-lambda-dashboard.test.ts: -------------------------------------------------------------------------------- 1 | import { expect as expectCDK, haveResource } from '@aws-cdk/assert'; 2 | import * as cdk from '@aws-cdk/core'; 3 | import * as CdkLambdaDashboard from '../lib/cdk-lambda-dashboard-stack'; 4 | 5 | test('Lambda Dashboard Created', () => { 6 | const app = new cdk.App(); 7 | // WHEN 8 | const stack = new CdkLambdaDashboard.CdkLambdaDashboardStack(app, 'MyTestStack', { 9 | dashboardName: "myLambdaDashboard" 10 | }); 11 | // THEN 12 | expectCDK(stack).to(haveResource("AWS::CloudWatch::Dashboard", { 13 | DashboardName: "myLambdaDashboard" 14 | })); 15 | }); 16 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES2018", 4 | "module": "commonjs", 5 | "lib": [ 6 | "es2018" 7 | ], 8 | "declaration": true, 9 | "strict": true, 10 | "noImplicitAny": true, 11 | "strictNullChecks": true, 12 | "noImplicitThis": true, 13 | "alwaysStrict": true, 14 | "noUnusedLocals": false, 15 | "noUnusedParameters": false, 16 | "noImplicitReturns": true, 17 | "noFallthroughCasesInSwitch": false, 18 | "inlineSourceMap": true, 19 | "inlineSources": true, 20 | "experimentalDecorators": true, 21 | "strictPropertyInitialization": false, 22 | "typeRoots": [ 23 | "./node_modules/@types" 24 | ] 25 | }, 26 | "exclude": [ 27 | "node_modules", 28 | "cdk.out" 29 | ] 30 | } 31 | --------------------------------------------------------------------------------