-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtemplate.yml
49 lines (45 loc) · 1.15 KB
/
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
AWSTemplateFormatVersion: '2010-09-09'
Transform: 'AWS::Serverless-2016-10-31'
Description: Musketeers Lambda Go SAM
Parameters:
StageName:
Type: String
AllowedValues:
- dev
- qa
- prod
EchoMessage:
Type: String
Globals:
Function:
Runtime: go1.x
Resources:
Echo:
Type: 'AWS::Serverless::Function'
Properties:
FunctionName: !Sub ${AWS::StackName}-echo
Description: returns the value of environment variable ECHO_MESSAGE
MemorySize: 128
CodeUri: ./bin/echo
Handler: echo
Policies:
- AWSLambdaFullAccess
Environment:
Variables:
ECHO_MESSAGE: !Ref EchoMessage
Events:
Get:
Type: Api
Properties:
Method: GET
Path: /echo
APIStage:
Type: AWS::ApiGateway::Stage
Properties:
DeploymentId: !Ref ServerlessRestApi.Deployment
RestApiId: !Ref ServerlessRestApi
StageName: !Ref StageName
Outputs:
EchoApi:
Description: "API Gateway endpoint URL for Echo function"
Value: !Sub "https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/${StageName}/echo/"