IDLC Framework Header Image

Infrastructure as Code Development Lifecycle - Applying software best practices to infrastructure management.

Github Stars

Code Phase

Core Concepts


Repository Layout (Authoring)

A typical layout while coding these constructs:

itops-idlc/
├─ modules/
│  ├─ s3/
│  │  ├─ main.tf
│  │  ├─ variables.tf
│  ├─ database/
│  │  ├─ main.tf
├─ blueprints/
│  ├─ super-service/
│  │  ├─ storage.tf   # uses S3 + log-group modules
│  │  ├─ database.tf  # uses database module
├─ deployments/
│  ├─ <TEAM>/
│  │  ├─ stage/
│  │  │  ├─ super-service/
│  │  │  │  ├─ main.tf   # instantiates the super-service blueprint
│  │  ├─ production/
│  │  │  ├─ super-service/
│  │  │  │  ├─ main.tf

Examples

1) Example: S3 Bucket Module (minimal, opinionated defaults)

resource "aws_s3_bucket" "this" {
  bucket = var.name
  acl    = "private"

  versioning { enabled = true }

  lifecycle_rule {
    id      = "expire-logs"
    enabled = true
    expiration { days = 90 }
  }
}

variable "name" {
  type        = string
  description = "Bucket name"
}

2) Example: Blueprint excerpt (compose modules)

module "storage" {
  source = "../../modules/s3"
  name   = "${var.service}-data"
}

module "logs" {
  source = "../../modules/cloudwatch-log-group"
  name   = "${var.service}-logs"
}

module "database" {
  source  = "../../modules/database"
  engine  = "postgres"
  version = "15" # enforced by blueprint
}

3) Example: Deployment (instantiate a blueprint per environment)

# /deployments/<TEAM>/stage/super-service/main.tf
module "super_service" {
  # In practice, this would point to Terrareg (private registry) or a pinned source.
  source  = "../../../blueprints/super-service"
  service = "super-service"
  env     = "stage"
}

Best Practices Checklist

Principle: Code is about reusability + opinionated standards and clear separation of concerns across Modules, Blueprints, and Deployments.