This project provides a simple way to deploy a WordPress server using Apache on AWS, orchestrated by Terraform.
- Terraform
- AWS CLI
- AWS Account
- Git
- Terraform is a tool for building, changing, and versioning infrastructure safely and efficiently. Terraform can manage existing and popular service providers as well as custom in-house solutions.
- AWS (Amazon Web Services) is a cloud services platform that provides compute power, database storage, content delivery, and other functionality to help businesses scale and grow.
- Git is a distributed version control system for tracking changes in source code during software development.
- Go to the Git download page.
- Download the software for your operating system.
- Run the installer and follow the prompts to install Git.
- Download Terraform from the official download page.
- Unzip the package and move the executable to a directory included in your system's
PATH
. - Verify the installation by running
terraform --version
in the terminal.
- Go to the AWS website and create a new account if you don't have one already.
- Log in to your AWS Account.
- Navigate to the IAM service in the AWS Management Console.
- Click on "Users" in the sidebar and then "Add user".
- Enter a username, select "Programmatic access" as the access type, and click "Next".
- In the permissions step, select "Attach existing policies directly" and in the filter policies box, type "AdministratorAccess" then check the box next to it.
- Review the user and permissions, then click "Create user".
- On the success page, save the "Access key ID" and "Secret access key". You will need these later.
- Download the AWS CLI from the official download page.
- Install it by following the instructions provided for your operating system.
- Once installed, open your terminal and type
aws configure
. - When prompted, enter the "Access key ID" and "Secret access key" that you saved earlier.
- Enter
us-west-2
for the Default region name. - Enter
json
for the Default output format.
- Open your terminal and navigate to the directory where you want to clone the repository.
- Run
git clone https://github.com/olufuwatayo/simple-wordpress-apache.git
. - Navigate into the cloned directory with
cd simple-wordpress-apache
. - Run
terraform init
to initialize Terraform.
- To create the resources defined in your Terraform files, run
terraform apply
. - Terraform will print the actions to be taken. Review them and enter
yes
when prompted.
After Terraform has finished creating the resources, you should be```markdown able to connect to your EC2 instance and view your WordPress installation.
- In the AWS Console, navigate to the EC2 Dashboard.
- Find your instance and copy its Public IPv4 address.
- In your web browser, navigate to
http://<your-ec2-public-ipv4-address>
. Replace<your-ec2-public-ipv4-address>
with the Public IPv4 address you just copied.
Congratulations, you should now see your WordPress installation!
If you encounter any problems, please review the steps to make sure everything was done correctly. If the problem persists, you may find help in the Terraform community【7†source】.