This terraform project creates a Multi-AZ Magento 2.4 environment on AWS. Here are the services it uses:
- EC2 for Bastion Host (Amazon Linux 2) and ALBs
- Fargate for Varnish and Magento
- EFS for media assets
- RDS for MariaDB (10.4)
- ElasticSearch (7.4)
- Cloudfront
- Route 53
Here's what you need:
- Wildcard, or store-url matching SSL cert under ACM
- AWS Credentials file with profile name: "magento2-tf", matching the region you choose on the
variables.tf
file
- Edit the
terraform/variables.tf
file, set thecredentials
variable to your aws credentials file. - 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>
- Modify
vars.tf
, set theregion
variable to where you want Magento to be deployed to. Default value isus-east-1
- Edit
terraform/variables.tf
, adjust variablessl_cert_arn
, set to SSL cert on ACM
- VPCs
- Subnets
- Routing tables
- Internet Gateways
- NAT Gateways
- Routing table associations
- Default Routes
- VPC Routes
- Security Groups
- Database Subnet Groups
- EC2 Role (bastion host)
- ECS Web Task Execution roles
- ECS Varnish Task Execution roles
- EC2 Instance
- Key Pair
- MariaDB Database (10.4.13)
- Parameter Groups
- Storage Auto-Scaling
- EFS Volumes
- EFS Targets
- Redis Session Cluster
- Redis Default Cache Cluster
- Elasticsearch Domain
- Elasticsearch Access Policies
- Elasticsearch Dedicated Master
- Varnish ALB
- Magento ALB
- Target Groups
- Listener Security Profiles
- Health Checks
- Varnish Dockerfile
- Varnish ECR Repo
- Fargate Cluster
- Fargate Task Definition
- Fargate Service
- Magento 2.4 Dockerfile
- Magento ECR Repo
- Fargate Cluster
- Fargate Task Definition
- Fargate Service
- Build Process
- Deploy Process
- Github source
- Magento ECR Permissions
- Cloudfront
- AWS Shield