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