-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
81 lines (72 loc) · 1.84 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
service: quick-maths
custom:
config: ${file(src/config/index.js):asFunction}
DynamoDBBillingMode:
production: PAY_PER_REQUEST
staging: PROVISIONED
DynamoDBCapacity:
production: !Ref AWS::NoValue
staging:
ReadCapacityUnits: 1
WriteCapacityUnits: 1
provider:
name: aws
runtime: nodejs8.10
iamRoleStatements:
- Effect: "Allow"
Action:
- "dynamodb:*"
Resource: !GetAtt TableUsers.Arn
environment:
NODE_ENV: ${opt:stage}
functions:
alexa:
timeout: 6
handler: src/handler.alexaHandler
memorySize: 512
events:
- alexaSkill: ${env:SKILL_ID}
googleAction:
timeout: 10
handler: src/handler.assistantHandler
memorySize: 512
events:
- http:
path: googleAction
method: POST
private: true # Requires clients to add API keys values in the `x-api-key` header of their request
package:
excludeDevDependencies: true
include:
- src/config/*.json
- src/languageResources/*.json
exclude:
- scripts/**
- assets/**
- reports/**
- speech-assets/**
resources:
Resources:
assets:
Type: AWS::S3::Bucket
Properties:
BucketName: ${self:custom.config.s3.bucket}
AccessControl: PublicRead
CorsConfiguration:
CorsRules:
- AllowedOrigins:
- "*"
AllowedMethods:
- GET
TableUsers:
Type: AWS::DynamoDB::Table
Properties:
TableName: ${self:custom.config.dynamodb.tables.users}
BillingMode: ${self:custom.DynamoDBBillingMode.${env:NODE_ENV}}
ProvisionedThroughput: ${self:custom.DynamoDBCapacity.${env:NODE_ENV}}
AttributeDefinitions:
- AttributeName: userId
AttributeType: S
KeySchema:
- AttributeName: userId
KeyType: HASH