Skip to content

vishalk17/terraform-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Terraform Infrastructure Setup

This project aims to automate the creation and management of AWS infrastructure using Terraform.

🔹 In this project, I used various Terraform features such as:

  • Conditional expression , Variables , Built-in functions , Remote backend , Dynamic blocks, Provisioners , depends_on, datasource

The setup includes creating a Virtual Private Cloud (VPC), subnets, route tables, security groups, EC2 instances, deploy web app, a target group, and an application load balancer.

It also configures a remote backend for storing Terraform state files using S3 and DynamoDB.

Final Result

Infrastructure Overview

Prerequisites

Ensure that you have AWS CLI and Terraform installed on your system.

1. Configure AWS Credentials

Before setting up the remote backend or infrastructure, configure your AWS CLI with appropriate access keys. Run the following command and provide the required information:

aws configure

2. Setup S3 and DynamoDB for Remote Backend

Navigate to the setup_s3_dynamodb_backend directory and initialize and apply the Terraform configuration to create the S3 bucket and DynamoDB table for remote backend state management.

cd setup_s3_dynamodb_backend
terraform init
terraform apply

Result

  • S3 Bucket Created:

    S3 Bucket Creation

  • DynamoDB Table Created:

    DynamoDB Table Creation

3. Setup SSH Keys for Instances

Ensure you have SSH keys set up to access your EC2 instances.

Navigate to setup_Infra/keys/Readme.md for detailed instructions on how to generate SSH keys for your instances.

4. Setup Infrastructure

Navigate to the setup_Infra directory and initialize and apply the Terraform configuration to set up the AWS infrastructure, including VPC, subnets, route tables, security groups, instances, target groups, and an application load balancer.

cd setup_Infra
terraform init
terraform apply -var-file=prod.tfvars

Result

  • State File in S3 Bucket (Remote Backend):

    State File in S3 Bucket

  • VPC:

    VPC

  • Subnets:

    Subnets

  • Routing Tables:

    Routing Tables

  • Security Group:

    Security Group

  • Instances:

    Instances

  • Target Group:

    Target Group

  • Application Load Balancer:

    Application Load Balancer

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published