Skip to content

aws-cdk-lib: Missing tags when synthesizing after bundling code with esbuild #26169

@Nevon

Description

@Nevon

Describe the bug

When using esbuild to bundle aws-cdk-lib, tags are no longer added to child nodes of a stack when using Tags.of(stack).add(...) since version 2.81.0 of aws-cdk-lib.

Expected Behavior

Tags.of(stack).add('TestTag', 'Value');

should apply the TestTag tag to all taggable child constructs of the stack, whether the code is being bundled or just transpiled.

Current Behavior

No tags are applied to any child constructs.

Reproduction Steps

See https://github.com/Nevon/aws-cdk-repro-26169 for a way to reproduce the issue. The repo creates an app and a stack, adds a few resources and then adds a tag to the stack, after which the template is synthesized. When running with ts-node the template has tags. When running after transpiling and bundling using esbuild, the template does not have any tags.

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.80.1

Framework Version

No response

Node.js Version

v18.15.0

OS

Linux / Mac

Language

Typescript

Language Version

5.1.3

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    aws-cdk-libRelated to the aws-cdk-lib packagebugThis issue is a bug.effort/mediumMedium work item – several days of effortp2

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions