Terraform code which will deploy the WordPress on the Minikube and AWS RDS for Database
I have created Infrastructure as code using Terraform, which automatically deploy the WordPress applicationOn AWS, use RDS service for the relational database for WordPress application.
Deploy WordPress as a container either on top of Minikube or EKS or Fargate service on AWS.
The WordPress application should be accessible from the public world if deployed on AWS or through workstation if deployed on Minikube.
Let’s start with the explanation of the task:-
Firstly, we need to configure our AWS profile as shown below:-
then we run the “ start minikube ” command:-
These are the file which I used to create this task:-
Now, At very first we need to run the “ terraform init ” command as also shown below:-
Then run the “ terraform validate ” command:-
After that, we run the “ terraform plan ” command:-
Now, At last, We run the “ terraform apply — auto-apply” command, and then the whole infrastructure has been created on AWS as given below:-
Successfully created all the infrastructure, and here we also get IP as well as Database Host detail:-
Now we can confirm these things from the AWS website as well.
As we can see these RDS Databases which shows below:-
Finally, Here Is Our WordPress Application Launched on Minikube and having backend connectivity means database from Amazon RDS:-
Here we can destroy the whole infrastructure on AWS by running the command “ terraform destroy — auto-apply” as given below:-