-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.kyle.yml
111 lines (105 loc) · 3.03 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
service: usgs-topo-mosaic
provider:
name: aws
runtime: python3.7
stage: ${opt:stage, 'production'}
region: 'us-west-2'
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
maxAge: 6000 # In seconds
deploymentBucket: ${opt:bucket, 'mosaics-us-west-2.kylebarron.dev'}
apiGateway:
binaryMediaTypes:
- '*/*'
minimumCompressionSize: 1
# Add other buckets here if needed
iamRoleStatements:
- Effect: "Allow"
Action:
- "s3:GetObject"
- "s3:HeadObject"
# Uncomment if you implement custom mosaics on demand
# - "s3:PutObject"
Resource:
- "arn:aws:s3:::${self:provider.deploymentBucket}*"
- Effect: "Allow"
Action:
- "s3:GetObject"
- "s3:HeadObject"
Resource:
- "arn:aws:s3:::*"
- Effect: "Allow"
Action:
- "dynamodb:GetItem"
Resource:
# Allow access to all dynamodb tables in region
- "arn:aws:dynamodb:${self:provider.region}:961053664803:table/*"
package:
artifact: package.zip
functions:
app:
handler: usgs_topo_mosaic.handlers.app.app
memorySize: 1024
timeout: 10
layers:
- arn:aws:lambda:${self:provider.region}:524387336408:layer:gdal24-py37-geolayer:1
environment:
# One week cache control, one week stale while revalidate by default
CACHE_CONTROL: ${opt:cache-control, 'public,max-age=604800,stale-while-revalidate=604800'}
CPL_TMPDIR: /tmp
GDAL_CACHEMAX: 25%
GDAL_DATA: /opt/share/gdal
GDAL_DISABLE_READDIR_ON_OPEN: YES
GDAL_HTTP_MERGE_CONSECUTIVE_RANGES: YES
GDAL_HTTP_MULTIPLEX: YES
GDAL_HTTP_VERSION: 2
MAX_THREADS: 10
MOSAIC_DEF_BUCKET: ${self:provider.deploymentBucket}
PROJ_LIB: /opt/share/proj
PYTHONWARNINGS: ignore
VSI_CACHE: TRUE
VSI_CACHE_SIZE: 536870912
events:
- httpApi:
path: /{proxy+}
method: '*'