forked from lucasfacchini/cloudwatch-log-publisher
-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
41 lines (35 loc) · 894 Bytes
/
serverless.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
service: cloudwatch-log-publisher
frameworkVersion: '3'
provider:
name: aws
stage: ${env:STAGE}
region: ${env:AWS_REGION}
runtime: python3.9
logRetentionInDays: ${env:LOG_RETENTION_DAYS}
memorySize: 128
custom:
pythonRequirements:
dockerizePip: true
functions:
handler:
handler: cloudwatch_log_publisher.handler.handle_log
environment:
SLACK_BOT_TOKEN: ${env:SLACK_BOT_TOKEN}
SLACK_CHANNEL: ${env:SLACK_CHANNEL}
MAX_MESSAGE_LENGTH: ${env:MAX_MESSAGE_LENGTH}
resources:
Resources:
CWLambdaPermission:
Type: AWS::Lambda::Permission
DependsOn:
- HandlerLambdaFunction
Properties:
FunctionName: !Sub "${AWS::StackName}-handler"
Action: lambda:InvokeFunction
Principal: logs.amazonaws.com
plugins:
- serverless-python-requirements
package:
exclude:
- node_modules/**
- .venv/**