Skip to content

Instantly share code, notes, and snippets.

@cuperman
Created January 30, 2020 04:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cuperman/ee6d93ff9bd63ffe711ae6221601c3f2 to your computer and use it in GitHub Desktop.
Save cuperman/ee6d93ff9bd63ffe711ae6221601c3f2 to your computer and use it in GitHub Desktop.
Using Tag Manager
import { StackProps, Stack, Construct, Tag } from '@aws-cdk/core'
export class BaseStack extends Stack {
constructor(scope: Construct, id: string, props: StackProps) {
super(scope, id, props);
const { tags } = props;
// Make sure everything is tagged
Object.entries(tags).forEach(([name, value]) => {
this.node.applyAspect(new Tag(name, value));
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment