Skip to content

About

Terraform AWS multi-environment infrastructure with reusable modules

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Terraform AWS Multi-Environment Infrastructure with Modules

Overview

This repository demonstrates a production-style Infrastructure as Code (IaC) setup using Terraform on AWS.

The project shows how to build clean, reusable Terraform modules and compose multiple environments (dev and prod) without duplicating resources.


Architecture

The infrastructure is built using reusable Terraform modules:

VPC Module

  • VPC
  • Public subnets
  • Internet Gateway
  • Route tables

Security Group Module

  • Reusable security group
  • Configurable SSH access
  • VPC-based isolation

EC2 Module

  • EC2 instance provisioning
  • Environment-specific instance types
  • Subnet and security group injection

Each environment composes these modules and provides its own configuration values.


Project Structure

terraform-aws-multi-env/
├── README.md
├── modules/
│   ├── vpc/
│   ├── security-group/
│   └── ec2/
└── environments/
    ├── dev/
    └── prod/
  • modules/ contains reusable Terraform modules
  • environments/dev defines the development environment
  • environments/prod defines the production environment

No AWS resources are created directly inside environment folders.
All infrastructure resources are defined inside modules
and composed at the environment level.


Environments

Dev

  • Used for development and testing
  • Smaller EC2 instance types
  • More permissive SSH access

Prod

  • Production-ready configuration
  • Larger EC2 instance types
  • Restricted SSH access

Both environments reuse the same Terraform modules.


Key Concepts Demonstrated

  • Infrastructure as Code (IaC)
  • Terraform modules
  • Multi-environment architecture (dev / prod)
  • Clean dependency management using outputs and inputs
  • Reusable and scalable Terraform design
  • AWS infrastructure provisioning

About

Terraform AWS multi-environment infrastructure with reusable modules

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages