forked from JuliaRegistries/TagBot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemplate.yaml
More file actions
76 lines (71 loc) · 1.87 KB
/
template.yaml
File metadata and controls
76 lines (71 loc) · 1.87 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
64
65
66
67
68
69
70
71
72
73
74
75
76
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: TagBot Web Service
Parameters:
GithubTokenParam:
Type: String
Default: /tagbot/github-token
Description: SSM parameter name for the GitHub token (SecureString)
TagbotRepo:
Type: String
Default: JuliaRegistries/TagBot
TagbotIssuesRepo:
Type: String
Default: JuliaRegistries/TagBotErrorReports
TagbotCommit:
Type: String
Default: unknown
Globals:
Function:
Runtime: python3.12
Environment:
Variables:
TAGBOT_REPO: !Ref TagbotRepo
TAGBOT_ISSUES_REPO: !Ref TagbotIssuesRepo
TAGBOT_COMMIT: !Ref TagbotCommit
Resources:
ApiFunction:
Type: AWS::Serverless::Function
Metadata:
BuildMethod: makefile
Properties:
Handler: tagbot.web.lambda_handler.handler
CodeUri: .
Timeout: 10
Events:
Root:
Type: Api
Properties:
Path: /
Method: ANY
Proxy:
Type: Api
Properties:
Path: /{proxy+}
Method: ANY
Environment:
Variables:
REPORTS_FUNCTION: !Ref ReportsFunction
Policies:
- LambdaInvokePolicy:
FunctionName: !Ref ReportsFunction
ReportsFunction:
Type: AWS::Serverless::Function
Metadata:
BuildMethod: makefile
Properties:
Handler: tagbot.web.reports.handler
CodeUri: .
Timeout: 30
Environment:
Variables:
GITHUB_TOKEN_PARAM: !Ref GithubTokenParam
Policies:
- Statement:
- Effect: Allow
Action: ssm:GetParameter
Resource: !Sub arn:aws:ssm:${AWS::Region}:${AWS::AccountId}:parameter${GithubTokenParam}
Outputs:
ApiUrl:
Description: API Gateway URL
Value: !Sub https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/