-
Notifications
You must be signed in to change notification settings - Fork 20
/
template.yaml
54 lines (46 loc) · 1.17 KB
/
template.yaml
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
AWSTemplateFormatVersion: 2010-09-09
Transform: AWS::Serverless-2016-10-31
Outputs:
SurveyURL:
Description: "Link to your Serverless Survey"
Value: !Sub "https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/newsurvey"
Resources:
SurveyTable:
Type: AWS::Serverless::SimpleTable
Properties:
PrimaryKey:
Name: id
Type: String
ProvisionedThroughput:
ReadCapacityUnits: 5
WriteCapacityUnits: 5
Survey:
Type: AWS::Serverless::Function
Properties:
Handler: survey.lambda_handler
CodeUri: .
Runtime: python3.7
Events:
RestAPI:
Type: Api
Properties:
Path: /newsurvey
Method: ANY
SurveySubmit:
Type: AWS::Serverless::Function
Properties:
Handler: survey_submit.lambda_handler
CodeUri: .
Runtime: python3.7
Policies:
- DynamoDBCrudPolicy:
TableName: !Ref SurveyTable
Events:
RestAPI:
Type: Api
Properties:
Path: /submitsurvey
Method: ANY
Environment:
Variables:
TABLE_NAME: !Ref SurveyTable