Giter Site home page Giter Site logo

launchdarkly-lambda's Introduction

LaunchDarkly Lambda

Automate LaunchDarkly flag updates from AWS events.

Why?

This is a proof of concept. The idea is that when certain services are not available we may want to turn off related features automatically.

How?

An AWS Lambda function is configured to listen to AWS CloudWatch events, and toggle flags accordingly. At this stage a single flag is toggled based on EC2 instance state.

API calls to LaunchDarkly are managed using https://github.com/wyvern8/launchdarkly-nodeutils

Install

You will need to have configured https://serverless.com/ framework and aws sdk.

  1. clone this repo
  2. run npm install
  3. configure a .env file based on .envExample
  4. run npm run sls-deploy
  5. stop and start the instance you configured in .env and confirm the LaunchDarkly flag toggles on and off.

You can tail the Lambda logs while stopping and starting using npm run sls-logs

Config

As this is an initial prototype, it currently supports one flag toggled off when a single instance is not in 'running' state, and back on when it is running. This could be expanded to cater for a configurable list of events and associated flags (TODO). Event types: https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/EventTypes.html

Note that a couple of workarounds for loading swagger.yaml in Lambda are currently in place - this will be tidied up.

launchdarkly-lambda's People

Contributors

wyvern8 avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

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.