Skip to content

manan3349/Terraform-Drupal-Deployment

Repository files navigation

Drupal Logo

Terraform

AWS


Drupal Deployment on AWS using Terraform


DRUPAL :- Drupal is an open source content management platform supporting a variety of websites ranging from personal weblogs to large community-driven websites.

TERRAFORM:-Terraform is a tool for building, changing, and versioning infrastructure safely and efficiently.

AWS:- Deploying Drupal on AWS makes it easy to use AWS services to further enhance the performance and extend functionality of your content management framework.

PACKER:-Packer is a tool for building identical machine images for multiple platforms from a single source configuration.

The goal of this project is to host Drupal site on AWS via Terraform it's a cross-platform, extensible tool that codifies APIs into declarative configuration files that can be shared amongst team members, treated as code, edited, reviewed, and versioned.

The different areas taken into account involves:

  • Application Load Balancer with Autoscaling
  • Database Integration on RDS
  • Monitoring using Prometheus and Grafana

Also, a dedicated module named Network aims to provide desired information to implement all combinations of arguments supported by AWS and latest stable version of Terraform

Steps and requirements for setting up your own Drupal Infrastructure with monitoring

  • Sign up for AWS
  • Install Make
  yum install make
  • Install Packer
  yum install https://releases.hashicorp.com/packer/1.5.1/packer_1.5.1_linux_amd64.zip
  • Install Terraform
  yum install https://releases.hashicorp.com/terraform/0.12.13/terraform_0.12.13_linux_amd64.zip
  • Clone Repository
  git clone https://github.com/rahulttn/ttn-work.git
  git checkout drupal
  cd group-project
  • Changes when using your own custom VPC

  • Two ways for setting up the infrastructure

    • Using Makefile

      Additional requirements:

      • Intall make
        sudo yum install -y make

      Run the following commands in the order as given:

        make fix
        make validate
        make build
        make init # or run terraform init
        make plan # or run terraform plan
        make apply # or run terraform apply
        make destroy # or run terraform destroy
      
    • Using terraform.sh shell script

      No additional requirements

      Run the following commands in the order as given:

        sudo chmod +x terraform.sh
        ./terraform.sh fix
        ./terraform.sh validate
        ./terraform.sh build
        ./terraform.sh init # or run terraform init
        ./terraform.sh plan # or run terraform plan
        ./terraform.sh apply # or run terraform apply
        ./terraform.sh destroy # or run terraform destroy
      

AMI

  • Packages used in AMI:

      1.) Git   
      2.) PHP   
      3.) MariaDB
      4.) Nginx
      5.) CloudWatch-agent  
      6.) Drupal 
    

DRUPAL

Drupal login page installed using composer and drush.

Composer

can be used to manage Drupal and all dependencies (modules, themes, libraries).

Drush

Drush is a command line shell and Unix scripting interface for Drupal.

MODULE WORKFLOW

  • make fix:- This list down the errors and one may fix them via the file designed in a particular format
  • make validate:- used to validate the syntax and configuration of a template.
  • make build:- takes a template and runs all the builds within it in order to generate a set of artifacts.
  • make init:- used to initialize a working directory containing Terraform configuration files.
  • make plan:- used to creates an execution plan.
  • make apply:- command executes the actions proposed in a Terraform plan.
  • make destroy:- command is a convenient way to destroy all remote objects managed by a particular Terraform configuration.

MAKE Command:

make command is used in order to "tell what to do". Herein we've been using make to running all commands with a single tool. Detailed usage is listed in the Makefile.

Summary of Resources

  • 1 VPC (Azs, Public and Private Subnets)
  • 1 Application Load Balancer
  • 3 Security Groups
  • 2 Running Instance in ASG
  • 1 Monitoring Instance
  • 1 RDS in Private Subnet

Contributors

Feature Contributor
Drupal Deployment Digam Jain, Akshay Raj
Terraform Integration and Testing Akshay Raj, Manan Jain
AMI Generation Manan Jain, Aahan Sharma
Monitoring module integration Aahan Sharma
IAM Policies and Roles Aahan Sharma, Manan Jain
DB module integration Akshay Raj, Digam Jain
Secret Manager Integration Akash Raturi, Aahan Sharma
ASG module Integration Akshay Raj, Akash Raturi, Digam Jain
Network module Integration Akshay Raj
Documentation Digam Jain, Silky, Riya Shrivastava

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published