-
Notifications
You must be signed in to change notification settings - Fork 0
/
template.yaml
36 lines (33 loc) · 926 Bytes
/
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
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: 'AWS SAM Workshop :)'
Resources:
HelloWorldFunction:
Type: 'AWS::Serverless::Function'
Properties:
CodeUri: code/HelloWorld/
Handler: app.lambdaHandler
Runtime: nodejs20.x
MemorySize: 512
Architectures:
- "arm64"
Events:
HelloWorld:
Type: Api
Properties:
Path: /hello
Method: get
RestApiId: !Ref API
API:
Type: AWS::Serverless::Api
Properties:
StageName: TST
Cors:
AllowMethods: "'GET,POST,OPTIONS'"
AllowHeaders: "'content-type'"
AllowOrigin: "'*'"
AllowCredentials: false
Outputs:
HelloWorldApi:
Description: 'API Gateway endpoint URL for Hello World Lambda Function'
Value: !Sub "https://${API}.execute-api.${AWS::Region}.amazonaws.com/TST/hello/"