Deploy the WordPress application on Kubernetes and AWS using Terraform

AWS-RDS | Minikube | Terraform | WordPress

Let’s start by knowing what will we be doing?

Deploying a WordPress website on local Kubernetes using Minikube and storing the data of WordPress inside Amazon RDS (Amazon Relational Database Service) by using Terraform as Infrastructure-as-a-Code.

Steps to perform the above task:

Let us start by setting up our environment:

aws configure --profile  myprofile
aws configure — profile myprofile
provider.tf

Our next step will be to create the RDS:

rds.tf

Now we will create WordPress pod on local Kubernetes using Minikube:

wordpress.tf
wordpress.tf

Working -

Step 1 :

minikube start
kubectl get all
Checking if any pods are running initially

Step 2:

terraform init
terraform init
terraform apply --auto-approve
terraform apply — auto-approve

Output:

wordpress-db
kubectl get all
kubectl get all

The Wordpress setup:

The Wordpress dashboard is ready for us:

WordPress Dashboard

The proof that WordPress is connected to the RDS:

The proof that WordPress is connected to the RDS
terraform destroy --auto-approve
terraform destroy — auto-approve

I am a DevOps Enthusiast and recently taken to Cloud Computing. Learning Flutter App Development currently. In my free time I engage in competitive coding.