-
Notifications
You must be signed in to change notification settings - Fork 6
/
sam-template.yml
49 lines (41 loc) · 1.7 KB
/
sam-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
Transform: 'AWS::Serverless-2016-10-31'
Resources:
MainFunction:
# This resource creates a Lambda function.
Type: 'AWS::Serverless::Function'
Properties:
# This function uses the Nodejs v12 runtime.
Runtime: nodejs12.x
# This is the Lambda function's handler.
Handler: handler.lambdaHandler
# The location of the Lambda function code.
CodeUri: .
# Event sources to attach to this function. In this case, we are attaching
# one API Gateway endpoint to the Lambda function. The function is
# called when a HTTP request is made to the API Gateway endpoint.
Events:
MainPage:
# Define an API Gateway endpoint that responds to HTTP GET at /thumbnail
Type: Api
Properties:
Path: /
Method: GET
CSSFile:
# Define an API Gateway endpoint that responds to HTTP GET at /thumbnail
Type: Api
Properties:
Path: /public/index.css
Method: GET
JSFile:
# Define an API Gateway endpoint that responds to HTTP GET at /thumbnail
Type: Api
Properties:
Path: /public/main.js
Method: GET
Outputs:
# ServerlessRestApi is an implicit API created out of Events key under Serverless::Function
# Find out more about other implicit resources you can reference within SAM
# https://github.com/awslabs/serverless-application-model/blob/master/docs/internals/generated_resources.rst#api
StagingUrl:
Description: "Staging URL"
Value: !Sub "https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/"