-
Notifications
You must be signed in to change notification settings - Fork 0
/
template.yaml
41 lines (41 loc) · 1.2 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
AWSTemplateFormatVersion: 2010-09-09
Transform: AWS::Serverless-2016-10-31
Description: >-
A Lambda function that removes files older than a certain date from Slack
Metadata:
Name: slack-file-purge
Version: 0.2.0
Resources:
LogGroup:
Type: AWS::Logs::LogGroup
Properties:
LogGroupName: !Sub /aws/lambda/${AWS::StackName}
RetentionInDays: 7
Function:
Type: AWS::Serverless::Function
Properties:
Description: Purge files older than a specified date from Slack
FunctionName: !Ref AWS::StackName
CodeUri: ./bin
Architectures:
- arm64
Runtime: provided.al2
Handler: bootstrap
Timeout: 120
Policies:
- Version: 2012-10-17
Statement:
- Effect: Allow
Action: ssm:GetParameter
Resource: !Sub arn:aws:ssm:${AWS::Region}:${AWS::AccountId}:parameter/insurrection-slack-team/oauth-token
Events:
JobSchedule:
Type: Schedule
Properties:
Schedule: cron(0 13 * * ? *) # Once a day at 6AM Pacific time.
Input: >-
{
"excluded_channels": [
"C2JNMP4TE"
]
}