This repository contains Terraform code to set up AWS infrastructure for a web application, including a VPC, subnet, internet gateway, route table, security group, and an EC2 instance running a web server.
Before you begin, ensure you have the following installed:
- Terraform
- An AWS account
- AWS CLI configured with appropriate permissions
git clone https://github.com/prasanth624/terraform-aws-web-app.git
cd terraform-aws-web-app
Run the following command to initialize the Terraform configuration:
terraform init
To see what Terraform will create, run:
terraform plan
To create the infrastructure, run:
terraform apply
You will be prompted to confirm the action. Type yes
to proceed.
After the infrastructure is created, you can see the outputs by running:
terraform output
To remove all resources created by Terraform, run:
terraform destroy
You will be prompted to confirm the destruction. Type yes
to proceed.
Feel free to fork the repository and submit pull requests for any improvements or features you'd like to add!
This project is licensed under the MIT License. See the LICENSE file for more details.