# Infrastructure as code for eCommerce Cloud Architecture on AWS (Multi Cloud AWS,GCP,Azure)
This repository contains Magento 2 Cloud Terraform infrastructure as code for AWS Public Cloud.
This infrastructure is the result of years of experience scaling Magento 1 and 2 in the cloud. It comes with the best cloud development practices baked in to save your time and money.
Leveraging your own AWS Account dramatically reduces your monthly spend vs. paying an expensive managed hosting provider (PaaS, SaaS).
This script is not limited to Magento deployments and can be used with any eCommerce/Web platform, eg. WordPress, WooCommerce, Drupal, Shopware 6, Shopify APP (Custum Private APP cloud), VueStorefront, Silyus, Oddo, ORO etc. It includes Magento in the name because it was designed for Magento at first. There are however projects using it to run Enterprise Java applications with auto scaling.
If you have any questions feel free to send me an email â yegorshytikov@gmail.com
# Important!!!
Magento Software installation is out of the scope of this Project. This Repository just an example of the AWS infrastructure provisioning for Magento using Terraform. To Install Magento 2 on Centos 8 or AWS Linux 2 x86/ARM Linux use our another project:
**Magento 2 Installation Automation (Centos 8.2, AWS linux with ARM support) GitHub repository:**
[Magento installation Script] (https://github.com/Genaker/Magento-AWS-Linux-2-Instalation).
Graviton 2 ARM instances are also supported.
# Why Auoto Scaling
Increasing the number of PHP-FPM processes beyond the number of physical processor cores does not improve the performance, rather is likely to degrade it, and can consume resources needlessly. Basic rule for the web is:
CPU(physical) = (Concurrent HTTP REquest * http_req_duration)
Be careful Intel CPUs are virtual and actual number of CPUs factor = 2; Graviton AWS ARM64 CPUS have factor 1 and are better for concurrent request processing.
Intel CPUs have some advantages of 20-30% in some cases, however for magento (long heavy queries) physical cores are better. With higher trafic you need more CPUs.
It is rule for uncached pages.
With Varnish/FPC it is the same. However Varnish has response time ~ 1ms and a single instance CPU can return 1000 caches pages per sec. To avoid unpredictable results with the cache invalidation, misses, uncached checkouts, cart, AJAXs, API the BEST practices is to measure performance without FPC. FPC is a bonus.
## AWS Magento 2 Cloud Features:
* True Horizontal Auto Scaling
* Affordable (starting from ~300$ for us-west-2 region)
* MySQL RDS scalable Managed by Amazon, multi az failover, vertical scaling without downtime
* Compatible with RDS Aurora Cluster and Aurora Serverless
* EFS - Fully managed elastic NFS for media and configuration storage
* CloudFront CDN for static and media served from different origins S3 or Magento(EFS) as second origin
* Automatically back up your code and databases (point-in-time snapshot) for easy restoration
* 99.9% Uptime, availability across multiple zones
* High security (Security groups, private infrastructure)
* Elastic(Static) IP and used for internet access for all EC2 instances through NAT (Network Address Translation).
* Bastion host to provide Secure Shell (SSH) access to the Magento web servers.
* Appropriate security groups for each instance or function to restrict access to only necessary protocols and ports.
* Private Public Subnets - NAT gateway, Bastion server
* All servers and Database are hosted in private Network securely
* System and Software Update Patches
* DDoS Protection with AWS Shield
* PCI compliant infrastructure
* Redis cluster
* Amazon Elasticsearch Service - Elasticsearch at scale with zero down time with built-in Kibana
* Different Application Scaling Groups (ASG)
* Application Load Balancer(ALB) with SSL/TSL termination, SSL certificates management
* ALB Path-Based Routing, Host-Based Routing, Lambda functions as targets, HTTP header/method-based routing, Query string parameter-based routing
* Scaled Varnish ASG
* Dedicated Admin/Cron ASG
* You can easily add new autoscaling groups for your needs (Per WebSite/for Checkout requests/for API), just copy paste code
* Possibility to run the same infrastructure on Production/Staging/Dev environment, different projects
* Automatic CI/CD (CodePipeline/CodeDeploy) deployments possible
* AWS CodeDeploy In-place deployment, Blue/green deployment from Git or S3, Redeploy or Roll Back
* Deploying from a Development Account to a Production Account
* Amazon Simple Email Service (Amazon SES) - cloud-based email sending service. Price $0.10 for 1K emails
* Amazon CloudWatch - load all the metrics (CPU, RAM, Network) in your account for search, graphing, and alarms. Metric data is kept for 15 months.
* CloudWatch alarms that watche a single CloudWatch metric or the result of a math expression based on CloudWatch metrics and send SMS(Text) Notifications or Emails
* Simple and Step Scaling Policies - choose scaling metrics that trigger horizontal scaling
* Manual Scaling for Magento Auto Scaling Group (ASG)
* AWS Command Line Interface (CLI) - tool to manage your AWS services. You can control multiple AWS services from the command line and automate them through scripts.
* DynamoDb for logs, indexes, analytics
* Lambda functions as targets for a load balancer
* Elastic Container Registry (ECR) - fully-managed Docker container registry that makes it easy to store, manage, and deploy Docker container images!
* You can use Amazon Elastic Container Service (ECS) instead of ASG with Service Auto Scaling to adjust running containers desired count automatically.
* Awesome AWS documentation is Open Source and on GitHub
![Magento 2 AWS Infrastructure Cloud ](https://github.com/Genaker/TerraformMagentoCloud/blob/master/Magento2Cloud.png)
[Cloud Flat View](https://github.com/Genaker/TerraformMagentoCloud/blob/master/Magento2Cloud-Flat.png)
# Our Infrastructure
Infrastructure consists of multiple layers (autoscaling, alb, rds, security-group, vpc) where each layer is configured using one of the [Terraform AWS modules](https://github.com/terraform-aws-modules/) with arguments specified in `terraform.tfvars` in layers directory.
Terraform uses this during the module installation step of `terraform init` to download the source code to a directory on local disk so that it can be used by other Terraform commands.
The [https://registry.terraform.io/](public Terraform registry) provides infrastructure modules for many infrastructure resources.
[Terragrunt](https://github.com/gruntwork-io/terragrunt) is used to work with Terraform configurations which allows you to orchestrate dependent layers, update arguments dynamically and keep configurations. Define Terraform code once, no matter how many environments you have ([DRY](https://en.wikipedia.org/wiki/Don%27t_repeat_yourself)).
# Magento 2 Multi Regional Infastructure Support
We have a global scale-out model. All data updates (POST, DELETE request) are directed to the main data center region. All GET and CACHED requess (black lines) are directed regional data centers.
Geographically distant web servers add latency and degrade the shopping experience. Such mistakes can prove costly, resulting in lost customers, missed revenue, and reputational damage.
Route your traffic to your regional Magento Servers based on the user's location.
When you use geolocation routing, you can localize your web store and present some or all of your websites in the language of your users. You can also use geolocation routing to restrict access to the websites to only the locations you have distribution rights. Another use case is balancing load across endpoints.
Can you imagine your USA-based customers' frustration when your servers are located in Norway ð³ð´ or Australia ð¦ðº?
## Pre-requirements
- [Terraform 0.12 or newer](https://www.terraform.io/)
- [Terragrunt 0.19 or newer](http
没有合适的资源?快使用搜索试试~ 我知道了~
TerraformMagentoCloud:将AWS Magento 2云Terraform基础架构作为代码。 对于任何系统Wo...
共25个文件
hcl:16个
md:4个
png:3个
需积分: 9 1 下载量 34 浏览量
2021-05-14
08:26:02
上传
评论
收藏 967KB ZIP 举报
温馨提示
基础架构作为AWS上的电子商务云架构的代码(Multi Cloud AWS,GCP,Azure) 该存储库包含Magento 2 Cloud Terraform基础架构,作为AWS Public Cloud的代码。 该基础架构是多年在云中扩展Magento 1和2的经验的结果。 它附带了最佳的云开发实践,可节省您的时间和金钱。 与向昂贵的托管托管提供商(PaaS,SaaS)支付费用相比,利用自己的AWS账户可以显着减少每月支出。 该脚本不限于Magento部署,并且可以与任何eCommerce / Web平台一起使用,例如。 WordPress,WooCommerce,Drupal,Shopware 6,Shopify APP(客户私有APP云),VueStorefront,Silyus,Oddo,ORO等。它的名称包含Magento,因为它最初是为Magento设计的。 但是,有
资源推荐
资源详情
资源评论
收起资源包目录
TerraformMagentoCloud-master.zip (25个子文件)
TerraformMagentoCloud-master
small-big.png 365KB
Magento2Cloud-Flat.png 343KB
Magento2Cloud.png 243KB
deployment
README.md 25B
LICENSE.md 31KB
README.md 30KB
cloud
production
webnode-loadbalancer
terragrunt.hcl 1KB
varnishcacheproxynode-asg
terragrunt.hcl 2KB
terragrunt.hcl 1KB
mysql-rds-securitygroup
terragrunt.hcl 971B
adminwebnode-asg
terragrunt.hcl 2KB
ssh22-securitygroup
terragrunt.hcl 967B
loadbalancer-internet-securitygroup
terragrunt.hcl 983B
mysql
terragrunt.hcl 3KB
loadbalancer-internal-securitygroup
terragrunt.hcl 983B
webnode-asg
terragrunt.hcl 2KB
redis-securitygroup
terragrunt.hcl 967B
aws-data
terragrunt.hcl 146B
varnishnode-securitygroup
terragrunt.hcl 973B
magento-cloud
terragrunt.hcl 2KB
webnode-securitygroup
terragrunt.hcl 969B
varnish-loadbalanser
terragrunt.hcl 1KB
modules
aws-data
outputs.tf 759B
README.md 685B
main.tf 847B
共 25 条
- 1
资源评论
男爵兔
- 粉丝: 42
- 资源: 4591
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 高等数学第一章第二节数列的极限
- Python 版冒泡排序算法源代码
- tensorflow-gpu-2.7.2-cp38-cp38-manylinux2010-x86-64.whl
- tensorflow-2.7.3-cp39-cp39-manylinux2010-x86-64.whl
- tensorflow-2.7.2-cp39-cp39-manylinux2010-x86-64.whl
- Python版本快速排序源代码
- Python 语言版的快速排序算法实现
- 450815388207377安卓_base.apk
- 超微主板 X9DRE-TF+ bios 支持 nvme启动
- 基于Python通过下载气象数据和插值拟合离散数据曲线实现对寒潮过程的能量分析
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功