-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathserverless.yml
103 lines (97 loc) · 2.53 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
service: otter-pond-backend
plugins:
- serverless-python-requirements
- serverless-wsgi
- serverless-plugin-existing-s3
- serverless-domain-manager
custom:
wsgi:
app: api.app.app
packRequirements: false
pythonRequirements:
dockerizePip: non-linux
customDomain:
domainName: ${opt:stage, 'dev'}-api.theotterpond.com
basePath: ''
stage: ${opt:stage, 'dev'}
createRoute53Record: true
certificateName: '*.theotterpond.com'
provider:
name: aws
runtime: python3.6
stage: ${opt:stage, 'dev'}
region: us-east-1
#environment:
# API_GATEWAY_BASE_PATH: ${self:custom.customDomain.basePath}
iamRoleStatements:
- Effect: "Allow"
Action:
- "s3:GetBucketNotification"
- "s3:PutBucketNotification"
- s3:PutObject
- s3:GetObject
Resource:
Fn::Join:
- ""
- - "arn:aws:s3:::otter-pond-emails/*"
- Effect: "Allow"
Resource: "*"
Action:
- "sns:*"
- SES:*
- Effect: Allow
Action:
- dynamodb:DescribeTable
- dynamodb:Query
- dynamodb:Scan
- dynamodb:GetItem
- dynamodb:PutItem
- dynamodb:UpdateItem
- dynamodb:DeleteItem
- dynamodb:UpdateTable
Resource:
- "Fn::GetAtt": [ OtterPondTable, Arn ]
- { "Fn::Join": [ "/", [
{ "Fn::GetAtt": [OtterPondTable, Arn] }, "index", "*"
]]}
package: # Optional deployment packaging configuration
include: # Specify the directories and files which should be included in the deployment package
- email/**
- api/**
exclude:
- node_modules/**
- venv/**
- venv3.7/**
# Create our resources with separate CloudFormation templates
resources:
# DynamoDB
- ${file(resources/dynamodb.yml)}
functions:
api:
handler: wsgi_handler.handler
environment:
JWT_SECRET: ${file(resources/keys.yml):JWT-Key}
stage: ${opt:stage, 'dev'}
STRIPE_KEY: ${opt:stripeKey, ''}
events:
- http: ANY /
- http: 'ANY {proxy+}'
memorySize: 256
email_received:
handler: emailer.emailmanager.email_received
environment:
stage: ${opt:stage, 'dev'}
admin_email: ${opt:admin_email, ''}
events:
- sns: email_received-${opt:stage, 'dev'}
- existingS3:
bucket: otter-pond-emails
events:
- s3:ObjectCreated:*
memorySize: 256
timeout: 600
spam_filter:
handler: emailer.spam_filter.spam_filter_handler
environment:
emailDomain: theotterpond.com
memorySize: 128