How to add a tag to an AWS-CDK specific construct or even better one tag definition to all ressources created within the stack?
The above answers use the deprecated syntax.
Newer version of tagging the whole App:
const app = new cdk.App();
new SomeStack(app, 'SomeStack');
Tags.of(app).add("app", "my-app-name-here");
You could also tag individual stacks only:
const app = new cdk.App();
const stack = new SomeStack(app, 'SomeStack');
Tags.of(stack).add("stack-name", "SomeStack");
Or individual Constructs:
const usersTable = new dynamodb.Table(this, 'Users');
Tags.of(usersTable).add("owner", "team-andromeda");
Tags will apply to sub-Constructs hierarchically.