Skip to content

Moving a WordPress-based application from on-premise to a cloud-hosted solution

License

Notifications You must be signed in to change notification settings

fabioacp/devops-wordpress-iac

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Contributors Forks Stargazers Issues MIT License

Moving a WordPress-based application from on-premise to a cloud-hosted solution

Table of Contents

About The Project

This project aims to move a web application from on-premise to a cloud-hosted solution.

Currently, the WordPress-based application uses LAMP stack (Linux, Apache, MySQL, and PHP) and the solution is hosted in a single server (application and database) where the deployments are made through FTP transfers to the server.

This cloud migration is designed to comply with the following requirements:

  • The application must be containerized;
  • The application must to be secure (all data encrypted at rest and in transit)
  • The application must to be highly available.
  • The application must to support peaks of up to 10 times the average load (scalability).
  • The infrastructure must 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)

Solution Diagram

Solution Diagram

Technologies

Documents Index

Getting Started

Prerequisites

Usage

πŸ”₯πŸ”₯πŸ”₯ TL;DR; πŸ”₯πŸ”₯πŸ”₯
GRAB THE POPCORN 🍿
RUN make kick-n-run (docker daemon must be running)
ENJOY THE SHOW 😎 🎦

Clone or download the repository to your machine:

git clone https://github.com/devopsacademyau/2020-jun-project1-group1.git

Set up your AWS credentials:

aws configure

Decide on where you want the terraform state files to be stored. local is fine, but s3 is recommened (https://www.terraform.io/docs/backends/types/s3.html)

vim ./terraform/_backend.tf

Review and update the main.tfvars file with your variables

vim ./terraform/main.tfvars

(Optional) plan the terraform build

make tf-ci-plan

Run below from your root directory

make kick-n-run

Destroy the infrastructure

make tf-ci-remove

How To's

Initiate the infrastructure

it will create the infrastructure commands only, it will not push the wordpress docker image.

Quickest way:

Update the docker image in the ECR

Deploy a new docker image to the ECS

Remove the resources created

Change the name of the project

  • Edit main.tfvars file and change the variable project.
  • Edit .env file in the root directory (create if doens't exists) and change the variable PROJECT_NAME

Change the name of the ECR repository

  • Edit main.tfvars and change the variable repository_name.
  • Edit .env file in the root directory (create if doens't exists) and change the variable DOCKER_REPOSITORY

Change the ECR repository location to another AWS account

  • Edit .env file in the root directory (create if doens't exists) and change the variable DOCKER_REGISTRY_URL

Use S3 as terraform backend

Roadmap

See the open issues for a list of proposed features (and known issues).

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b <branch-name>)
  3. Commit your Changes (git commit -m 'Add a new contribution')
  4. Push to the Branch (git push origin <branch-name>)
  5. Open a Pull Request

License

Distributed under the Creative Commons Public Licenses. See LICENSE for more information.

Contact

TBC

About

Moving a WordPress-based application from on-premise to a cloud-hosted solution

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published