GithubHelp home page GithubHelp logo

hadii-tech / production-ready-prestashop Goto Github PK

View Code? Open in Web Editor NEW
15.0 4.0 8.0 303 KB

Deploy a Scalable, highly available, and performant Prestashop solution on AWS using CloudFormation

License: MIT License

prestashop cloudformation taskcat aws iac ecommerce

production-ready-prestashop's Introduction

production-ready-prestashop

maintained-by License: MIT PRs Welcome

This repository deploys a Scalable, highly available, and performant Prestashop solution in the AWS cloud using CloudFormation. Launch the entire stack in your AWS region of choice using one of the options below:

Region Launch
us-east-1 launch-stack
us-west-1 launch-stack
ap-south-1 launch-stack
ap-east-1 launch-stack
ca-central-1 launch-stack
eu-central-1 launch-stack
eu-west-1 launch-stack
eu-north-1 launch-stack

Want to launch this stack in a region that's not listed? Navigate to https://console.aws.amazon.com/cloudformation/home?region=YOUR_REGION#/stacks/new?stackName=prestashop-stack&templateURL=https://production-ready-prestashop.s3.ca-central-1.amazonaws.com/versions/latest/production_ready_prestashop.yaml

Design

Read more about the high level design of the system here. Scalable Prestashop Architecture Diagram

Getting Started

The entire solution is represented using multiple CloudFormation stacks:

  • production_ready_prestashop.yaml: The parent CloudFormation stack that deploys all the major infrastructure components below that comprise the entire solutions as nested CloudFormation stacks.
  • private-vpc.yaml: Deploys containerized applications onto a cluster of EC2 hosts using Elastic Container Service. This stack runs containers on hosts that are in a private VPC subnet. Outbound network traffic from the hosts must go out through a NAT gateway.
  • efs-service.yaml: Deploys an EFS file system with the appropriate folder mounts required for Prestashop ECS Containers.
  • rds-service.yaml: Deploys an RDS MariaDB instance that Prestashop will use. Multi-AZ is disabled by default.
  • ec2-service.yaml: Deploys an EC2 AutoScaling Groups, Public Load balancer, and Security Groups required for the entire deployment.
  • ecs-service.yaml: Deploys an elastic container service that will run Prestashop containers on registered instances in our cluster.
  • service-autoscaling.yaml: A stack for configuring autoscaling between the EC2 ASG and ECS Service using CloudWatch alarms.

Development Environment

  1. Setup an AWS account.
  2. Install taskcat
  3. Install the AWS cli tool

Local Testing

  1. Push your templates to an S3 bucket: aws s3 sync --acl public-read templates/ s3://your-bucket
  2. Update the NestedStacksS3URL param in taskcat's config file (.taskcat.yml) to point to the S3 URL containing your template files (example)
  3. Run taskcat -d test run

Contribute

Refer to .github/workflows/ci-cd.yml to get an idea of what the CI pipeline does to test pull requests. Fork this repository, open a pull request, ensure all checks pass, ensure taskcat is not throwing any lint warnings, and request a review.

Important Implementation Notes

  • The ECS cloudformation template launches containers with an environment variable PS_ERASE_DB set to 1. This will erase the prestashop database every time a new container is started. This is required to setup the database the first time. Once this is done, run aws cloudformation update-stack with a value of 0.
  • The RDS cloudformation template does not enable multi-AZ by default. This can easily be modified by setting Properties.MultiAZ to true for the AWS::RDS::DBInstance resource in this stack.

Contributors

production-ready-prestashop's People

Contributors

zir0-93 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

production-ready-prestashop's Issues

Improvement in your stack

Hi,

First of all I would like to say "Good job". I was creating a Stack for Prestashop and when I saw your repo, I picked up. It is a really good stack.

I have made some changes because I need multiAZ RDS database and the default timeout you stablished are 15 minutes, and to create a multiAZ database, it takes more than 15 minutes. I use it in eu-central-1 region, and it took 19 minutes to create a MultiAZ Database.

On ther other hand, I think you should add two extra features:

  • A Bastion Host. Sometimes we need to get access to the database. The securest way is by a Bastion Host creating a SSH Tunnel between the RDS server and internet.
  • HTTPS in Load Balancer. In production mode, we need this features and now we have to create it manually, it would be a good idea to create this from Cloudformation Stack.

Regards.

Create build pipeline to develop a single, merged version of existing CloudFormation templates

The existing solution currently consists of multiple Cloudformation templates.

Ideally we want to build a pipeline that merges all the templates into a single one and stores it on s3. This way, we can use the built template to maintain a Launch Stack button for people to quickly launch the entire stack from the AWS console.

There are a number of existing tools that need to be investigated that can merge cloudformation templates into one.

S3 credentials can be provided and would be stored securely on the build tool used (travis, jenkins, etc..).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.