Deploy the WordPress application on Kubernetes and AWS using terraform

Statement of the task: Deploy the WordPress application on Kubernetes and AWS using terraform

Steps to perform task:

1. Write an Infrastructure as code using Terraform, which automatically deploy the WordPress application

2. On AWS, use RDS service for the relational database for WordPress application.

3. Deploy the WordPress as a container either on top of Minikube or EKS or Fargate service on AWS

4. The WordPress application should be accessible from the public world if deployed on AWS or through workstation if deployed on Minikube.

Tools and modules required to perform this task:




4. Minikube

Steps to perform:

Step 1: Create New Folder for this Task.( In cli.)

Step 2: Creating you First terraform <File_name>.tf

Step 3: Inside Create your code.

  1. Create a provider.

2. Create resource.

3. Create specification and templates.

4. Create WordPress with port 80.

This is the last snippet here creation of terraform file is complete. Combine all these snippets to form .

Step 4: Start Kubernetes services by starting minikibe:

Step 5: Run following command to run terraform file. (This is for initializing terraform).

Output of the above command is:

Step 6: Command to run and apply terraform code.

Command to check about the creation of PODs

Step 7: Create Another Terraform file for Database.

  1. Command to create terraform file.

2. Terraform code for database.

Step 8: Command to get IP for WordPress.

Output of these command give you an IP, enter that IP to web browser and it will open WordPress.

Welcome page of WordPress will be open like this.

thank you