This project contains a set of AWS CloudFormation templates designed to deploy a highly available and scalable WordPress environment on AWS. The architecture is designed to provide a robust foundation for WordPress installations, using AWS best practices for security and efficiency.
-
wordpress-aws-vpc.yaml: Sets up the necessary network infrastructure for WordPress installations. This includes a VPC, Internet and NAT Gateways, ACLs, and more. It can support a group of different WordPress websites or separate network infrastructures for each setup if necessary.
-
wordpress-aws-ssl-certificate.yaml: Handles the request and issuance of SSL certificates for each WordPress installation. Certificates must be requested and issued before initiating WordPress installation.
-
wordpress-aws-ecs-fargate.yaml: Creates a complete high-availability and auto-scalable infrastructure with WordPress. This template provisions AWS services including CloudFront as a CDN solution, ECS Fargate for cost efficiency and scalability, EFS for file storage, etc. You can use any available WordPress Docker images or create your own.
Here is a visual representation of the solution architecture:
-
Network Infrastructure:
- Deploy the
wordpress-aws-vpc.yaml
template to set up the network infrastructure. - Parameters: Provide any necessary parameters as per your requirements.
- Deploy the
-
SSL Certificate:
- Deploy the
wordpress-aws-ssl-certificate.yaml
template to request SSL certificates. - Ensure the domain names are correctly set, and validate the certificates once issued.
- Deploy the
-
WordPress on ECS Fargate:
- Deploy the
wordpress-aws-ecs-fargate.yaml
template to create the WordPress infrastructure. - Configure parameters like image names, instance sizes, and scaling policies as needed.
- Deploy the
- DNS Configuration: Update your DNS records to point to the CloudFront distribution and ensure SSL/TLS works as expected.
- WordPress Configuration: Access your WordPress site to complete the installation and setup.
- Monitoring & Management: Set up CloudWatch alarms and monitoring based on your operational needs.
This guide provides an overview of AWS Cost Allocation Tags and instructions on how to implement and use them to track your AWS infrastructure costs.
AWS Cost Allocation Tags are key-value pairs that you can attach to AWS resources. They enable you to organize and track your AWS costs. When you activate these tags, AWS uses them to categorize costs on your cost allocation report, making it easier to see the cost distribution across different projects, departments, or environments.
AWS CloudFormation templates automatically add TAG project with appropriate value from CloudFormation template parameter WordpressName - a unique string to identify each Wordpress installation.
- Go to the AWS Management Console.
- Open the 'Billing & Cost Management Dashboard'.
- Navigate to 'Cost Allocation Tags'.
- Under 'User-Defined Cost Allocation Tags', find the project tag.
- Select the project tag and click 'Activate'.
- In the Billing Dashboard, go to 'Cost Explorer'.
- Click on 'Create a new report'.
- Choose the type of report (e.g., 'Costs and usage').
- Under 'Group by', select 'Tag' and choose the project tag.
- Configure other report settings as needed.
- Save and view the report.
- In the AWS Management Console, go to the Billing Dashboard.
- Click on 'Cost Explorer'.
- Use the filters to narrow down by specific tags, services, or time range.
- Analyze the cost associated with different projects.
- Ensure AWS CLI is installed and configured with the necessary permissions.
- Run the following command:
aws ce get-cost-and-usage --time-period Start=YYYY-MM-DD,End=YYYY-MM-DD --granularity MONTHLY --filter "{\"Tags\":{\"Key\":\"project\",\"Values\":[\"<your_project_name>\"]}}" --metrics "UnblendedCost"
- Replace YYYY-MM-DD with the start and end dates, and <your_project_name> with your project's name.