Skip to content

(aws-cdk): asset bundling skipped when using --exclusively option #12898

@spkjp

Description

@spkjp

Asset bundling is currently broken when using the --exclusively option during deploy.

In our case we have an aws-lambda-nodejs with forceDockerBuild set to true (but it shouldn't matter).

However, due to the following check the bundling never happens when e.g. running cdk deploy --exclusively 'MyStack' -
as in it will skip the bundling step completely.

Concretely, this minimatch evaluates to false for any given stack name, except when using --all which evaluates to the wildcard * satisfying anything.

skip = !bundlingStacks.find(pattern => minimatch(Stack.of(this).stackName, pattern));

That is because Stack.of(this).stackName is not resolved at this point. The screenshot shows the output of running with --all (bundlingStacks contains [*]) against the unresolved stack name:

image

Tested on Linux and Windows and CDK 1.88.


This is 🐛 Bug Report

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis issue is a bug.effort/smallSmall work item – less than a day of effortp1package/toolsRelated to AWS CDK Tools or CLI

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions