-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathserverless.yml
More file actions
153 lines (142 loc) · 4.21 KB
/
serverless.yml
File metadata and controls
153 lines (142 loc) · 4.21 KB
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
service: warriorbeat-graphql
provider:
name: aws
runtime: python3.7
stage: dev
region: us-east-1
environment:
S3_MEDIA: { Ref: MediaBucket }
DB_MEDIA: { Ref: MediaTable }
DB_ARTICLE: { Ref: ArticlesTable }
DB_ARTICLELIKES: { Ref: ArticleLikesTable }
DB_CATEGORY: { Ref: CategoriesTable }
DB_POLLVOTES: { Ref: PollVotesTable }
DB_POLLOPTIONS: { Ref: PollOptionsTable }
DB_USERS: { Ref: UsersTable }
DB_USERSUBSCRIPTIONS: { Ref: UserSubscriptionsTable }
DB_AUTHORS: { Ref: AuthorsTable }
plugins:
- serverless-python-requirements
- serverless-appsync-plugin
- serverless-dynamodb-local
- serverless-appsync-offline
- serverless-offline
- aws-amplify-serverless-plugin
custom:
stage: ${opt:stage, self:provider.stage}
stack: warriorbeat-graphql-${self:custom.stage}
tableThroughputs:
prod: 5
default: 1
tableThroughput: ${self:custom.tableThroughputs.${self:custom.stage}, self:custom.tableThroughputs.default}
accountId: '881433986874'
appSyncApiId:
dev: 'frn4cfvowvh5nl57g2whjepgju'
appSyncArn: arn:aws:appsync:${self:provider.region}:${self:custom.accountId}:apis/${self:custom.appSyncApiId.${self:custom.stage}}
# Python Runtime
pythonRequirements:
dockerizePip: true
slim: true
useDownloadCache: true
useStaticCache: true
zip: true
# END PYTHON RUNTIME ===================
# SLS Dev Env
appsync-offline:
port: 62222
dynamodb:
client:
endpoint: 'http://localhost:8000'
region: localhost
dynamodb:
start:
port: 8000
inMemory: true
migrate: true
seed: true
seed:
test:
sources:
- table: { Ref: PollTable }
sources: [seed-data/polls.json]
- table: { Ref: PollOptionsTable }
sources: [seed-data/poll_options.json]
- table: { Ref: PollVotesTable }
sources: [seed-data/poll_votes.json]
# END SLS DEV ENV ===================
# AWS Amplify ===================
amplify:
- filename: amplify/aws-exports.js
type: javascript
appClient: CognitoUserPoolClient
s3Bucket: disabled
# END AWS Amplify ===================
# AppSync ===================
appSync:
name: WarriorBeatAppSync-${self:custom.stage}
authenticationType: AWS_IAM
schema:
- schema/base.graphql
- schema/polls.graphql
- schema/article.graphql
- schema/category.graphql
- schema/media.graphql
- schema/post.graphql
mappingTemplates:
- ${file(mapping-templates/polls/map.yml)}
- ${file(mapping-templates/articles/map.yml)}
- ${file(mapping-templates/authors/map.yml)}
- ${file(mapping-templates/media/map.yml)}
- ${file(mapping-templates/posts/map.yml)}
- ${file(mapping-templates/users/map.yml)}
- ${file(mapping-templates/categories/map.yml)}
functionConfigurations:
- ${file(mapping-templates/functions/polls.yml)}
serviceRole: 'AppSyncServiceRole'
dataSources:
- ${file(schema/data/LambdaResolver.yml)}
- ${file(schema/data/none.yml)}
- ${file(schema/data/polls.yml)}
- ${file(schema/data/articles.yml)}
- ${file(schema/data/authors.yml)}
- ${file(schema/data/media.yml)}
- ${file(schema/data/users.yml)}
- ${file(schema/data/categories.yml)}
# END AppSync ===================
resources:
# AppSync Service/Handler Roles
- ${file(resources/appsync-roles.yml)}
# DynamoDB Tables
- ${file(resources/tables/polls.yml)}
- ${file(resources/tables/authors.yml)}
- ${file(resources/tables/media.yml)}
- ${file(resources/tables/articles.yml)}
- ${file(resources/tables/users.yml)}
- ${file(resources/tables/categories.yml)}
# Cognito Pool / Identity
- ${file(resources/cognito-pool.yml)}
# Cognito Roles
- ${file(resources/cognito-roles.yml)}
# S3 Bucket
- ${file(resources/s3-bucket.yml)}
package:
exclude:
- .git/**
- .vscode/**
- .sass-cache/**
- amplify/**
- seed-data/**
- node_modules/**
- docs/**
- mapping-templates/**
- schema/**
- resources/**
- Gem*
- yarn.lock
- Rakefile
- package.json
- '*.js'
functions:
lambda_handler:
handler: handler.lambda_handler
role: 'AppSyncHandler'