Skip to content

Instantly share code, notes, and snippets.

@rowanu
Last active March 19, 2021 12:38
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rowanu/f014ee1ce5997ebcf3e6983391e30544 to your computer and use it in GitHub Desktop.
Save rowanu/f014ee1ce5997ebcf3e6983391e30544 to your computer and use it in GitHub Desktop.
Clean up a Lambda function's logs when you delete it
AWSTemplateFormatVersion: '2010-09-09'
Transform: 'AWS::Serverless-2016-10-31'
Resources:
MyFunction:
Type: AWS::Serverless::Function
Properties:
InlineCode: |
exports.handler = async () => {
console.log('im in ur logs, killing ur d00ds')
return
}
Handler: index.handler
Runtime: nodejs8.10
LogGroup:
Type: AWS::Logs::LogGroup
Properties:
LogGroupName: !Sub /aws/lambda/${MyFunction}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment