-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtemplate.yaml
84 lines (79 loc) · 2.17 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
AWSTemplateFormatVersion: '2010-09-09'
Transform: 'AWS::Serverless-2016-10-31'
Description: >-
Synchronize GitHub issue/pr events with Asana; feed events as they arrive
into a pipeline using a lambda, that then feeds out into other lambdas.
Resources:
githubhook:
Type: 'AWS::Serverless::Function'
Properties:
Tags:
Project: AsanaBot
Group: Python
Runtime: python3.11
MemorySize: 128
Handler: githubhook.enqueue_event
CodeUri: code/githubhook.py
Description: >-
Validate GitHub events and push to SNS
Timeout: 5
Events:
Hook:
Type: Api
Properties:
Path: /hooks/github
Method: POST
Environment:
Variables:
SNS_TOPIC_NAME: !Ref GitHubMessagePipe
Policies:
- SNSPublishMessagePolicy:
TopicName: !GetAtt GitHubMessagePipe.TopicName
- Version: '2012-10-17'
Statement:
- Effect: Allow
Action:
- 'ssm:GetParameter'
Resource: 'arn:aws:ssm:*:*:parameter/asanabot/GitHubToken'
messagehandler:
Type: 'AWS::Serverless::Function'
Properties:
Tags:
Project: AsanaBot
Group: Python
Runtime: python3.11
MemorySize: 128
Handler: sync.process_payload
CodeUri: _build/
Description: Sync github messages to Asana
Timeout: 60
Events:
NewMessage:
Type: SNS
Properties:
Topic: !Ref GitHubMessagePipe
Policies:
- S3CrudPolicy:
BucketName: 'unidata-python'
GitHubMessagePipe:
Type: 'AWS::SNS::Topic'
StackOverflowChecker:
Type: 'AWS::Serverless::Function'
Properties:
Tags:
Project: AsanaBot
Group: Python
Runtime: python3.11
MemorySize: 128
Handler: stackoverflow.check_stack_overflow
CodeUri: _build/
Description: Sync Stack Overflow questions to Asana
Timeout: 120
Events:
Cron:
Type: Schedule
Properties:
Schedule: rate(15 minutes)
Policies:
- S3CrudPolicy:
BucketName: 'unidata-python'