aws / aws/aws-cdk

CDK Pipelines: NodejsFunction not working

Open
#28,026 3 comments 0 reactions 0 assignees View on GitHub
@aws-cdk/pipelines bug p1
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
2d 3h
Merged PRs (30d)
83

Description

### Describe the bug

When using NodejsFunction along with a CDK pipeline, the lambda fn's code is being packaged with an empty zip and is being uploaded.

### Expected Behavior

A non-empty ZIP is uploaded

### Current Behavior

An empty ZIP is uploaded

### Reproduction Steps

Replication code - https://github.com/mrlikl/node-js-lambda

### Possible Solution

Quick update on this, while looking a similar issue where tarball was not being uploaded, came across this [GH issue](https://github.com/aws/aws-cdk/issues/24827#issuecomment-1527454175).

Every stage of the pipeline has a separate folder inside cdk.out however the assets are present at the root of cdk.out.

### Additional Information/Context

_No response_

### CDK CLI Version

-

### Framework Version

_No response_

### Node.js Version

-

### OS

-

### Language

TypeScript

### Language Version

_No response_

### Other information

_No response_

Contributor guide

Open the contributing guide

Research direction

Start with the linked reproduction repository and inspect the cdk.out layout produced by CDK Pipelines and NodejsFunction. Compare the stage-specific folders with the assets at the cdk.out root; done when each pipeline stage uploads a non-empty Lambda ZIP.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, node.js, typescript
Domain
build-system, cloud, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.