-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathguarana.yaml
54 lines (54 loc) · 1.54 KB
/
guarana.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'
Description: A simple webhook troubleshooting endpoint that stores data in S3
Outputs:
ApiURL:
Description: API endpoint URL for Prod environment
Value:
Fn::Sub: https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/
Parameters:
bucketName:
Description: S3 bucket to store webhook data
Type: String
bucketPrefix:
Default: guarana
Description: S3 bucket prefix
Type: String
lambdaMemoryLimit:
Default: 256
Description: Lambda function memory limit in MB
Type: Number
lambdaTimeOut:
Default: 60
Description: Lambda function timeout
Type: Number
Resources:
Guarana:
Properties:
AutoPublishAlias: live
CodeUri: s3://scanii-assets/sam/guarana/f3bd5acdd77edae75b4a039bc009f55c
Description: Captures HTTP requests and saves them kindly to S3.
Environment:
Variables:
DESTINATION_BUCKET:
Fn::Sub: ${bucketName}
DESTINATION_BUCKET_PREFIX:
Fn::Sub: ${bucketPrefix}
Events:
GetResource:
Properties:
Method: any
Path: /{proxy+}
Type: Api
FunctionName: uvasoftware-guarana-handler
Handler: com.uvasoftware.guarana.Handler
MemorySize:
Fn::Sub: ${lambdaMemoryLimit}
Policies:
- S3CrudPolicy:
BucketName:
Ref: bucketName
Runtime: java8
Timeout:
Fn::Sub: ${lambdaTimeOut}
Type: AWS::Serverless::Function
Transform: AWS::Serverless-2016-10-31