Site: https://wordpress-for-test.pp.ua
Not implemented:
Use of S3 for large objects;
CDN;
Real-life testing
For automation deploy you need:
- manual create all steps in "part #1"
- setup variables in /terraform/variables.tf
- Sign up for an AWS account if you don't have one.
- Create an S3 bucket to store your Terraform state.
- Consider using DynamoDB for state locking to prevent concurrent Terraform executions (this will be addressed later).
- Add AWS credentials to GitHub Secrets for secure access.
- Use the AWS Console to set up credentials for:
- Docker Hub
- Database and wp-admin (remember to configure usernames for the database and WordPress later).
-
Generate an SSH key for your EC2 instance.
-
(Note: Itβs recommended to use Terraform for this, but you can skip regeneration if you already have a key.)
-
By the whay: you will need this key for create DB on RDS-MySQL server...
- Run the following commands:
cd terraform terraform init terraform apply
- vpc..
- subnets..
- rds mysql
- elastice cache REDIS
- bastion host for create database and users for wordpress.. )
- other .... P.S. don't forgot to setup variables ))
- Objective: Build a Docker container with the WordPress source code.
- Action:
- Push the Docker container to Docker Hub.
- Benefits of using container:
- Isolation of the site.
- Facilitates future migrations.
- Source: Utilize
blank-wordpress-code
from a GitHub repository (unzip the archive from WordPress.org). - Note: WordPress requires database connections (MySQL and Redis) to function properly when deployed within AWS.
- Script Path:
/packer/scripts/install_wordpress.md
- Installation Tasks:
- Set up the database.
- Set up Redis.
- Set up HTTPS plugin (currently not functional; ongoing work).
- Set up S3 (to be addressed within 1-2 days).
Note: We can use the source code with installed plugins, but the functionality without prior setup is uncertain.
- Objective: Implement green/blue deployment strategy.
- Action: Switch running instances in the Auto Scaling Group (ASG) to ensure zero downtime during updates.