-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserverless.yml
More file actions
56 lines (50 loc) · 1.18 KB
/
serverless.yml
File metadata and controls
56 lines (50 loc) · 1.18 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
frameworkVersion: ">=1.0.0 <2.0.0"
custom:
stage: ${opt:stage, 'dev'}
tableName: ${self:custom.stage}Stats
basePath: ${self:custom.stage}-stats
customDomain:
domainName: api.elizabethwarren.codes
basePath: ${self:custom.basePath}
stage: ${self:custom.stage}
createRoute53Record: true
service: stats
provider:
name: aws
runtime: nodejs8.10
iamRoleStatements:
- Effect: Allow
Action:
- dynamodb:*
Resource: "*"
environment:
BASE_PATH: ${self:custom.basePath}
STATS_TABLE: ${self:custom.tableName}
STATS_CHALLENGE: ${ssm:STATS_CHALLENGE}
plugins:
- serverless-domain-manager
functions:
api:
handler: src/handler.router
events:
- http:
path: /
method: any
cors: true
- http:
path: /{proxy+}
method: any
cors: true
resources:
Resources:
StatsTable:
Type: AWS::DynamoDB::Table
Properties:
TableName: ${self:custom.tableName}
BillingMode: PAY_PER_REQUEST
AttributeDefinitions:
- AttributeName: key
AttributeType: S
KeySchema:
- AttributeName: key
KeyType: HASH