How To Deploy A LAMP Stack In AWS Using Terraform

How To Deploy A LAMP Stack In AWS Using Terraform

How to deploy a LAMP stack in AWS using terraform

Hello Everyone

Welcome to CloudAffaire and this is Debjeet.

In the last blog post, we have discussed terraform override.

https://cloudaffaire.com/terraform-override/

In this blog post, we will discuss how to deploy a LAMP stack in AWS using terraform.

What is a LAMP stack?

A LAMP stack is simply a web application created on Linux server using Apache, PHP and MySQL (L=Linux, A=Apache, M=MySQL, P=PHP). In this demo, we will use an EC2 Linux instance to create our frontend web application and will use AWS MySQL RDS as backend database.

How to deploy a LAMP stack in AWS using terraform:

Copy the db_server_address and web_server_address from the output.

How to deploy a LAMP stack in AWS using terraform

Connect to EC2 instance (web server)

Edit index.php in EC2 instance (web server)

How to deploy a LAMP stack in AWS using terraform

How to deploy a LAMP stack in AWS using terraform

Open web_server_address in the browser , hit refresh and check

How to deploy a LAMP stack in AWS using terraform

LAMP stack successfully deployed in AWS using terraform.

Note: You may need to restart your web server.

Hope you have enjoyed this article. In the next blog post, we will modularize our LAMP stack code.

To get more details on terraform, please refer below terraform documentation

https://www.terraform.io/docs/index.html

 

Leave a Reply

Close Menu