@@ -6,7 +6,7 @@ provider:
6
6
name : aws
7
7
runtime : nodejs6.10
8
8
timeout : 30
9
-
9
+
10
10
# Experimented with various memory sizes. Manually calling the totpValidate
11
11
# function once every few seconds, the average durations were as follows:
12
12
# 512 MB = 48 ms
@@ -16,7 +16,7 @@ provider:
16
16
apiKeys :
17
17
- ${self:custom.namespace}_global
18
18
iamRoleStatements :
19
- - Effect : " Allow"
19
+ - Effect : Allow
20
20
Action :
21
21
- dynamodb:DescribeTable
22
22
- dynamodb:Query
@@ -25,7 +25,7 @@ provider:
25
25
- dynamodb:PutItem
26
26
- dynamodb:UpdateItem
27
27
- dynamodb:DeleteItem
28
- Resource : " arn:aws:dynamodb:us-east-1:*: *"
28
+ Resource : " arn:aws:dynamodb:${opt:region, self:provider.region}:*:table/${self:custom.namespace}_ *"
29
29
30
30
custom :
31
31
stage : ${opt:stage, self:provider.stage}
@@ -143,53 +143,41 @@ functions:
143
143
resources :
144
144
Resources :
145
145
ApiKeyDynamoDbTable :
146
- Type : ' AWS::DynamoDB::Table'
146
+ Type : AWS::DynamoDB::Table
147
147
DeletionPolicy : Retain
148
148
Properties :
149
149
AttributeDefinitions :
150
- -
151
- AttributeName : value
150
+ - AttributeName : value
152
151
AttributeType : S
153
152
KeySchema :
154
- -
155
- AttributeName : value
153
+ - AttributeName : value
156
154
KeyType : HASH
157
- ProvisionedThroughput :
158
- ReadCapacityUnits : 5
159
- WriteCapacityUnits : 5
160
- TableName : ' ${self:custom.apiKeyTable}'
155
+ BillingMode : PAY_PER_REQUEST
156
+ TableName : ${self:custom.apiKeyTable}
161
157
TotpDynamoDbTable :
162
- Type : ' AWS::DynamoDB::Table'
158
+ Type : AWS::DynamoDB::Table
163
159
DeletionPolicy : Retain
164
160
Properties :
165
161
AttributeDefinitions :
166
- -
167
- AttributeName : uuid
162
+ - AttributeName : uuid
168
163
AttributeType : S
169
164
KeySchema :
170
- -
171
- AttributeName : uuid
165
+ - AttributeName : uuid
172
166
KeyType : HASH
173
- ProvisionedThroughput :
174
- ReadCapacityUnits : 5
175
- WriteCapacityUnits : 5
176
- TableName : ' ${self:custom.totpTable}'
167
+ BillingMode : PAY_PER_REQUEST
168
+ TableName : ${self:custom.totpTable}
177
169
U2fDynamoDbTable :
178
- Type : ' AWS::DynamoDB::Table'
170
+ Type : AWS::DynamoDB::Table
179
171
DeletionPolicy : Retain
180
172
Properties :
181
173
AttributeDefinitions :
182
- -
183
- AttributeName : uuid
174
+ - AttributeName : uuid
184
175
AttributeType : S
185
176
KeySchema :
186
- -
187
- AttributeName : uuid
177
+ - AttributeName : uuid
188
178
KeyType : HASH
189
- ProvisionedThroughput :
190
- ReadCapacityUnits : 5
191
- WriteCapacityUnits : 5
192
- TableName : ' ${self:custom.u2fTable}'
179
+ BillingMode : PAY_PER_REQUEST
180
+ TableName : ${self:custom.u2fTable}
193
181
ApiKeyActivateLogGroup :
194
182
Properties :
195
183
RetentionInDays : " 30"
0 commit comments