Terraform AWS Infrastructure V1

Production-Style AWS Infrastructure Automation

Cloud InfraMay 2026View Source Code
Terraform AWS Infrastructure V1

Overview

This project provisions a complete AWS infrastructure environment using Terraform while following Infrastructure as Code principles. The setup includes VPC networking, EC2 deployment, IAM roles, security groups, Docker installation, and automated Nginx provisioning using user data scripts.

The goal of this project is to build a strong DevOps foundation by understanding real cloud provisioning workflows and infrastructure automation on AWS.

Architecture

Internet
   ↓
Internet Gateway
   ↓
Public Subnet
   ↓
EC2 Instance
   ├─ IAM Role
   ├─ Security Group
   └─ Docker + Nginx

Features

  • Production-style AWS provisioning

  • Public subnet infrastructure

  • EC2 deployment automation

  • IAM role integration

  • Security group management

  • Docker auto-installation

  • Nginx container deployment

  • Infrastructure as Code workflow

  • Terraform automation fundamentals

Tech Stack

  • Terraform

  • Amazon Web Services

  • Amazon EC2

  • Amazon VPC

  • Docker

  • Nginx

Quick Start

Clone Repository

git clone https://github.com/yourusername/terraform-aws-infra-v1.git

cd terraform-aws-infrastructure-v1

Configure AWS Credentials

aws configure

Initialize Terraform

terraform init

Validate Infrastructure

terraform validate

Plan Deployment

terraform plan

Deploy Infrastructure

terraform apply

Setup Script

./scripts/setup.sh

This automatically:

  • Initializes Terraform

  • Validates configuration

  • Generates execution plan

  • Applies infrastructure


Access Server

terraform output connection_command

SSH into instance:

ssh ubuntu@<PUBLIC_IP>

Verify Nginx

terraform output instance_public_ip

Open in browser:

http://<PUBLIC_IP>

Destroy Infrastructure

terraform destroy

Or:

./scripts/destroy.sh

Outputs

After deployment:

vpc_id
instance_public_ip
instance_private_ip
security_group_id
connection_command

Security Features

  • IAM role integration

  • Security group isolation

  • HTTP and SSH access control

  • Least privilege AWS permissions

  • Infrastructure reproducibility

Result

  • Automated AWS infrastructure provisioning

  • Dockerized Nginx deployment

  • Public cloud networking setup

  • Infrastructure managed entirely through code

  • Repeatable deployment workflow

Key DevOps Concepts

  • Infrastructure as Code

  • AWS automation

  • Cloud networking

  • Linux server provisioning

  • Docker deployment

  • Terraform workflows

  • Infrastructure reproducibility

Final Note

This project demonstrates how modern cloud infrastructure can be provisioned and automated using Terraform on AWS.

Instead of manually configuring infrastructure, the entire environment is deployed using Infrastructure as Code, making the system scalable, repeatable, and production-ready.

More Projects

Explore other projects from my portfolio