Skip to main content

CDK Aspect to tag resources with git metadata. This provides a nice connection between the construct and the git repository.

Project description

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. Will create a .git-url-tagger.json file in the root of your project to store the git url. This file will be used to determine the git url for the stack.

How to install

npm install @jjrawlins/cdk-git-tagger

or

yarn add @jjrawlins/cdk-git-tagger

How to use

import { GitUrlTagger } from '@jjrawlins/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');
Aspects.of(app).add(new GitUrlTagger());
app.synth();

Example Output

{
  "Resources": {
    "MyTopic86869434": {
      "Type": "AWS::SNS::Topic",
      "Properties": {
        "Tags": [
          {
            "Key": "GitUrl",
            "Value": "https://github.com/jjrawlins/cdk-cool-construct.git"
          }
        ]
      }
    }
  }
}

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jjrawlins_cdk_git_tagger-0.0.64.tar.gz (34.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jjrawlins_cdk_git_tagger-0.0.64-py3-none-any.whl (33.0 kB view details)

Uploaded Python 3

File details

Details for the file jjrawlins_cdk_git_tagger-0.0.64.tar.gz.

File metadata

File hashes

Hashes for jjrawlins_cdk_git_tagger-0.0.64.tar.gz
Algorithm Hash digest
SHA256 a1b25ac340b58d84bbaef2bb8b2c2c010ca790581fc713833cedc6898682321e
MD5 43775e77e5b837f77ada8febe6a540a8
BLAKE2b-256 e4ccd5768b21fcaee4e24a11dc759c2f935185a64ad29c3053ba1d216d2a43f9

See more details on using hashes here.

File details

Details for the file jjrawlins_cdk_git_tagger-0.0.64-py3-none-any.whl.

File metadata

File hashes

Hashes for jjrawlins_cdk_git_tagger-0.0.64-py3-none-any.whl
Algorithm Hash digest
SHA256 777022bdce694288ec9b7a04cde0092e56337c5ee7fee0d70d5c578c0b269877
MD5 7ddeabf9255a51df905ebc600708d351
BLAKE2b-256 45c9a1d3adb4fd59fb965e80694c9f1d2ae24e813a90be1fa7db866a630da844

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page