-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemplate.yml
More file actions
63 lines (55 loc) · 1.94 KB
/
Copy pathtemplate.yml
File metadata and controls
63 lines (55 loc) · 1.94 KB
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
AWSTemplateFormatVersion: 2010-09-09
Transform:
- AWS::Serverless-2016-10-31
Description: "SAM example of a Lambda function and API which grants magical predictions"
Parameters:
MyVar:
Type: String
Description: "Just an example of a parameter variable you can pass in"
Default: "42"
FavoriteColor:
Type: String
Description: "What is your favorite color?"
Default: "black"
Globals:
Function:
AutoPublishAlias: live
# API Gateway is automatically created with just the function resource declared.
# Deploy as is and see how it works.
# Then, to see how things change when you declare the api gateway on your own
# 1. Uncomment all 4 WebApi lines PLUS...
# 2. Uncomment the EightBallFunction.Events.GetEvent.Properties.Method.RestApiId PLUS...
# 3. Uncomment the entire Outputs section
# 4. Then re-build and re-deploy
#
# Note that the api sub domain will change (and will be listed in the Outputs section).
# This is because you discarded the default API and declared your own.
# You may uncomment _ALL_COMMENTED_LINES_ below to see the WebApi resource in action.
Resources:
# WebApi:
# Type: AWS::Serverless::Api
# Properties:
# StageName: "Prod"
EightBallFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: app/
Handler: index.get
Runtime: nodejs24.x
RolePath: / # Leave as-is unless your organization requires a Role path for applications
PermissionsBoundary: !Ref 'AWS::NoValue' # Leave as-is unless your organization requires a permissions boundary
Environment:
Variables:
MyVar: !Ref MyVar
FavoriteColor: !Ref FavoriteColor
Events:
GetEvent:
Type: Api
Properties:
Path: /
Method: get
# RestApiId: !Ref WebApi
# Outputs:
# UserAPI:
# Description: "API Gateway URL"
# Value: !Sub "https://${WebApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/"