This repository has been archived by the owner on Mar 28, 2022. It is now read-only.
forked from vincentsarago/lambda-tiler
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathserverless.yml
64 lines (55 loc) · 1.48 KB
/
serverless.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
service: cogeo-tiler
provider:
name: aws
runtime: python3.7
stage: ${opt:stage, 'production'}
region: ${opt:region, 'us-east-1'}
httpApi:
cors: true
#############################################################################
# Optional
# Add Tags to resources
stackTags:
project: labs
deploymentBucket: ${opt:bucket}
# Add IAM Role statements to allow the tiler to access files to some bucket
iamRoleStatements:
- Effect: "Allow"
Action:
- "s3:GetObject"
- "s3:HeadObject"
Resource:
- "arn:aws:s3:::${opt:bucket}*"
- "arn:aws:s3:::*"
#############################################################################
apiGateway:
binaryMediaTypes:
- '*/*'
minimumCompressionSize: 1
package:
artifact: package.zip
functions:
app:
handler: cogeo_tiler.handler.app
memorySize: 1536
timeout: 10
layers:
# See https://github.com/lambgeo/geo-layer
- arn:aws:lambda:${self:provider.region}:524387336408:layer:gdal24-py37-geolayer:1
environment:
CPL_TMPDIR: /tmp
GDAL_CACHEMAX: 25%
GDAL_DATA: /opt/share/gdal
GDAL_DISABLE_READDIR_ON_OPEN: EMPTY_DIR
GDAL_HTTP_MERGE_CONSECUTIVE_RANGES: YES
GDAL_HTTP_MULTIPLEX: YES
GDAL_HTTP_VERSION: 2
MAX_THREADS: 50
PROJ_LIB: /opt/share/proj
PYTHONWARNINGS: ignore
VSI_CACHE: TRUE
VSI_CACHE_SIZE: 536870912
events:
- httpApi:
path: /{proxy+}
method: '*'