Repository navigation
Expand file tree
/
Copy pathserverless.yml
More file actions
170 lines (159 loc) · 5.51 KB
/
Copy pathserverless.yml
File metadata and controls
170 lines (159 loc) · 5.51 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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
service: swiftmile
frameworkVersion: ">=1.1.0 <2.0.0"
plugins:
- serverless-dynamodb-local
- serverless-offline
- serverless-plugin-multiple-responses
custom:
dynamodb:
start:
port: 8000
inMemory: true
migrate: true
migration:
dir: offline/migrations
package:
exclude:
- CognitoUserPool
provider:
name: aws
profile: ${file(./config/aws_params.yml):profile}
region: ${file(./config/aws_params.yml):region}
stage: ${file(./config/aws_params.yml):stage}
tags:
env: ${file(./config/aws_params.yml):stage}
memorySize: 1536
stackTags:
projectname: swiftmile
deploymentBucket: us.fiduciam.nkcgo.api.deploys
versionFunctions: true
runtime: nodejs6.10
apiKeys: false
# role: arn:aws:iam::450228362552:role/swiftmile-pr-us-east-2-lambdaRole
# cfnRole: arn:aws:iam::450228362552:role/swiftmile-pr-us-east-2-lambdaRole
# apiKeys:
# - myFirstKey
# - ${opt:stage}-myFirstKey
# - ${env:MY_API_KEY} # you can hide it in a serverless variable
# usagePlan:
# quota:
# limit: 5000
# offset: 2
# period: MONTH
# throttle:
# burstLimit: 200
# rateLimit: 100
environment:
DYNAMODB_TABLE: ${self:service}-prod
DYNAMODB_USER_TABLE: ${self:service}-prod-User
DYNAMODB_VENUE_TABLE: ${self:service}-prod-Venue
DYNAMODB_SNAP_TABLE: ${self:service}-prod-Snap
DYNAMODB_BADGE_TABLE: ${self:service}-prod-Badges
DYNAMODB_USER_BADGES_TABLE: ${self:service}-prod-UserBadges
DYNAMODB_CLUSTER_TABLE: ${self:service}-map-polygons
DYNAMODB_USERBADGE_TABLE: ${self:service}-prod-UserBadges
DYNAMODB_BADGEVENUE_TABLE: ${self:service}-prod-BadgeVenues
DYNAMODB_USERCHECKINSTATS_TABLE: ${self:service}-prod-UserCheckInStats
AUTH0_CLIENT: ${file(./config/aws_params.yml):AUTH0_CLIENT_ID}
AUTH0_SECRET: ${file(./config/aws_params.yml):AUTH0_CLIENT_SECRET}
AUTH0_DOMAIN: ${file(./config/aws_params.yml):AUTH0_DOMAIN}
USER_IMAGES_S3_BUCKET: ${file(./config/aws_params.yml):USER_IMAGES_S3_BUCKET}
S3_BUCKET_AWS_ACCESS_KEY: ${file(./config/aws_params.yml):S3_BUCKET_AWS_ACCESS_KEY}
S3_BUCKET_AWS_SECRET_KEY: ${file(./config/aws_params.yml):S3_BUCKET_AWS_SECRET_KEY}
iamRoleStatements:
- Effect: Allow
Action:
- dynamodb:Query
- dynamodb:Scan
- dynamodb:GetItem
- dynamodb:PutItem
- dynamodb:UpdateItem
Resource: "arn:aws:dynamodb:${opt:region, self:provider.region}:*:table/${self:provider.environment.DYNAMODB_USERBADGE_TABLE}"
- Effect: Allow
Action:
- dynamodb:Query
- dynamodb:Scan
- dynamodb:GetItem
- dynamodb:PutItem
- dynamodb:UpdateItem
Resource: "arn:aws:dynamodb:${opt:region, self:provider.region}:*:table/${self:provider.environment.DYNAMODB_BADGEVENUE_TABLE}"
- Effect: Allow
Action:
- dynamodb:Query
- dynamodb:Scan
- dynamodb:GetItem
- dynamodb:PutItem
- dynamodb:UpdateItem
Resource: "arn:aws:dynamodb:${opt:region, self:provider.region}:*:table/${self:provider.environment.DYNAMODB_USERCHECKINSTATS_TABLE}"
- Effect: Allow
Action:
- dynamodb:Query
- dynamodb:Scan
- dynamodb:GetItem
- dynamodb:PutItem
- dynamodb:UpdateItem
- dynamodb:DeleteItem
Resource: "arn:aws:dynamodb:${opt:region, self:provider.region}:*:table/${self:provider.environment.DYNAMODB_TABLE}"
- Effect: Allow
Action:
- dynamodb:Query
- dynamodb:Scan
- dynamodb:GetItem
- dynamodb:PutItem
- dynamodb:UpdateItem
- dynamodb:DeleteItem
Resource: "arn:aws:dynamodb:${opt:region, self:provider.region}:*:table/${self:provider.environment.DYNAMODB_USER_BADGES_TABLE}"
- Effect: Allow
Action:
- dynamodb:Query
- dynamodb:Scan
- dynamodb:GetItem
- dynamodb:PutItem
- dynamodb:UpdateItem
Resource: "arn:aws:dynamodb:${opt:region, self:provider.region}:*:table/${self:provider.environment.DYNAMODB_USER_TABLE}"
- Effect: Allow
Action:
- dynamodb:Query
- dynamodb:Scan
- dynamodb:GetItem
Resource: "arn:aws:dynamodb:${opt:region, self:provider.region}:*:table/${self:provider.environment.DYNAMODB_VENUE_TABLE}"
- Effect: Allow
Action:
- dynamodb:Query
- dynamodb:Scan
- dynamodb:GetItem
Resource: "arn:aws:dynamodb:${opt:region, self:provider.region}:*:table/${self:provider.environment.DYNAMODB_CLUSTER_TABLE}"
- Effect: Allow
Action:
- dynamodb:Query
- dynamodb:Scan
- dynamodb:GetItem
- dynamodb:PutItem
- dynamodb:UpdateItem
- dynamodb:DeleteItem
Resource: "arn:aws:dynamodb:${opt:region, self:provider.region}:*:table/${self:provider.environment.DYNAMODB_SNAP_TABLE}"
- Effect: Allow
Action:
- dynamodb:Query
- dynamodb:Scan
- dynamodb:GetItem
- dynamodb:PutItem
- dynamodb:UpdateItem
- dynamodb:DeleteItem
Resource: "arn:aws:dynamodb:${opt:region, self:provider.region}:*:table/${self:provider.environment.DYNAMODB_BADGE_TABLE}"
stackPolicy:
- Effect: Allow
Principal: "*"
Action: "Update:*"
Resource: "*"
- Effect: Deny
Principal: "*"
Action:
- Update:Replace
- Update:Delete
Condition:
StringEquals:
ResourceType:
- AWS::EC2::Instance
functions: ${file(./config/functions.yml):functions}
#resources: ${file(./config/resources.yml):resources}