@defiance-digital/cdk-git-tagger
TypeScript icon, indicating that this package has built-in type declarations

0.0.4 • Public • Published

CDK Aspect Git Tagger

This is a CDK Aspect that will tag your CDK Stacks with the current git repo location for easier identification of deployed stacks.

How to install

npm install @defiance-digital/cdk-git-tagger

or

yarn add @defiance-digital/cdk-git-tagger

How to use

import { GitUrlTagger } from '@defiance-digital/cdk-git-tagger';
import { App, Aspects, Stack, StackProps } from 'aws-cdk-lib';
import { Topic } from 'aws-cdk-lib/aws-sns';
import { Construct } from 'constructs';

export class MyStack extends Stack {
    constructor(scope: Construct, id: string, props: StackProps = {}) {
        super(scope, id, props);
        // define resources here...
        new Topic(this, 'MyTopic');
    }
}

const app = new App();

new MyStack(app, 'cdk-aspect-git-tagger-tester-dev');
Aspects.of(app).add(new GitUrlTagger());
app.synth();

Example Output

{
  "Resources": {
    "MyTopic86869434": {
      "Type": "AWS::SNS::Topic",
      "Properties": {
        "Tags": [
          {
            "Key": "GitUrl",
            "Value": "https://github.com/defiance-digital/cdk-aspect-git-tagger-test.git"
          }
        ]
      }
    }
  }
}

Readme

Keywords

Package Sidebar

Install

npm i @defiance-digital/cdk-git-tagger

Weekly Downloads

12

Version

0.0.4

License

Apache-2.0

Unpacked Size

129 kB

Total Files

11

Last publish

Collaborators

  • matthew_bonig_defiance
  • defiance-adambigelow
  • defiancedigital