Permalink
Fetching contributors…
Cannot retrieve contributors at this time
55 lines (54 sloc) 1.54 KB
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