Mhussein27
(Maha Hussein Sallam)
June 11, 2017, 7:31pm
1
Part of my Volunteering Activities in Qarii startup is to Automate The Environment Setup On Amazon Web Services (AWS) , So you can Create /Terminate EC2 Cloud servers in short time with a few scripts without losing your data , Then you can Configure, build and deploy your Application using Jenkins, and Docker Registry , Docker Swarm cluster. I am sharing the Scripts of the Machine creation and SW Installation and I hope it could be useful for any DevOps Engineer who wants to do the same task . Also I am looking forward for their contribution to enhance the scripts . Currently I am planning to Re-Write these scripts using Ansible .
# Project Title: WM-DevOps
The aim of the project is to Automate Machine/Environment Creation On Amazon Web Service , so you can make your Environment up or down in short time and with a few scripts.
## Introduction
We need to create the below machine , so we can build and deploy any App using a CI pipeline consisting of Docker, GitHub, Jenkins, and Docker Registry.
- Bastion : Machine with ubuntu OS which hosts wm-devop folder with all DevOps Scripts.
To make the Environment up ,all the Script should be run from there .
- Jenkins : Machine with ubuntu OS for Continouse Integration /Continouse Delivery.
- Registry: Machine with ubuntu OS to act as Docker Local Registry .
- Swarm:(Node-1"Leader",Node-2"Worker",Node-3"Worker") : Machines with Rancher OS to act as Docker Swarm Cluster .
The following diagram illustrates the CI pipeline that "you need to configure by Yourself" after machine creation on AWS:
The pipeline will be kicked off by a commit to a GitHub repository. The commit will cause Jenkins machine to run (3) build+push to Docker Registry Machine, and upon successful completion of these jobs, pull new images from DR and deploy the app on Swarm cluster using docker-compose. The following diagram illustrates the CI pipeline.
![](images/Pipeline.png)
This file has been truncated. show original
#Share_Your_Knowledge
Maha Hussein Sallam
1 Like
Great scripts! Would love to see terraform scripts for the same! Keep up the good work!
Might help as a reference
The best way for automating through terraform is using module structures.
This open source community terraform script has the necessary terraform resources to use it as a complete VPC module.
Every terraform resource is parameterized and you can pass all the vpc, subnets and other resources as variables to the Module.
All the dynamically generated values such as vpc id's, subnet id's are stored as outputs.