1.1.2 • Published 7 months ago

cdk-mentor v1.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

cdk-mentor

This library acts as a mentor to AWS CDK users, providing guidance and suggestions for better infrastructure coding practices. Inspired by cfn_nag.

Stability: Experimental

View on Construct Hub

Overview Image

cdk-mentor-demo

This library uses Aspects and is executed during the prepare phase.

phase

Introduction

% npm install -D cdk-mentor
import * as cdk from 'aws-cdk-lib';
import * as sns from 'aws-cdk-lib/aws-sns';
import { TestStack } from '../lib/test-stack';
import { CdkMentor } from 'cdk-mentor';

const app = new cdk.App();
const stack = new TestStack(app, 'TestStack');
cdk.Aspects.of(app).add(new CdkMentor());
import * as cdk from 'aws-cdk-lib';
import { Construct } from 'constructs';
import * as sns from 'aws-cdk-lib/aws-sns';

export class TestStack extends cdk.Stack {
  constructor(scope: Construct, id: string, props?: cdk.StackProps) {
    super(scope, id, props);
    new sns.Topic(this, 'testTopic'); // Construct ID is NOT PascalCase
  }
}
% npx cdk synth -q
[Error at /TestStack/testTopic/Resource] [ERR:001]: Construct ID "testTopic"should be defined in PascalCase.
Found errors

Available Rules

  • Recommends PascalCase for Construct IDs
  • Avoid Stack or Construct in Construct IDs
  • Detecte strong cross-stack references
1.1.1

7 months ago

1.1.0

7 months ago

1.1.2

7 months ago

1.0.2

7 months ago

1.0.3

7 months ago

1.0.1

7 months ago

1.0.0

7 months ago