Welcome to the project repository for Secure AWS infrastructure project. This repository contains the Terraform code for creating a secure AWS infrastructure using AWS services such as VPC, EC2, Target Group, Application Load Balancer (ALB), and Auto Scaling Group (ASG). This infrastructure is designed to provide a reliable and scalable environment for hosting applications.
- Description
- How to Use
- Prerequisites
- Installation
- Configuration
- Deployment
- Contributing
The goal of this project is to provide a secure and scalable AWS infrastructure using Terraform. The infrastructure consists of the following components:
-
VPC: A Virtual Private Cloud (VPC) is created to isolate the resources within a private network. It provides control over network configuration, IP address ranges, and subnets.
-
EC2: Amazon Elastic Compute Cloud (EC2) instances are launched within the VPC. These instances serve as the computing resources for hosting applications.
-
Target Group: A Target Group is created to define a set of EC2 instances that can receive traffic from an ALB.
-
ALB: An Application Load Balancer (ALB) is created to distribute incoming traffic across multiple EC2 instances. It improves availability and scalability of the application.
-
ASG: An Auto Scaling Group (ASG) is created to automatically adjust the number of EC2 instances based on the application load. It ensures that the desired capacity is maintained even if instances fail.
This project follows best practices for security and reliability, incorporating features such as private subnets, security groups, and automated scaling.
Follow the steps below to use this project:
- Terraform installed on your local machine.
- AWS account credentials with appropriate permissions to create resources.
-
Clone this repository to your local machine using the following command:
git clone https://github.com/Aahil13/Secure-AWS-Infrastructure.git
-
Change into the project directory:
cd Secure AWS Infrastructure
-
Use the variables.tf file to provide values for the variables used in the Terraform code. You can use the provided
variables.tf.example
file as a template:cp variables.tf.example variables.tf
Modify the values in variables.tfvars to match your requirements.
-
Review and modify the Terraform code as needed, such as adjusting resource configurations, adding or removing resources, etc.
-
Initialize the Terraform project:
terraform init
-
Validate the Terraform code:
terraform validate
Ensure that there are no errors in the code.
-
Plan the infrastructure changes to be applied:
terraform plan
Review the planned changes to ensure they align with your expectations.
-
Apply the infrastructure changes:
terraform apply
Confirm the changes by typing yes when prompted.
Terraform will create the AWS resources based on the provided configuration. The output will show the created resources.
Contributions to this project are welcome! If you find any issues or would like to suggest improvements, please open an issue or submit a pull request.