Code Monkey home page Code Monkey logo

serverless-le-aws-cloudwatch's Introduction

Serverless le-aws-cloudwatch

serverless

Deploy the LogentriesCommunity le-aws-cloudwatch project using the Serverless Framework. Stream AWS Lambda and other CloudWatch logs to Logentries.

Created by the LogentriesCommunity, le-aws-cloudwatch is an AWS Lambda function written in Python that is invoked by CloudWatch stream events and pushes the corresponding CloudWatch logs to Logentries.

Prerequisites

  • Serverless Framework installed or available via CICD
  • The token for a token based log set up in Logentries
  • The name of the log in CloudWatch to process (i.e. /aws/lambda/my-function)

Deployment

Deploy le-aws-cloudwatch from the command line using arguments:

serverless deploy --le-region eu --le-token abcd1234 --cw-log /aws/lambda/my-function

Depending on your workflow you can also deploy using environment variables:

export LOGENTRIES_REGION=eu
export LOGENTRIES_TOKEN=abcd1234
export CLOUDWATCH_LOG=/aws/lambda/my-function
export CICD_REGION=ap-southeast-2

serverless deploy

Options

Argument Environment Variable Description
le-region LOGENTRIES_REGION The Logentries account region, currently only eu
le-token LOGENTRIES_TOKEN The log token generated by Logentries that will be streamed to
cw-log CLOUDWATCH_LOG The Cloudwatch log to stream to Logentries

Working with Multiple CloudWatch Logs

As it is highly likely that you will want to process multiple CloudWatch logs we recommend using the name of the CloudWatch log file as the stage argument from the command line:

serverless deploy --le-region eu --le-token abcd1234 --cw-log /aws/lambda/my-function --stage my-function

The stage name must be unique for each function and environment.

Note: If the combined service name (le-cw), stage parameter (my-function) and region (ap-southeast-2) exceed 64 characters you may receive an error similar to:

An error occurred: IamRoleLambdaExecution - 1 validation error detected: Value 'le-cw-my-very-very-really-really-long-function-name-ap-southeast-2-lambdaRole' at 'roleName' failed to satisfy constraint: Member must have length less than or equal to 64.

If this occurs the ony option is to shorten your stage name. This is the reason we have kept the service name short (le-cw).

Merging the le-aws-cloudwatch Dependency

If the le-aws-cloudwatch dependency changes then those changes can be merged in using a Git Subtree Merge.

Step 1 - Add le-aws-cloudwatch as a remote
git remote add -f le-aws-cloudwatch https://github.com/LogentriesCommunity/le-aws-cloudwatch.git
Step 2 - Pull in the changes from le-aws-cloudwatch
git subtree pull --prefix=le-aws-cloudwatch/ le-aws-cloudwatch master --squash

Then push the changes or if you have created a fork open a pull request.

serverless-le-aws-cloudwatch's People

Contributors

amarjeetkaurgill avatar ariskataoka avatar jeffski avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

jeffski

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.