-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate.yml
61 lines (52 loc) · 1.61 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
52
53
54
55
56
57
58
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: A simple webhook troubleshooting endpoint that stores data in S3
# first, the configuration parameters:
Parameters:
bucketName:
Description: S3 bucket to store webhook data
Type: String
bucketPrefix:
Description: S3 bucket prefix
Type: String
Default: guarana
lambdaTimeOut:
Description: Lambda function timeout
Type: Number
Default: 60
lambdaMemoryLimit:
Description: Lambda function memory limit in MB
Type: Number
Default: 256
# second, the resources:
Resources:
Guarana:
Type: AWS::Serverless::Function
Properties:
CodeUri: target/guarana.jar
FunctionName: uvasoftware-guarana-handler
Handler: com.uvasoftware.guarana.Handler
Runtime: java11
MemorySize: !Sub ${lambdaMemoryLimit}
Timeout: !Sub ${lambdaTimeOut}
Description: Captures HTTP requests and saves them kindly to S3.
AutoPublishAlias: live # enables automatic version tracking
Environment:
Variables:
DESTINATION_BUCKET: !Sub ${bucketName}
# default prefix for all objects stored in the above bucket:
DESTINATION_BUCKET_PREFIX: !Sub ${bucketPrefix}
Policies:
- S3CrudPolicy:
BucketName:
Ref: bucketName
Events:
GetResource:
Type: Api
Properties:
Path: /{proxy+}
Method: any
Outputs:
ApiURL:
Description: "API endpoint URL for Prod environment"
Value: !Sub "https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/"