Skip to content

davoclock/magento2-tf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

magento2-tf

Summary

This terraform project creates a Multi-AZ Magento 2.4 environment on AWS. Here are the services it uses:

  1. EC2 for Bastion Host (Amazon Linux 2) and ALBs
  2. Fargate for Varnish and Magento
  3. EFS for media assets
  4. RDS for MariaDB (10.4)
  5. ElasticSearch (7.4)
  6. Cloudfront
  7. Route 53

Here's what you need:

  1. Wildcard, or store-url matching SSL cert under ACM
  2. AWS Credentials file with profile name: "magento2-tf", matching the region you choose on the variables.tf file

How-to

Deployment

  1. Edit the terraform/variables.tf file, set the credentials variable to your aws credentials file.
  2. Add 1 profiles to your credentials file with the region you want to deploy Magento to. Use profile name: magento2-tf
[magento2-tf]
region = <region>
aws_access_key_id = <ACCESS_KEY_ID>
aws_secret_access_key = <SECRET_KEY>
  1. Modify vars.tf, set the region variable to where you want Magento to be deployed to. Default value is us-east-1
  2. Edit terraform/variables.tf, adjust variable ssl_cert_arn, set to SSL cert on ACM

Diagram

screenshot

Progress

Network

  • VPCs
  • Subnets
  • Routing tables
  • Internet Gateways
  • NAT Gateways
  • Routing table associations
  • Default Routes
  • VPC Routes
  • Security Groups
  • Database Subnet Groups

IAM

  • EC2 Role (bastion host)
  • ECS Web Task Execution roles
  • ECS Varnish Task Execution roles

EC2 - Bastion Host

  • EC2 Instance
  • Key Pair

Database

  • MariaDB Database (10.4.13)
  • Parameter Groups
  • Storage Auto-Scaling

EFS

  • EFS Volumes
  • EFS Targets

Redis

  • Redis Session Cluster
  • Redis Default Cache Cluster

Search

  • Elasticsearch Domain
  • Elasticsearch Access Policies
  • Elasticsearch Dedicated Master

LBs

  • Varnish ALB
  • Magento ALB
  • Target Groups
  • Listener Security Profiles
  • Health Checks

Cache

  • Varnish Dockerfile
  • Varnish ECR Repo
  • Fargate Cluster
  • Fargate Task Definition
  • Fargate Service

Web

  • Magento 2.4 Dockerfile
  • Magento ECR Repo
  • Fargate Cluster
  • Fargate Task Definition
  • Fargate Service

Magento CodePipeline

  • Build Process
  • Deploy Process
  • Github source
  • Magento ECR Permissions

CDN

  • Cloudfront

WAF

  • AWS Shield

Useful Links

Magento performance best practices

Magento system requirements

Tuning Nginx

About

AWS Infrastructure for Magento 2.4 (multi-az)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published