Comments (2)
I'll address those two suggestions separately:
- a) Changing the directory structure is a far from ideal solution in our use case. b) Nor do I feel caching the dependencies should be related to the CodeUri, I'm referring to the
.aws-sam/deps/
directory, which only contains npm dependencies, not the.aws-sam/build/
or/.aws-sam/cache
directories. c) many of these lambdas are in the same directory, and with the CodeUri specified it's still building to different.aws-sam/deps/
directories, see the manifest hash and CodeUri below are all the same but the dependency folder is different:
Manifest file is changed (new hash: ea718884c53ee6b0028d7c088f8fefeb) or dependency folder (.aws-sam/deps/70501117-f47d-4d63-84e2-1ed000911263) is missing for (Lambda1Function)
Building codeuri: backend/api/src/handlers/subfolder1
Manifest file is changed (new hash: ea718884c53ee6b0028d7c088f8fefeb) or dependency folder (.aws-sam/deps/5af21d52-0418-420a-82bd-775da3082ff6) is missing for (Lambda2Function)
Building codeuri: backend/api/src/handlers/subfolder1
Manifest file is changed (new hash: ea718884c53ee6b0028d7c088f8fefeb) or dependency folder (.aws-sam/deps/1c6738a0-e3f2-4f74-9c6e-f983a96cd008) is missing for (Lambda3Function)
Building codeuri: backend/api/src/handlers/subfolder1
- We are using esbuild to bundle these functions which is a far better solution in this case than use a layer, so this isn't an option.
In short, I think there probably is still an issue here, either documentation related or build related.
from aws-sam-cli.
Hi, the build dependencies are cached based on the manifest file (the package.json
file), and the value of the CodeUri
for each of the functions. If you tried moving the handler files to the same directory (and updating the corresponding CodeUri
s in the template), you should see that the deps are shared. Alternatively, you can utilize a Lambda Layer to share common dependencies, instead of having a single package.json
shared between Lambda Functions.
from aws-sam-cli.
Related Issues (20)
- Bug: `sam local invoke` takes client environment variable value over defined value in template.yaml HOT 3
- Sam build with project references in adjacent directory (.NET8 NativeAOT) HOT 4
- `sam sync` with typescript not updating Lambda layer code in Lambda function HOT 5
- Bug: Docker 4.33 + Provided.al2 Image error HOT 9
- Bug: SAM Deployment Issue: Bootstrap File Not Found Despite Successful Build and Upload HOT 1
- Bug: sam pipeline init - ResourceNotFoundException HOT 1
- Bug: Official example for CDK is not working HOT 1
- Bug: Runtime.ImportModuleError for Typescript Lambda function defined using CDK HOT 2
- Feature request: Run Node tests as part of sam build HOT 2
- Bug: sam build --container-env-var is not working HOT 3
- Thumbprint of the AWS SAM Windows MSI installer does not match the documentation HOT 3
- Bug: ResourceDetailedStatus never returns as part of a cloudformation event HOT 3
- Bug: sam build -u stuck on mounting HOT 9
- Bug: sam local invoke HelloWorld lambda times out on Apple M1 Pro after Sonoma upgrade HOT 2
- Bug: sam validate fails for template using 1.122.0 or 1.223.0 HOT 4
- Feature request: Prune Old Versions HOT 2
- Bug: `sam build` Ignores Files in dist/ Directory When Specified in .gitignore HOT 2
- Bug: DBProxyTargetGroup Creation is very slow when using SAM deploy HOT 3
- Bug: sam build - JSONDecodeError HOT 1
- Bug: `sam init` error: "could not clone repo" (non-zero exit status 128) HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aws-sam-cli.