/EB-Worker-RDS-VPC

Elastic Beanstalk Worker Tier Application, with cloud formation template to deploy in VPC with an RDS backend

Primary LanguagePythonApache License 2.0Apache-2.0

EB-Worker-RDS-VPC

Elastic Beanstalk Worker Tier Application, with cloud formation template to deploy in VPC with an RDS backend

TL;DR // Deploy All the Things

  1. Clone Repo

    1. $ git clone https://github.com/jessicalucci/EB-Worker-RDS-VPC.git $ cd EB-Worker-RDS-VPC
  2. EC2 Key Pair

    1. You'll need to create an EC2 Key Pair (you can't do this through cloud formation) for SSH access to your boxes.
    2. Once you've created your Key Pair, you'll need to put its' name into the cloud formation template under EC2KeyPairName
  3. CF

    1. You'll need to put your AWS Account Number into the cloud formation template at AWSAccountNumber
    2. Once your cloud formation template is filled out (and edited as you'd like), you'll deploy the template via the AWS CLI:
      • $ aws --profile <PROFILE> --region <REGION> cloudformation create-stack --stack-name job-server --capabilities CAPABILITY_IAM --template-body file://deploy/config/job-server.json
  4. Build Application

    1. Once your cloud formation stack has spun up, and this will take a while thanks to RDS deploys, you'll need to update the application config to point at your new DB Host. You can find the RDS host name in the AWS Console.

    2. Bundle the application for deployment. I've included a short script to automate the process for you. Just run:

      • $ cd deploy && ./build.sh
    3. Take the zip file generated by the build script and deploy it to your beanstalk environment via the AWS console.

      • Unfortunately, at this time there's no "one-step" command to deploy a zip file to a beanstalk environment via the command line. You have to first upload the zip file to an s3 bucket, and then deploy the s3 file to your application. This requires another set of IAM privileges for your deployment, so I figured the manual step was worth the tradeoff of reduced complexity. (:
  5. Test it out!