This repository is related to source code of the project 1 of group2.
A company in Australia currently have a web application running on a Linux virtual machine. The application is being used by hundreds of customers every day and it is based on Wordpress which uses LAMP stack (Linux, Apache, MySQL and PHP) to offer great products.
Currently the solution is hosted in a single server (application and database) and deployments are made through FTP transfers to the server.
The CEO is worried that a traffic peak may bring down the website and decided to migrate to AWS. Your team was contracted to perform this migration.
Run a pilot migration to AWS cloud considering the following requirements:
- Containerize the application using Docker (see Resources section).
- The application needs to be secure (all data encrypted at rest and in transit)
- The application needs to be high available.
- The application needs to support peaks of up to 10 times the average load (scalability).
- The infrastructure needs to be reproducible and version controlled in case the CEO decides to expand the business to other parts of the world (consider infra as code).
- There must be an easy and secure way of developing, with fast feedback (consider CI/CD practices or at least automation scripts)
- As it is a pilot migration to AWS, data migration is out of scope
- Testers were contracted to develop unit/service/integration tests for this pipelinea, so you don't need to write tests but consider including this step in your CI pipeline or automation scripts!
- Consider the application as stateless for this pilot. In Wordpress some files may be stored locally on the server (e.g. on image upload)
- For this pilot we are aiming to have as much as possible as code
- Single Github repo.
- Clone the repository and get inside it:
git clone [email protected]:devopsacademyau/2020-jun-project1-group2.git
cd 2020-jun-project1-group2
** Check if you have permission to clone the repository via SSH, or insert your ssh-key on your github(more details here).
Installing from your Local Machine
-
Install Required Tools (as above)
-
Create an encrypted S3 bucket for state. Modify
terraform/_backend.tf
to set your bucket name. -
Generate a key pair called
key_pair_group2
-
Export the following variables that are required according to our
.env-template
. They areAWS_ACCESS_KEY_ID
, andAWS_SECRET_ACCESS_KEY
.So, according to this example
export AWS_ACCESS_KEY_ID="your_access_key" export AWS_SECRET_ACCESS_KEY="your_secret"
-
Run
make plan
-
Run
make apply
-
Change the DB password using the console. Example:
/wordpress/WORDPRESS_DB_PASSWORD
-
Run
make build
-
Run
make publish
-
Run
make deploy-wp
Solution Diagram can be acessed here
- Nimmi (nimmi89)
- Tim (obrientimothya)
- Guilherme (gepifanio)
- Marcos (mrcsmonteiro)
- Gustavo (gpavelar)
- DevOps Trainers
- Caio
- Denis
- Kiko