This repository has been archived by the owner on Jan 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
template.yml
70 lines (66 loc) · 1.92 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
59
60
61
62
63
64
65
66
67
68
69
70
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: OpenFastTrace as a service
Resources:
ApiGatewayApi:
Type: AWS::Serverless::Api
Properties:
StageName: ${stage}
Variables:
stage: ${stage}
MethodSettings: [{
"LoggingLevel": "INFO",
"MetricsEnabled": False,
"DataTraceEnabled": False,
"ResourcePath": "/*",
"HttpMethod": "*",
"ThrottlingBurstLimit": 2,
"ThrottlingRateLimit": 1,
"CachingEnabled": False,
"CacheTtlInSeconds": 300,
"CacheDataEncrypted": False
}]
EndpointConfiguration: REGIONAL
Cors:
AllowOrigin: "'*'"
AllowMethods: "'GET,POST'"
MaxAge: "'600'"
DefinitionBody:
swagger: '2.0'
info:
title:
Ref: AWS::StackName
description: |
OpenFastTrace as a service
paths:
/trace:
post:
description: Trace requirements
responses:
default:
statusCode: 200
x-amazon-apigateway-integration:
passthroughBehavior: when_no_match
httpMethod: POST
type: aws_proxy
uri:
Fn::Sub: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${TraceLambda.Arn}/invocations
TraceLambda:
Type: AWS::Serverless::Function
Properties:
Handler: org.itsallcode.openfasttrace.lambda.TraceLambda
Runtime: java8
Timeout: 30
MemorySize: 3008 # 128
CodeUri: ${CodeUri}
Events:
PostRequest:
Type: Api
Properties:
RestApiId: !Ref ApiGatewayApi
Path: /trace
Method: POST
Outputs:
ApiUrl:
Description: API Gateway endpoint URL
Value: !Sub https://${ApiGatewayApi}.execute-api.${AWS::Region}.amazonaws.com/${stage}