Skip to content

Commit 2745ca3

Browse files
Gorianskyi MykhailoGorianskyi Mykhailo
authored andcommitted
Initial commit
0 parents  commit 2745ca3

File tree

6 files changed

+4854
-0
lines changed

6 files changed

+4854
-0
lines changed

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.idea/
2+
coverage
3+
node_modules/
4+
dist/*
5+
!dist/sharp-layer.zip
6+
*.iml
7+
.DS_Store

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# AWS Sharp layer
2+
This aws lambda layer contains a pre-built [sharp](https://www.npmjs.com/package/sharp) npm library.
3+
The built lambda zip file is available in [`dist/sharp-layer.zip`](./dist/sharp-layer.zip).
4+
5+
# Building
6+
7+
## Dependencies
8+
* Docker
9+
10+
## Steps
11+
1. Clone the repo:
12+
```shell script
13+
git clone git@github.com:Umkus/lambda-layer-sharp.git
14+
cd lambda-layer-sharp/
15+
```
16+
1. Install dependencies:
17+
```shell script
18+
docker run -v "$PWD":/var/task lambci/lambda:build-nodejs12.x npm ci
19+
```
20+
1. Build the layer:
21+
```shell script
22+
docker run -v "$PWD":/var/task lambci/lambda:build-nodejs12.x node ./node_modules/webpack/bin/webpack.js
23+
```
24+
1. Import created layer into your AWS account:
25+
```shell script
26+
aws lambda publish-layer-version \
27+
--layer-name sharp --description "Sharp layer" \
28+
--license-info "Apache License 2.0" \
29+
--zip-file fileb://dist/sharp-layer.zip \
30+
--compatible-runtimes nodejs12
31+
```

dist/sharp-layer.zip

9.9 MB
Binary file not shown.

0 commit comments

Comments
 (0)