-
Notifications
You must be signed in to change notification settings - Fork 0
/
template.yaml
50 lines (46 loc) · 1.23 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
AWSTemplateFormatVersion: "2010-09-09"
Transform: AWS::Serverless-2016-10-31
Globals:
Function:
Runtime: nodejs12.x
Timeout: 120
MemorySize: 256
Handler: index.handler
Tracing: Active
Api:
EndpointConfiguration: REGIONAL
TracingEnabled: true
Resources:
TimeLoggerFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: ./src/TimeFunction
Events:
ApiEvent:
Type: Api
Properties:
Path: /
Method: get
RestApiId:
Ref: TimeApi
Timeout: 60
# ApiEvent:
# Type: HttpApi
# Properties:
# ApiId: !Ref TimeApi
# Method: GET
# Path: /time
TimeApi:
Type: AWS::Serverless::Api
Properties:
Name: TimeApi
StageName: prod
Cors: "'*'"
TimeLoggerFunctionPermission:
Type: AWS::Lambda::Permission
DependsOn:
- TimeApi
Properties:
Action: lambda:InvokeFunction
FunctionName: !Ref TimeLoggerFunction
Principal: apigateway.amazonaws.com