Skip to content
This repository was archived by the owner on Mar 12, 2025. It is now read-only.

isotoma/cdk-nodejsfunction-asset-size-debugging

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cdk-nodejsfunction-asset-size-debugging

aws/aws-cdk#15346

Believe this to demonstrate some strange behaviour with the CDK where the following mechanisms intersect:

  • @aws-cdk/aws-lambda-nodejs.NodejsFunction
  • @aws-cdk/core.Stage
  • the -e (exclusive) flag to the synth or deploy commands

Branches:

  • main, broken behaviour. Combines the above three mechanisms, asset becomes a zip of the entire project root, rather than an ../asset.[hash] path
  • no-cdk-stage, expected behivour. Remove use of a Stage, attach the stack directly to the App. Asset path is as expected.
  • non-nodejs-lambda-fn, expected behaviour. Remove NodejsFunction and use a regular Function instead. Asset path is as expected.
  • do-not-synth-exclusive, expected behaviour. Remove the -e flag from the synth command. Asset path is as expected.
  • (possibly unrelated): spurious-yarn-lock, broken behaviour. Add a yarn.lock in a parent on the project root. Asset path is now a zip of the parent of the project root. I think this is because it is looking for a yarn.lock first, and this is just a knock-on effect of the issue.

Method (See the check.sh script):

  • Runs the synth command, then looks in the assets manifest
  • Checks if that references the absolute path to the directory root. If so, asserts that something strange and wrong has happened, as would expect the asset to be ../asset[hash].

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors