-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserverless.yml
80 lines (74 loc) · 1.88 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
service: broadband-agol
#frameworkVersion: '2 || 3'
package:
patterns:
- '!gpkgs/**'
custom:
pythonRequirements:
dockerizePip: true
useStaticCache: false
zip: true
# seems like slim cannot be true for geopandas to work
# slim: true
pipCmdExtraArgs:
- --no-deps
provider:
name: aws
iam:
role:
statements:
# Allow functions to list all buckets
- Effect: Allow
Action: 's3:ListBucket'
Resource: 'arn:aws:s3:::broadband-agol-data'
# Allow functions to read/write objects in a bucket
- Effect: Allow
Action:
- 's3:GetObject'
- 's3:PutObject'
Resource:
- 'arn:aws:s3:::broadband-agol-data/*'
runtime: python3.9
stage: ${opt:stage, 'dev'}
environment:
STAGE: ${self:provider.stage}
# iam:
# role:
# name: broadband-agol-s3
# statements:
# - Effect: Allow
# Action:
# - 's3:*'
# Resource: arn:aws:s3:::broadband-agol-data/*
functions:
broadband:
handler: broadband.handler
timeout: 300
memorySize: 4096
# Uncomment if needed - Allows us to run sls locally and post to the actual broadband function
#events:
# - http:
# path: temporary_please_delete
# method: post
# cors: true
receive:
handler: receive.handler
timeout: 30
memorySize: 128
iamRoleStatements:
# Allow to invoke other lambda function
- Effect: Allow
Action:
- 'lambda:InvokeFunction'
- 'lambda:InvokeAsync'
Resource:
- arn:aws:lambda:us-east-1:104538610210:function:broadband-agol-beta-broadband
events:
- http:
path: broadband
method: post
cors: true
plugins:
- serverless-offline
- serverless-python-requirements
- serverless-iam-roles-per-function