question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[pipelines] 1.67.0 breaks custom asset bundling when using multiple pipelines

See original GitHub issue

After updating to CDK 1.67.0, my custom asset bundling logic no longer works while using multiple pipelines. This bundling logic uses the BundlingOptions construct to move the lambda function handler to a nested folder structure. When executing cdk synth on the new CDK version, only the first pipeline defined in app.py uses the bundling logic, and the other copies the code from the path without modifying it.

If I revert back to 1.66.0 I no longer see this behavior, with no other code changes. Both pipelines produce the correct artifacts using the older CDK version.

Reproduction Steps

I have stripped down my code to provide a minimal example, and have posted it here.

Running cdk synth against this code produces 2 assemblies in cdk.out, where each assembly has an asset representing the lambda function. The cdk synth output can also be seen by running the pipeline on AWS, although it is easier to test locally.

What did you expect to happen?

I expected both assets in the cdk.out directory to contain the bundled directory structures.

Both assets should contain a directory structure that looks like the following:

asset.1234
  - entry.py
  - lib
    - function
      - function.py

What actually happened?

Only the first pipeline declared in app.py has the bundled directory structure.

The second asset is bundled using the default settings, which ignore the custom bundling logic.

asset.1234
  - function.py

Environment

  • CLI Version : 1.67.0 (build 2b4dd71)
  • Framework Version: 1.67.0
  • Node.js Version: v12.18.4
  • OS : WSL2 in Windows 10 (same behavior occurs in CodeBuild)
  • Language (Version): Python 3.8

This is 🐛 Bug Report

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:13 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
jogoldcommented, Oct 19, 2020

Seems that the fallback behavior here is an accident and not actually intended, right?

correct

In fact, the code should properly throw if bundling is used and we have a cache hit and we cannot find the already staged asset.

0reactions
github-actions[bot]commented, Oct 26, 2020

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.

Read more comments on GitHub >

github_iconTop Results From Across the Web

aws-cdk.pipelines - PyPI
It is purpose-built to deploy one or more copies of your CDK applications using CloudFormation with a minimal amount of effort on your...
Read more >
CodePipelineProps — AWS Cloud Development Kit 1.183.0 ...
A common way to use bundling assets in your application is by using the @aws-cdk/aws-lambda-nodejs library. Configures privileged mode for the synth CodeBuild ......
Read more >
April 2022 (version 1.67) - Visual Studio Code
File nesting has been available through an experimental setting for several iterations. The behavior now is mostly unchanged, except for file operations.
Read more >
A Quick and Easy Guide to the Asset Pipeline in Rails 7
Here are three reasons why the new asset pipeline is worth looking into: No more asset bundling; No more Webpack nonsense; No more...
Read more >
cdk-assets | Yarn - Package Manager
Important: This documentation covers modern versions of Yarn. For 1.x docs, see classic.yarnpkg.com. Yarn.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found