@linzjs/cdk-elastic-shipper
TypeScript icon, indicating that this package has built-in type declarations

3.6.2 • Public • Published

Elastic Log Shipper

Build Status

Lambda function to ship logs from various AWS sources into a elastic search instance of your choosing.

Usage

This package exposes a AWS-CDK construct that can be imported into your CDK stack and can be used to configure logs to be automatically shipped into an elastic search of your choosing

import * as cdk from '@aws-cdk/aws-cdk'
import * as ssm from '@aws-cdk/aws-ssm'
import { LambdaLogShipperFunction } from '@linzjs/cdk-elastic-shipper'

export class YourStack extends cdk.Stack {

  public constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) {
    super(scope, id, props);
    const vpc = new ec2.Vpc(this, 'Vpc');

    const config = {
      name: 'default',
      accounts: [{
        id: '1234567890',
        elastic: '/es-shipper-config/elastic-default',
        name: 'linz',
        tags: ['hello'],
        prefix: 'account-prefix',
        logGroups: [{
          filter: '**',
          prefix: 'lg-prefix',
        }],
      }],
    };
    this.logShipper = new LambdaLogShipperFunction(this, 'LogShipper', { config, vpc });

    /** Register a listener on a bucket, so when files are added they are to submitted to the log shipper*/
    const logBucket = new s3.Bucket(this, 'LogBucket');
    this.logShipper.addS3Source(logBucket);
  }
}

The elastic connection strings need to be stored inside of SSM before running the deployment, there are three options for elasticsearch connections

  1. AWS
{ url: 'https://node-name.eu-west-1.es.amazonaws.com' }
  1. ElasticCloud
{
  id: 'cloud:abc123',
  username: 'foo',
  password: 'bar'
}
  1. Http
{
  url: 'https://fake.com'
  username: 'foo'
  password: 'bar'
}

Building

This repository requires NodeJs > 12 & Yarn

Use n to manage nodeJs versions

# Download the latest nodejs & yarn
n latest
npm install -g yarn

# Install node deps
yarn

# Build everything into /build
yarn run build

# Run the unit tests
yarn run test

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
3.6.20latest

Version History

VersionDownloads (Last 7 Days)Published
3.6.20
3.6.10
3.6.00
3.5.30
3.5.20
3.5.10
3.5.00
3.4.20
3.4.10
3.4.00
3.3.00
3.2.10
3.2.00
3.1.00
3.0.00
2.0.00
1.2.00
1.1.20
1.1.10
1.1.00
1.0.00
0.6.20
0.6.10
0.6.00
0.5.00
0.4.20
0.4.10
0.4.00
0.3.00
0.2.10
0.2.00
0.1.00

Package Sidebar

Install

npm i @linzjs/cdk-elastic-shipper

Weekly Downloads

0

Version

3.6.2

License

MIT

Unpacked Size

1.47 MB

Total Files

163

Last publish

Collaborators

  • linzds
  • blacha
  • philals