🚀 Launch Week Day 5:Introducing Immutable Scans.Learn More →
Socket
Book a DemoInstallSign in
Socket

@teamgantt/eb-blue-green

Package Overview
Dependencies
Maintainers
3
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@teamgantt/eb-blue-green

Utilities for blue green deployments

latest
npmnpm
Version
1.0.0
Version published
Maintainers
3
Created
Source

eb-blue-green

Utilities for handling blue green deployments in elastic beanstalk environments.

Configuration

You will want some environment variables set for local use:

export AWS_PROFILE=teamgantt
export AWS_REGION=us-east-2
export NODE_ENV=development

If running in an AWS environment, you don't really need to worry about anything.

Local use assumes it will be reading profile information from ~/.aws/credentials based off the AWS_PROFILE environment variable and the AWS_REGION environment variable.

There is .envrc in the repo if you are into using direnv. Just update the values with your own profile/region.

Usage

These are mostly functions that sit on top of the aws sdk for JavaScript.

Since beanstalk environment names have to be unique for a region within an account, most of these functions operate from that starting point.

The main functions of interest are cloneEnvironment, swapUrls, and terminateEnvironment.

const eb = require('@teamgantt/eb-blue-green');

(async function() {

// clone the blue environment to a new env called "green"
await eb.cloneEnvironment('blue', 'green');

// swap the blue and green cnames - i.e direct traffic to green
const from = 'blue';
const to = 'green';
await eb.swapUrls(from, to);

// when you are done deploying and testing blue, swap things back and clean up
await eb.swapUrls(to, from);
await eb.terminateEnvironment('green');

})();

Keywords

aws

FAQs

Package last updated on 04 Sep 2019

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