0.2.7 • Published 9 months ago

serverless-plugin-infrequent-access-logs v0.2.7

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

serverless-plugin-infrequent-access-logs

serverless tests codecov

This plugin allows you to create and configure infrequent access log groups for your lambdas. Infrequent access CloudWatch logs are 50% cheaper in data ingestion cost and are suitable for workloads that do not require the more advanced features of CloudWatch.

As CloudFormation does not support changing log group classes, this plugin will instead add new infrequent access log groups to your CloudFormation stack following the pattern:

  • /aws/lambda/plugin/ia/${lambda-name}

Usage

  1. Install the plugin.
npm install serverless-plugin-infrequent-access-logs
  1. Register it in your serverless.yml file.
service: sample

plugins:
  - serverless-plugin-infrequent-access-logs

provider:
  name: aws

custom:
  infrequentAccessLogs: true # Set globally for all lambdas
  infrequentAccessLogRetention: 30

functions:
  function1:
  function2:
    infrequentAccessLogs: true # Set for specific lambdas (will override the global value)
    infrequentAccessLogRetention: 7

Notes

  • Adding this plugin into your serverless.yml file will automatically result in IA log groups being created for all your lambdas, even if you do not set infrequentAccessLogs: true.
  • Setting infrequentAccessLogs: true to a lambda simply configures the lambda to use the IA log group.
  • When setting infrequentAccessLogs: false, the IA log groups created by this plugin will remain but will not be used by your lambdas.
  • Any existing log groups managed by Serverless will remain in your CloudFormation stack.
  • When removing this plugin, any IA log groups created by this plugin will also be deleted from your CloudFormation stack.
  • Valid log retention values can be found here.
  • infrequentAccessLogRetention works independently from infrequentAccessLogs in the sense that you can specify/update either one without the other.
  • If no values are set, the default configuration is false and the default log retention is forever.
0.2.7

9 months ago

0.2.6

9 months ago

0.2.1

10 months ago

0.2.3

10 months ago

0.2.2

10 months ago

0.2.5

10 months ago

0.2.4

10 months ago

0.2.0

11 months ago

0.1.0

11 months ago