Socket
Book a DemoInstallSign in
Socket

@linzjs/cdk-elastic-shipper

Package Overview
Dependencies
Maintainers
3
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@linzjs/cdk-elastic-shipper

Ship log lines to elasticsearch

3.6.2
latest
Source
npmnpm
Version published
Maintainers
3
Created
Source

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

  • AWS
{ url: 'https://node-name.eu-west-1.es.amazonaws.com' }
  • ElasticCloud
{
  id: 'cloud:abc123',
  username: 'foo',
  password: 'bar'
}
  • 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

FAQs

Package last updated on 06 Sep 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.