How salauddin85/terrform-basic-to-advance-learning-roadmap-with-assignment works
This repository is a Terraform training workspace organized as a progression from simple single-stack infrastructure to modular, multi-environment platform provisioning.
1. Repository intent
The top-level README frames the repo as a learning roadmap for AWS + Terraform, moving through basic, intermediate, and advanced infrastructure patterns. The main architectural theme is increasing separation of concerns: from one Terraform root, to reusable modules, to environment orchestration with Terragrunt and CI.
2. Basic phase: single-root Terraform stack
terraform-all-projects/terraform-projects/project-01-static-website is the simplest boundary: one Terraform configuration with main.tf, variables.tf, outputs.tf, and terraform.tfvars. This looks like a self-contained deployment for a static website, with no module layering.
3. Intermediate phase: reusable module-based infrastructure
project-02-web-app-infra introduces a more realistic Terraform architecture:
- bootstrap/ for initial setup
- environments/dev/ as the environment-specific root
- modules/ for reusable components
This project demonstrates the common pattern of separating environment wiring from infrastructure implementation.
4. Intermediate module boundaries
The intermediate modules are split by responsibility:
- vpc for network foundation
- security for security groups or access controls
- ec2 for compute
- alb for traffic distribution
- rds for managed database
The likely data flow is foundational network outputs feeding security and compute, then compute being attached behind the load balancer, with database connectivity handled through private networking and security rules.
5. Intermediate environment isolation
The environments/dev root is where module instances are composed together. This suggests a pattern where environment-specific values are passed in through terraform.tfvars and variables, while module internals stay reusable across future environments.
6. Advanced phase: Terragrunt-based platform composition
project-03-enterprise-platform moves from plain Terraform roots to Terragrunt orchestration. The architecture is split into:
- shared root configuration at terragrunt.hcl
- environment-level config under environments/dev and environments/prod
- one Terragrunt unit per component (vpc, alb, ecs, etc.)
This creates a clear boundary between module code and deployment composition.
7. Advanced environment structure
The environments/dev and environments/prod trees show a multi-environment deployment model. Each environment has its own env.hcl, and each service/component has its own terragrunt.hcl, which implies independently managed stacks with shared conventions and environment-specific inputs.
8. Advanced platform modules
The advanced modules reflect a full application platform:
- vpc for networking
- alb for ingress/load balancing
- ecs for container compute
- aurora for managed relational database
- elasticache for caching
- kms for encryption key management
- waf for edge/application protection
- monitoring for observability
This is a layered platform architecture where shared infrastructure is provisioned once and application-facing services depend on it.
9. Security and governance boundaries
Security is treated as a first-class subsystem in the advanced project through kms and waf, and implicitly through network segmentation in vpc. This suggests the repo models not just functional provisioning, but also encryption, perimeter protection, and environment separation.
10. Automation and quality gates
The advanced project includes .github/workflows/terraform-ci.yml and drift-detection.yml, indicating automated validation and ongoing state drift monitoring. That means the operational boundary extends beyond Terraform code into CI/CD and infrastructure governance.
11. Testing layer
tests/kms_test.tftest.hcl and tests/vpc_test.tftest.hcl show Terraform-native tests for module behavior. These tests sit between module implementation and environment composition, validating core assumptions about key infrastructure primitives.
12. Architecture diagram takeaway
If you diagram this repo, model it as three maturity stages:
- a single-stack deployment
- a module-composed environment
- a Terragrunt-orchestrated multi-environment platform
The key flows are: shared foundational infrastructure first, then dependent application services, then automation around validation, CI, and drift detection.
Main entry points: env.hcl Dev env · dev/main.tf Dev env · vpc/main.tf VPC · terragrunt.hcl Terragrunt root
Components 30
Basic stack
Single-root Terraform deployment for one standalone project.
- Static website · Single self-contained Terraform stack for a static website.
terraform-all-projects/terraform-projects/project-01-static-website/main.tf - Inputs & state · Variables, tfvars, and outputs for the basic stack.
terraform-all-projects/terraform-projects/project-01-static-website/variables.tf
Module-based env
Terraform roots composed from reusable modules per environment.
- Bootstrap · Initial setup root for the intermediate web app infrastructure.
terraform-all-projects/terraform-projects/project-02-web-app-infra/bootstrap/main.tf - Dev env · Environment-specific root composing reusable infrastructure modules.
terraform-all-projects/terraform-projects/project-02-web-app-infra/environments/dev/main.tf - VPC · Network foundation for the web app stack.
terraform-all-projects/terraform-projects/project-02-web-app-infra/modules/vpc/main.tf - Security · Access control and security group boundaries.
terraform-all-projects/terraform-projects/project-02-web-app-infra/modules/security/main.tf - EC2 · Compute layer for application workloads.
terraform-all-projects/terraform-projects/project-02-web-app-infra/modules/ec2/main.tf - ALB · Load balancing and traffic entry for the app.
terraform-all-projects/terraform-projects/project-02-web-app-infra/modules/alb/main.tf - RDS · Managed relational database component.
terraform-all-projects/terraform-projects/project-02-web-app-infra/modules/rds/main.tf
Terragrunt platform
Multi-environment platform orchestration with shared modules, CI, and tests.
- Terragrunt root · Shared Terragrunt configuration for the enterprise platform.
terraform-all-projects/terraform-projects/project-03-enterprise-platform/terragrunt.hcl - Dev env · Dev environment configuration and composition layer.
terraform-all-projects/terraform-projects/project-03-enterprise-platform/environments/dev/env.hcl - Prod env · Prod environment configuration and composition layer.
terraform-all-projects/terraform-projects/project-03-enterprise-platform/environments/prod/env.hcl - VPC unit · Terragrunt-managed networking unit.
terraform-all-projects/terraform-projects/project-03-enterprise-platform/environments/dev/vpc/terragrunt.hcl - ALB unit · Terragrunt-managed ingress and load balancing unit.
terraform-all-projects/terraform-projects/project-03-enterprise-platform/environments/dev/alb/terragrunt.hcl - ECS unit · Terragrunt-managed container compute unit.
terraform-all-projects/terraform-projects/project-03-enterprise-platform/environments/dev/ecs/terragrunt.hcl - Aurora unit · Terragrunt-managed managed database unit.
terraform-all-projects/terraform-projects/project-03-enterprise-platform/environments/dev/aurora/terragrunt.hcl - Cache unit · Terragrunt-managed caching unit.
terraform-all-projects/terraform-projects/project-03-enterprise-platform/environments/dev/elasticache/terragrunt.hcl - KMS unit · Terragrunt-managed encryption key unit.
terraform-all-projects/terraform-projects/project-03-enterprise-platform/environments/dev/kms/terragrunt.hcl - WAF unit · Terragrunt-managed perimeter protection unit.
terraform-all-projects/terraform-projects/project-03-enterprise-platform/environments/dev/waf/terragrunt.hcl - Monitoring · Observability and monitoring subsystem for the platform.
terraform-all-projects/terraform-projects/project-03-enterprise-platform/modules/monitoring/main.tf - VPC · Shared networking foundation for the enterprise platform.
terraform-all-projects/terraform-projects/project-03-enterprise-platform/modules/vpc/main.tf - ALB · Shared ingress and routing layer.
terraform-all-projects/terraform-projects/project-03-enterprise-platform/modules/alb/main.tf - ECS · Container orchestration and service runtime.
terraform-all-projects/terraform-projects/project-03-enterprise-platform/modules/ecs/main.tf - Aurora · Managed relational database layer.
terraform-all-projects/terraform-projects/project-03-enterprise-platform/modules/aurora/main.tf - Cache · Managed in-memory cache layer.
terraform-all-projects/terraform-projects/project-03-enterprise-platform/modules/elasticache/main.tf - KMS · Encryption key management subsystem.
terraform-all-projects/terraform-projects/project-03-enterprise-platform/modules/kms/main.tf - WAF · Application edge protection subsystem.
terraform-all-projects/terraform-projects/project-03-enterprise-platform/modules/waf/main.tf - Terraform tests · Native tests for key platform modules.
terraform-all-projects/terraform-projects/project-03-enterprise-platform/tests/vpc_test.tftest.hcl - GitHub Actions · Terraform validation and drift-detection workflows.
terraform-all-projects/terraform-projects/project-03-enterprise-platform/.github/workflows/terraform-ci.yml
Other components
- Terraform roadmap · Learning repo spanning basic to advanced infrastructure patterns.
README.md
Connections 33
- Terraform roadmap → Static website: includes · Roadmap contains the basic standalone stack.
- Terraform roadmap → Bootstrap: includes · Roadmap contains the intermediate infrastructure phase.
- Terraform roadmap → Terragrunt root: includes · Roadmap contains the advanced platform phase.
- Static website → Inputs & state: uses · The single stack is driven by local inputs and outputs.
- Dev env → VPC: composes · Dev root instantiates the network module.
- Dev env → Security: composes · Dev root instantiates the security module.
- Dev env → EC2: composes · Dev root instantiates compute.
- Dev env → ALB: composes · Dev root instantiates load balancing.
- Dev env → RDS: composes · Dev root instantiates database services.
- VPC → Security: feeds · Network boundaries inform security rules.
- VPC → EC2: feeds · Compute depends on the network foundation.
- EC2 → ALB: behind · Application compute sits behind the load balancer.
- VPC → RDS: isolates · Database placement relies on private networking.
- Terragrunt root → Dev env: orchestrates · Shared Terragrunt config drives the dev environment.
- Terragrunt root → Prod env: orchestrates · Shared Terragrunt config drives the prod environment.
- Dev env → VPC unit: composes · Dev environment defines the networking unit.
- Dev env → ALB unit: composes · Dev environment defines the ingress unit.
- Dev env → ECS unit: composes · Dev environment defines the compute unit.
- Dev env → Aurora unit: composes · Dev environment defines the database unit.
- Dev env → Cache unit: composes · Dev environment defines the cache unit.
- Dev env → KMS unit: composes · Dev environment defines encryption resources.
- Dev env → WAF unit: composes · Dev environment defines protection resources.
- VPC unit → VPC: uses · Terragrunt unit wraps the VPC module.
- ALB unit → ALB: uses · Terragrunt unit wraps the ALB module.
- ECS unit → ECS: uses · Terragrunt unit wraps the ECS module.
- Aurora unit → Aurora: uses · Terragrunt unit wraps the Aurora module.
- Cache unit → Cache: uses · Terragrunt unit wraps the cache module.
- KMS unit → KMS: uses · Terragrunt unit wraps the KMS module.
- WAF unit → WAF: uses · Terragrunt unit wraps the WAF module.
- Terraform tests → KMS: validates · Terraform-native tests cover core encryption behavior.
- Terraform tests → VPC: validates · Terraform-native tests cover network primitives.
- GitHub Actions → Terraform tests: runs · CI executes validation and testing workflows.
- GitHub Actions → Terragrunt root: checks · CI gates the Terragrunt-based platform.