-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtemplate.yml
51 lines (51 loc) · 1.16 KB
/
template.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
AWSTemplateFormatVersion : '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Outputs:
Api:
Value: !Ref ServerlessRestApi
Resources:
VotesTable:
Type: "AWS::Serverless::SimpleTable"
HelloWorld:
Type: "AWS::Serverless::Function"
Properties:
Runtime: python3.6
Handler: hello.hello_world
Events:
Hello:
Type: Api
Properties:
Path: /hello
Method: get
Vote:
Type: "AWS::Serverless::Function"
Properties:
Timeout: 10
Runtime: python3.6
Handler: vote.vote
Policies: AmazonDynamoDBFullAccess
Environment:
Variables:
TABLE_NAME: !Ref VotesTable
Events:
Vote:
Type: Api
Properties:
Path: /vote
Method: post
VoteResults:
Type: "AWS::Serverless::Function"
Properties:
Timeout: 10
Runtime: python3.6
Handler: vote.voteresults
Policies: AmazonDynamoDBFullAccess
Environment:
Variables:
TABLE_NAME: !Ref VotesTable
Events:
Vote:
Type: Api
Properties:
Path: /vote
Method: get