Magento 2 AWS Cluster with Terraform from AWS CloudShell

Magento 2 aws cluster configuration with terraform, An enterprise-grade solution for companies of all sizes, B2B B2C. Secure, flexible, and scalable infrastructure to allow you to build the experience you want your customers to have. Deploy a full-scale e-commerce infrastructure based on Magento 2 in a matter of seconds.

A huge project can be broken down into parts or into small projects.

Classic configuration for Magento 2 auto scaling cluster on AWS ❤️
Powered by Graviton2 Processor.
AWS CloudShell + Terraform.

https://github.com/magenx/Magento-2-aws-cluster-terraform

  

  

Complete setup:

  •  4 autoscaling groups with launch templates base64 converted from user_data.*
  •  5 instances target groups (varnish frontend admin staging developer)
  •  2 load balancers (external/internal) with listeners / rules
  •  1 rds mysql database
  •  1 build server
  •  1 elk domain
  •  2 redis elasticache
  •  1 rabbitmq broker
  •  2 s3 bucket
  •  1 codecommit repository 4 branches (main build staging developer)
  •  1 cloudfront s3 origin distribution
  •  1 efs file system
  •  Autoscaling policy per group
  •  Systems Manager [https://aws.amazon.com/systems-manager/]
  •  Cloudwatch + EventsBridge metrics/alarms/events/triggers
  •  All Magento files managed with git only
  •  Live shop in production mode / read-only
  •  CSF Firewall can be clustered

CI/CD scenario:

  • Event driven
  • Changes in 'magento' repository triggers EventsBridge rule.
  • System Manager runs bash script and cleanup on success.
  • Checking environment and do git pull from 'magento' repository and cleanup.
  • Change deployment logic to your needs.

With the advent of the AWS CloudShell, it is even easier to test and run infrastructure with Terraform.
Simply log in to the AWS Console, open AWS CloudShell, install Terraform, and you're good to go.


$ sudo yum install -y yum-utils
$ sudo yum-config-manager --add-repo https://rpm.releases.hashicorp.com/AmazonLinux/hashicorp.repo
$ sudo yum -y install terraform



The home directory has persistent storage.