TheKeyholdingCompany / python-aws-blue-green

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AWS Blue/Green Deploy Scrips

A collection of script to flip a Route53 domain between two A records.

Prerequisites

In order to keep configuration out of the scripts all variables are configured via ENV. Each tools requirements may require additional variables, however you will always need to set:

  • AWS_ACCESS_KEY_ID
  • AWS_SECRET_ACCESS_KEY
  • AWS_REGION - Region for the infrastructure
  • BLUE_DEPLOY_DOMAIN - the domain for "blue" platform.
  • GREEN_DEPLOY_DOMAIN - the domain for "green" platform.
  • TARGET_DEPLOY_DOMAIN - the domain you wish switch the DNS on.

We strongly advise creating a new IAM user just for Route53 just in case.

Tools

Retrieving currently live domain

env PYTHONPATH=. /bin/current_live_environment

Returns the current live environment

Flipping currently live domain

env PYTHONPATH=. /bin/flip_dns_record

Points TARGET_DEPLOY_DOMAIN at the alternate blue/green record

Rollback

env PYTHONPATH=. /bin/rollback

Returns the current live environment

Start Instances for ELB

env PYTHONPATH=. /bin/start_instances

Extra Environment Variables

  • ELB_NAME - The ELB name that the instances belong to

Stop Instances for ELB

env PYTHONPATH=. /bin/stop_instances

Extra Environment Variables

  • ELB_NAME - The ELB name that the instances belong to

About

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Python 100.0%