Sudo Consultants Serverless WordPress on the AWS Cloud

Quick Start Reference Deployment

QS

February 2022
Saif Ali and Hameedullah Khan, Sudo Consultants
Sriram Mohan, AWS Managed Cloud
Dattaprasad Sadwelkar and Vinod Shukla, AWS Integration & Automation team

Visit our GitHub repository to view source files, report bugs, submit feature ideas, or post other feedback on this Quick Start. To comment on the documentation, see Feedback on this guide.

This Quick Start was created by Sudo Consultants Limited in collaboration with Amazon Web Services (AWS). Quick Starts are automated reference deployments that use AWS CloudFormation templates to deploy key technologies on AWS, following AWS best practices.

Overview

This Quick Start deploys Sudo Consultants Serverless WordPress in the Amazon Web Services (AWS) Cloud. It is for organizations that want to deploy highly available and scalable WordPress sites without managing servers.

This Quick Start uses Amazon Elastic Container Service (Amazon ECS) to build containers with the official WordPress Docker image. AWS Fargate runs, scales, and manages the containerized WordPress workload and an Amazon Aurora serverless database. A container-mounted Amazon Elastic File System (Amazon EFS) helps your WordPress sites scale automatically, saving you money during quiet hours and ensuring high availability during peak request times. In addition, you get AWS managed security against SQL injection and common WordPress exploits, helping keep your sites safe.

If you are unfamiliar with AWS Quick Starts we recommend that you read the AWS Quick Start General Content Guide.

Sudo Consultants Serverless WordPress includes these security features:

  • AWS WAF to prevent SQL injection and common WordPress exploits.

  • Port-hardened security groups and unnecessary ports closed by default. For more information, see Hardening WordPress.

  • Periodic database backups.

  • A virtual private cloud (VPC) configured with public and private subnets, according to AWS best practices, to provide you with your own virtual network on AWS.

Costs and licenses

There are no additional licenses required to use this Quick Start. There is no cost to use this Quick Start; however, you will be billed for the resources deployed. For more information see the AWS Quick Start General Content Guide.

Architecture

Deploying this Quick Start for a new virtual private cloud (VPC) with default parameters builds the following Serverless WordPress environment in the AWS Cloud.

Architecture
Figure 1. Quick Start architecture for Serverless WordPress on AWS

As shown in Figure 1, the Quick Start sets up the following:

  • A highly available architecture that spans two Availability Zones.*

  • A VPC configured with public and private subnets according to AWS best practices, to provide you with your own virtual network on AWS.*

  • (Optional) An Amazon Route 53 record entry if you enter a hosted zone ID during Quick Start deployment.

  • AWS WAF for managing rules to protect against SQL injection attacks and common WordPress exploits.

  • In the public subnets:

    • Elastic IP addresses for outbound traffic for AWS Fargate tasks.*

    • Managed network address translation (NAT) gateways to allow outbound internet access for resources in the private subnets.*

  • In the private subnets:

    • AWS Fargate tasks in an Auto Scaling group to launch and manage WordPress containers.

  • An Application Load Balancer to manage traffic to AWS Fargate in the private subnets.

  • Amazon ECS to deploy the WordPress container image to AWS Fargate.

  • (Optional) AWS Certificate Manager (ACM) for a public certificate for HTTPS connection.

  • AWS Secrets Manager to store the RDS Aurora database password.

  • Amazon Aurora serverless database connected to containers on AWS Fargate.

  • An Amazon Elastic File System (Amazon EFS) file system for storing WordPress files, themes, and plugins.

* The template that deploys the Quick Start into an existing VPC skips the components marked by asterisks and prompts you for your existing VPC configuration.

Deployment options

This Quick Start provides two deployment options:

The Quick Start provides separate templates for these options. It also lets you configure Classless Inter-Domain Routing (CIDR) blocks, instance types, and Serverless WordPress settings.

Predeployment steps

  1. If you don’t have an account, sign up at https://aws.amazon.com.

  2. Choose the Region from the top toolbar where you want to deploy.

  3. To create a Route 53 DNS entry, set up a Route 53 hosted zone, then enter the hosted zone ID during deployment. For more information, see Working with hosted zones.

Important: This Quick Start includes Amazon EFS and Amazon Aurora Serverless, which are not available in all AWS Regions. For a list of supported Amazon EFS Regions, see Amazon Elastic File System endpoints and quotas. For a list of supported Aurora Serverless Regions, see Aurora Serverless v1.

Deployment steps

After clicking the Deploy link on the Quick Start landing page, you will be brought to the CloudFormation console, with the template URL pre-populated. Ensure you are in the correct Region and click Next to enter parameter values.

Unless you are customizing the Quick Start templates for your own deployment projects, keep the default settings for the parameters Quick Start S3 bucket name, Quick Start S3 bucket Region, and Quick Start S3 key prefix. Changing these settings automatically updates code references to point to a new Quick Start location. For more information, see the AWS Quick Start Contributor’s Guide.
  1. On the Configure stack options page, you can specify tags (key-value pairs) for resources in your stack and set advanced options. When you finish, choose Next.

  2. On the Review page, review and confirm the template settings. Under Capabilities, select the two check boxes to acknowledge that the template creates IAM resources and might require the ability to automatically expand macros.

  3. Choose Create stack to deploy the stack.

  4. Monitor the status of the stack. When the status is CREATE_COMPLETE, the Sudo Consultants Serverless WordPress deployment is ready.

  5. To view the created resources, see the values displayed in the Outputs tab for the stack.

Troubleshooting

For troubleshooting common Quick Start issues visit the AWS Quick Start General Content Guide and Troubleshooting CloudFormation.

After you successfully deploy a Quick Start, confirm that your resources and services are updated and configured — including any required patches — to meet your security and other needs. For more information, see the AWS Shared Responsibility Model.

Feedback on this guide

To comment on this guide, open a GitHub issue as follows:

Notices

This document is provided for informational purposes only. It represents AWS’s current product offerings and practices as of the date of issue of this document, which are subject to change without notice. Customers are responsible for making their own independent assessment of the information in this document and any use of AWS’s products or services, each of which is provided “as is” without warranty of any kind, whether expressed or implied. This document does not create any warranties, representations, contractual commitments, conditions, or assurances from AWS, its affiliates, suppliers, or licensors. The responsibilities and liabilities of AWS to its customers are controlled by AWS agreements, and this document is not part of, nor does it modify, any agreement between AWS and its customers.

The software included with this paper is licensed under the Apache License, version 2.0 (the "License"). You may not use this file except in compliance with the License. A copy of the License is located at http://aws.amazon.com/apache2.0/ or in the accompanying "license" file. This code is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either expressed or implied. See the License for specific language governing permissions and limitations.