-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate.yaml
61 lines (54 loc) · 1.37 KB
/
template.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
55
56
57
58
59
60
61
AWSTemplateFormatVersion: '2010-09-09'
Transform: "AWS::Serverless-2016-10-31"
Description: trading-helper-service
Globals:
Api:
Auth:
ApiKeyRequired: false
Resources:
FetchBinanceFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: ./
Handler: fetchBinance.handler
Timeout: 5
Runtime: nodejs18.x
Metadata: # Manage esbuild properties
BuildMethod: esbuild
BuildProperties:
Minify: true
Target: "es2022"
Sourcemap: false
EntryPoints:
- fetchBinance.ts
LogGroup:
Type: AWS::Logs::LogGroup
Properties:
LogGroupName: !Sub "/aws/lambda/${FetchBinanceFunction}"
RetentionInDays: 1
InvokeFunctionURLPermission:
Type: AWS::Lambda::Permission
Properties:
Action: lambda:invokeFunctionUrl
FunctionName: !GetAtt FetchBinanceFunction.Arn
Principal: "*"
FunctionUrlAuthType : NONE
FetchBinanceURL:
Type: AWS::Lambda::Url
Properties:
AuthType: NONE
TargetFunctionArn: !GetAtt FetchBinanceFunction.Arn
Cors:
AllowCredentials: true
AllowOrigins:
- "*"
AllowMethods:
- "*"
AllowHeaders:
- "*"
ExposeHeaders:
- "*"
Outputs:
ServiceURL:
Description: "URL for FetchBinanceFunction"
Value: !GetAtt FetchBinanceURL.FunctionUrl