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.121.tar.gz (33.6 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.121-py3-none-any.whl (32.6 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for jjrawlins_cdk_git_tagger-0.0.121.tar.gz
Algorithm Hash digest
SHA256 39d316c11c200cbcdc85e75702d0394576b1da9f8028c63f7780152ac311ba4e
MD5 1b376e7f45e26f023d962c9902375fef
BLAKE2b-256 e1c12a9b28f0cc2e82f17602f0e86bb55eca0aa32c052f4b8925247ac6957c4d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jjrawlins_cdk_git_tagger-0.0.121-py3-none-any.whl
Algorithm Hash digest
SHA256 2a6939cffc793614cfb071da6d7b5e6408fc364f89d38889e7f4b781ad01607e
MD5 79bf2abfe19f14c627d15f07a11e0139
BLAKE2b-256 8d56c8deb9e550e4e6115c57ac28b24f3d1cf96115489ad61e09a40a03c6260a

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