forked from developmentseed/awspds-mosaic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserverless.kyle.yml
133 lines (124 loc) · 3.67 KB
/
serverless.kyle.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
service: landsat-mosaic-tiler
provider:
name: aws
runtime: python3.7
stage: ${opt:stage, 'production'}
region: us-west-2
deploymentBucket: ${opt:bucket, 'mosaics-us-west-2.kylebarron.dev'}
httpApi:
cors:
allowedOrigins:
# You can't do http://localhost:* and http://localhost doesn't work
- http://localhost:3000
- http://localhost:3001
- http://localhost:3002
- http://localhost:3003
- http://localhost:3004
- http://localhost:3005
- http://localhost:3006
- http://localhost:8000
- http://localhost:8001
- http://localhost:8002
- http://localhost:8003
- http://localhost:8004
- http://localhost:8005
- http://localhost:8006
- http://localhost:8080
- http://localhost:8081
- http://localhost:8082
- http://localhost:8083
- http://localhost:8084
- https://all-transit.com
- https://kylebarron.dev
- https://kylebarron.github.io
- https://landsat3d.com
- https://landsat8.earth
- https://nst.guide
- https://nstguide.com
- https://sentinel2.earth
- https://trails3d.com
allowedHeaders:
- Authorization
- Content-Type
- X-Amz-Date
- X-Amz-Security-Token
- X-Amz-User-Agent
- X-Api-Key
allowedMethods:
- GET
- OPTIONS
exposedResponseHeaders:
# Source asset strings per tile
- X-ASSETS
maxAge: 6000 # In seconds
stackTags:
Project: labs
iamRoleStatements:
- Effect: "Allow"
Action:
- "s3:GetObject"
- "s3:HeadObject"
- "s3:PutObject"
Resource:
- arn:aws:s3:::${self:provider.deploymentBucket}*
- Effect: "Allow"
Action:
- "s3:*"
Resource:
- "arn:aws:s3:::landsat-pds*"
- Effect: "Allow"
Action:
- "dynamodb:GetItem"
Resource:
# Allow access to all dynamodb tables in region
- "arn:aws:dynamodb:${self:provider.region}:961053664803:table/*"
apiGateway:
binaryMediaTypes:
- '*/*'
minimumCompressionSize: 1
package:
artifact: package.zip
functions:
tiler:
handler: landsat_mosaic_tiler.handlers.tiles.app
memorySize: 1536
timeout: 10
layers:
- arn:aws:lambda:${self:provider.region}:524387336408:layer:gdal24-py37-geolayer:1
environment:
# 4-day cache control, 4-day stale while revalidate by default
CACHE_CONTROL: ${opt:cache-control, 'public,max-age=345600,stale-while-revalidate=345600'}
CPL_TMPDIR: /tmp
CPL_VSIL_CURL_ALLOWED_EXTENSIONS: .tif,.TIF,.ovr
GDAL_CACHEMAX: 25%
GDAL_DATA: /opt/share/gdal
GDAL_DISABLE_READDIR_ON_OPEN: FALSE
GDAL_HTTP_MERGE_CONSECUTIVE_RANGES: YES
GDAL_HTTP_MULTIPLEX: YES
GDAL_HTTP_VERSION: 2
MAX_THREADS: 1
MOSAIC_DEF_BUCKET: ${self:provider.deploymentBucket}
PROJ_LIB: /opt/share/proj
PYTHONWARNINGS: ignore
VSI_CACHE: TRUE
VSI_CACHE_SIZE: 536870912
events:
- httpApi:
path: /tiles/{proxy+}
method: '*'
mosaics:
handler: landsat_mosaic_tiler.handlers.mosaic.app
memorySize: 1024
timeout: 20
layers:
- arn:aws:lambda:${self:provider.region}:524387336408:layer:gdal24-py37-geolayer:1
environment:
# 4-day cache control, 4-day stale while revalidate by default
CACHE_CONTROL: ${opt:cache-control, 'public,max-age=345600,stale-while-revalidate=345600'}
GDAL_DATA: /opt/share/gdal
MOSAIC_DEF_BUCKET: ${self:provider.deploymentBucket}
PROJ_LIB: /opt/share/proj
events:
- httpApi:
path: /mosaic/{proxy+}
method: '*'