Skip to content

Commit

Permalink
feat(toolkit): include toolkit version in AWS::CDK::Metadata (#1287)
Browse files Browse the repository at this point in the history
Adds the AWS CDK Toolkit version to the modules list
of the AWS::CDK::Metadata resource to improve diagnosability
and analytics.

Fixes #1286
  • Loading branch information
Elad Ben-Israel authored Dec 5, 2018
1 parent 4167d16 commit 5004f50
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/aws-cdk/lib/api/cxapp/stacks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,11 @@ export class AppStacks {

function formatModules(runtime: cxapi.AppRuntime): string {
const modules = new Array<string>();

// inject toolkit version to list of modules
const toolkitVersion = require('../../../package.json').version;
modules.push(`aws-cdk=${toolkitVersion}`);

for (const key of Object.keys(runtime.libraries).sort()) {
modules.push(`${key}=${runtime.libraries[key]}`);
}
Expand Down

0 comments on commit 5004f50

Please sign in to comment.