-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
54 lines (49 loc) · 1.4 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
service: alexa-kiwiquakes
provider:
name: aws
runtime: nodejs6.10
stage: ${opt:stage, self:custom.defaultStage}
region: us-east-1
memorySize: 256
cfLogs: true
profile: kiwiquakes
iamRoleStatements:
- Effect: Allow
Action:
- dynamodb:DescribeTable
- dynamodb:Query
- dynamodb:Scan
- dynamodb:GetItem
- dynamodb:PutItem
- dynamodb:UpdateItem
- dynamodb:DeleteItem
Resource: "arn:aws:dynamodb:us-east-1:*:table/usersTable-${opt:stage, self:custom.defaultStage}"
environment:
GOOGLE_API_KEY: ${file(config.${opt:stage, self:custom.defaultStage}.json):GOOGLE_API_KEY}
APP_ID: ${file(config.${opt:stage, self:custom.defaultStage}.json):APP_ID}
STAGE: ${opt:stage, self:custom.defaultStage}
custom:
defaultStage: dev
functions:
skill: # function name
handler: src/index.handler
description: Alexa Skill for New Zealand Earthquakes
events:
- alexaSkill
resources:
Resources:
usersTable:
Type: AWS::DynamoDB::Table
Properties:
TableName: usersTable-${opt:stage, self:custom.defaultStage}
AttributeDefinitions:
- AttributeName: userId
AttributeType: S
KeySchema:
- AttributeName: userId
KeyType: HASH
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1
plugins:
- serverless-webpack