Code.fromAsset("...") is not updating lambda-functions
See original GitHub issueDescription
When I create a lambda-function within a cdk-stack based on Code.fromAsset("dist", { exclude: ["**", "!lambda-already-bundled-with-webpack.js"] })
, then the lambda-function, when deployed for the first time, works fine. But when a code-update to the lambda-function is made, a re-deploy of the same cdk-stack is not updating the code of the deployed lambda-function. The lambda-function still has the old code from the first deployment. A cdk diff
also says that no changes were detected…
Reproduction Steps
Error Log
Environment
- **CLI Version :1.35.0
- **Framework Version:1.35.0
- **OS :macOS Catalina 10.15.4
- **Language :typescript
Other
This is 🐛 Bug Report
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (6 by maintainers)
Top Results From Across the Web
Dev notes: aws-cdk not updating Lambda function
When using the aws-cdk Lambda docs and examples, the code for the Lambda function is fetched by lambda.Code.fromAsset() This is from a local ......
Read more >CDK not updating - Stack Overflow
Create a new lambda version. Then the lambda's code updates when you deploy the CDK stack! const versionIdKey = 'Versions.0.
Read more >aws-cdk/aws-lambda module - AWS Documentation
NOTE: The currentVersion property is only supported when your AWS Lambda function uses either lambda.Code.fromAsset or lambda.Code.fromInline .
Read more >Creating Lambda Functions in AWS CDK - Complete Guide
The static fromAsset method on the Code class takes a path to a directory on the local file system, where our lambda handler...
Read more >AWS lambda function not updating - Atlassian Community
Solved: hi. I have a bamboo build plan with two steps: "source code checkout" "aws lambda function" everything seems to work.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I just tried your example and it worked fine for me.
The CDK app I used -
The
resources/
folder looks like this -and the asset folder looks like this -
I believe this matches what was intended with the
exclude
option.Nice. Thanks @jogold. Resolving this issue.
Feel free to re-open with more details if it persists.