1 Answer
- Newest
- Most votes
- Most comments
0
You did not specify which version of SAM CLI you were using. The information I am providing below is based on SAM CLI version 1.55.0.
So your layer code doesn't really follow your local hierarchy or include the name of the layer itself. The warning you get of the missing package.json is a warning that tells you the code is not been placed where you expect.
You need to remove the nodejs folder so your code looks like this:
├── layers/
│ └── SQLLayer/
│ ├── package.json
│ └── index.ts
This will create a layer with the current hierarchy
├── nodejs/
│ ├── package.json
│ └── index.ts
In your actual Lamabda function this will look like this
├── /opt/
│ └── nodejs/
│ ├── package.json
│ └── index.ts
answered 2 years ago
Relevant content
- asked 2 years ago
- asked a year ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 10 months ago