Automating testing infrastructure spin-up - AWS

This document talks about the infrastructure set-up, design and workflow on how the entire test infrastructure comes up with every Jenkins job built and is torn down after the test suites are executed. 

Part 1:

Let's talk about the high level overview of what the job does and what all resources are provisioned in AWS. The job does 5 things to be precise. 

  1. The first Cloudformation template creates RDS instance and MongoDB instances. The cloud-formation template is stored in AWS account-B S3 . The Jenkins job pulls the template from S3 and provisions RDS instance and MongoDB instance in account B. The template has default values for RDS snapshot and MongoDB data volume snapshot ID. It creates a volume from snapshot for MongoDB instance, and attaches it to the instance at the desired location. The template also adds AWS Route 53 account entries for RDS and MongoDB instance in Account A. As mentioned here.
  2. The second step on Jenkins job changes the desired values for EC2 instance for ECS cluster which hosts the micro-service(s) for the application from 0 to 1. Check code here.
  3. Third step is integrated with Ghost inspector API plugin into the Jenkins job which connects to the ghost inspector and runs the already configured test suite. 
  4. It brings down the ECS cluster maximum instance value to 0 from 1. Check code here.
  5. Jenkins AWS Cloudformation plugin tears down the resources provisioned in step 1 of the job and also deletes the route 53 records in Account A.

The pipeline

Jenkins job: cloudformation-uitest

Step 1: RDS and MongoDB instances are brought up and registered in Route 53 in Prod tier. 

Step 2: ECS instance is brought up.

Step 3:Jenkins makes API calls to Ghost inspector to run the test suite.

Step 4: ECS is brought down

Step 5: RDS and Mongo DB are torn down and Route 53 entries are removed. 

Thank you for reading through the document. Please feel free to leave a comment or reach out if there are any questions/ suggestions/ measure for improvements.

To view or add a comment, sign in

Others also viewed

Explore content categories