-
Notifications
You must be signed in to change notification settings - Fork 0
/
template.yaml
58 lines (50 loc) · 1.92 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
51
52
53
54
55
56
57
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: >
Template for the Dungeon Maestro lambda function. Processes commands from slack, and translates them into a DnD
based request.
# More info about Globals: https://github.com/awslabs/serverless-application-model/blob/master/docs/globals.rst
Globals:
Function:
Timeout: 10
Parameters:
Stage:
Description: The stage for the function
Type: String
AllowedValues:
- alpha
- beta
- gamma
- prod
Default: alpha
EnableTracing:
Description: Enable tracing in the service
Type: String
AllowedValues:
- true
- false
Default: false
Conditions:
ShouldEnableTracing: !Equals [true, !Ref EnableTracing]
Resources:
DungeonMaestroFunction:
Type: AWS::Serverless::Function # More info about Function Resource: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#awsserverlessfunction
Properties:
CodeUri: ./
Handler: maestro
Runtime: go1.x
Tracing: !If [ShouldEnableTracing, Active, PassThrough]
Environment: # More info about Env Vars: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#environment-object
Variables:
Stage: !Ref Stage
Region: !Ref AWS::Region
Events:
DungeonMaestro:
Type: HttpApi
Outputs:
DungeonMaestroApi:
Description: "API Gateway endpoint URL for Prod stage for the Dungeon Maestro function"
Value: !Sub "https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/"
DungeonMaestroFunction:
Description: "Dungeon Maestro Lambda Function ARN"
Value: !GetAtt DungeonMaestroFunction.Arn