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.
- 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
- 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
- Switch to drupal-custom-vpc branch
- Go to the Network module variables.tf
- This contains variable "vpc_new_id". Change its default value to your vpc id.
- Go to the Network module main.tf
- Comment module "vpc" which creates a new vpc
- Make sure that data modules (vpc, subnet) are not commented
- Go to the Network module variables.tf
- Switch to drupal-custom-vpc branch
-
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
-
-
Packages used in AMI:
1.) Git 2.) PHP 3.) MariaDB 4.) Nginx 5.) CloudWatch-agent 6.) Drupal
Drupal login page installed using composer and drush.
can be used to manage Drupal and all dependencies (modules, themes, libraries).
Drush is a command line shell and Unix scripting interface for Drupal.
make fix
:- This list down the errors and one may fix them via the file designed in a particular formatmake 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 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.
- 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
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 |