Skip to content

Instantly share code, notes, and snippets.

@alexcasalboni
Created June 17, 2019 18:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexcasalboni/d18ae0c5c721ec19f3a77df834c61178 to your computer and use it in GitHub Desktop.
Save alexcasalboni/d18ae0c5c721ec19f3a77df834c61178 to your computer and use it in GitHub Desktop.
CloudWatch Logs - serverless app for logs processing
AWSTemplateFormatVersion: '2010-09-09'
Transform: 'AWS::Serverless-2016-10-31'
Resources:
MyProcessingFunction:
Type: AWS::Serverless::Function
Properties:
Handler: index.handler
Runtime: python3.7
Policies:
- AWSLambdaExecute # Managed Policy
- Version: '2012-10-17' # Policy Document
Statement:
- Effect: Allow
Action:
- logs:GetLogEvents
Resource: arn:aws:logs:::log-group:my-log-group
Events:
LogsSubscription:
Type: CloudWatchLogs
Properties:
LogGroupName: my-log-group
FilterPattern: ERROR
# ...
# all the other properties here
# ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment