Terraform code which will deploy the WordPress on the Minikube and AWS RDS for Database

Image for post
Image for post

Task Description:-

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:-

Image for post
Image for post

then we run the “ start minikube ” command:-

Image for post
Image for post

These are the file which I used to create this task:-

Image for post
Image for post

Now, At very first we need to run the “ terraform init ” command as also shown below:-

Image for post
Image for post

Then run the “ terraform validate ” command:-

Image for post
Image for post

After that, we run the “ terraform plan ” command:-

Image for post
Image for post
Image for post
Image for post

Now, At last, We run the terraform apply — auto-apply” command, and then the whole infrastructure has been created on AWS as given below:-

Image for post
Image for post

Successfully created all the infrastructure, and here we also get IP as well as Database Host detail:-

Image for post
Image for post

Now we can confirm these things from the AWS website as well.
As we can see these RDS Databases which shows below:-

Image for post
Image for post
Image for post
Image for post
Image for post
Image for post

Finally, Here Is Our WordPress Application Launched on Minikube and having backend connectivity means database from Amazon RDS:-

Image for post
Image for post
Image for post
Image for post
Image for post
Image for post

Here we can destroy the whole infrastructure on AWS by running the command “ terraform destroy — auto-apply” as given below:-

Image for post
Image for post
Image for post
Image for post

**************** T h a n k _ Y o u **************

Written by

Ansible / Flutter / Hybrid Multi-Cloud / GCP / EKS / Kubernetes / DevOps / MlOps / Docker Expertise / RHCSA / Advance JAVA / Python Learner / Arth Learner

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store