Marketplace

self-service-infrastructure

Use when designing infrastructure self-service portals, IaC templates, or automated provisioning systems. Covers Terraform modules, Pulumi, environment provisioning, and infrastructure guardrails.

allowed_tools: Read, Glob, Grep

$ Installer

git clone https://github.com/melodic-software/claude-code-plugins /tmp/claude-code-plugins && cp -r /tmp/claude-code-plugins/plugins/systems-design/skills/self-service-infrastructure ~/.claude/skills/claude-code-plugins

// tip: Run this command in your terminal to install the skill


name: self-service-infrastructure description: Use when designing infrastructure self-service portals, IaC templates, or automated provisioning systems. Covers Terraform modules, Pulumi, environment provisioning, and infrastructure guardrails. allowed-tools: Read, Glob, Grep

Self-Service Infrastructure

Patterns for enabling developers to provision infrastructure without tickets, while maintaining governance and control.

When to Use This Skill

  • Designing infrastructure self-service capabilities
  • Creating reusable Terraform/Pulumi modules
  • Building environment provisioning systems
  • Implementing infrastructure guardrails
  • Reducing infrastructure request bottlenecks
  • Balancing developer autonomy with governance

Self-Service Fundamentals

What is Self-Service Infrastructure?

Self-Service Infrastructure:
Enabling developers to provision and manage infrastructure
directly, without filing tickets or waiting for ops teams.

Traditional Model:
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Developer โ†’ Ticket โ†’ Ops Review โ†’ Manual Provision โ†’ Done  โ”‚
โ”‚                                                              โ”‚
โ”‚ Timeline: Days to weeks                                      โ”‚
โ”‚ Bottleneck: Ops team capacity                               โ”‚
โ”‚ Result: Shadow IT, workarounds, frustration                 โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Self-Service Model:
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Developer โ†’ Portal/API โ†’ Automatic Provision โ†’ Done         โ”‚
โ”‚                                                              โ”‚
โ”‚ Timeline: Minutes to hours                                  โ”‚
โ”‚ Bottleneck: None (automated)                                โ”‚
โ”‚ Result: Speed, consistency, compliance                      โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Self-Service Spectrum:
โ”œโ”€โ”€ Fully Managed: Click a button, get a database
โ”œโ”€โ”€ Template-Based: Customize from approved templates
โ”œโ”€โ”€ Policy-Constrained: Write IaC within guardrails
โ””โ”€โ”€ Full Freedom: Any infrastructure (risky)

Sweet Spot: Template-Based with Policy Guardrails

Key Benefits

Self-Service Benefits:

For Developers:
โ”œโ”€โ”€ Speed: Minutes instead of days
โ”œโ”€โ”€ Autonomy: Provision when needed
โ”œโ”€โ”€ Consistency: Same infrastructure every time
โ”œโ”€โ”€ Learning: Understand infrastructure better
โ””โ”€โ”€ Ownership: More responsibility, more control

For Operations:
โ”œโ”€โ”€ Scale: Handle more requests without more people
โ”œโ”€โ”€ Consistency: Enforce standards automatically
โ”œโ”€โ”€ Focus: Work on platform, not tickets
โ”œโ”€โ”€ Audit: Clear trail of who provisioned what
โ””โ”€โ”€ Compliance: Built-in policy enforcement

For Organization:
โ”œโ”€โ”€ Velocity: Faster time to market
โ”œโ”€โ”€ Cost: Reduced ops overhead
โ”œโ”€โ”€ Governance: Better compliance posture
โ”œโ”€โ”€ Security: Consistent security controls
โ””โ”€โ”€ Efficiency: Resources provisioned when needed

Self-Service Architecture

Component Architecture

Self-Service Infrastructure Architecture:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                     USER INTERFACE                           โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”         โ”‚
โ”‚  โ”‚   Portal    โ”‚  โ”‚    CLI      โ”‚  โ”‚    API      โ”‚         โ”‚
โ”‚  โ”‚   (Web UI)  โ”‚  โ”‚ (Terraform) โ”‚  โ”‚  (REST/gRPC)โ”‚         โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜         โ”‚
โ”‚         โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                 โ”‚
โ”‚                          โ”‚                                   โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                          โ–ผ                                   โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”‚
โ”‚  โ”‚               ORCHESTRATION LAYER                    โ”‚    โ”‚
โ”‚  โ”‚  โ”œโ”€โ”€ Request validation                              โ”‚    โ”‚
โ”‚  โ”‚  โ”œโ”€โ”€ Policy evaluation (OPA/Sentinel)               โ”‚    โ”‚
โ”‚  โ”‚  โ”œโ”€โ”€ Cost estimation                                 โ”‚    โ”‚
โ”‚  โ”‚  โ”œโ”€โ”€ Approval workflow (if needed)                  โ”‚    โ”‚
โ”‚  โ”‚  โ””โ”€โ”€ Execution orchestration                        โ”‚    โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ”‚
โ”‚                          โ”‚                                   โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                          โ–ผ                                   โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”‚
โ”‚  โ”‚               TEMPLATE LIBRARY                       โ”‚    โ”‚
โ”‚  โ”‚  โ”œโ”€โ”€ Database modules (RDS, Cloud SQL)              โ”‚    โ”‚
โ”‚  โ”‚  โ”œโ”€โ”€ Compute modules (EKS, GKE, VMs)               โ”‚    โ”‚
โ”‚  โ”‚  โ”œโ”€โ”€ Storage modules (S3, GCS)                      โ”‚    โ”‚
โ”‚  โ”‚  โ”œโ”€โ”€ Network modules (VPC, subnets)                 โ”‚    โ”‚
โ”‚  โ”‚  โ””โ”€โ”€ Composite modules (full environments)          โ”‚    โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ”‚
โ”‚                          โ”‚                                   โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                          โ–ผ                                   โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”‚
โ”‚  โ”‚               EXECUTION ENGINE                       โ”‚    โ”‚
โ”‚  โ”‚  โ”œโ”€โ”€ Terraform Cloud/Enterprise                     โ”‚    โ”‚
โ”‚  โ”‚  โ”œโ”€โ”€ Pulumi Service                                 โ”‚    โ”‚
โ”‚  โ”‚  โ”œโ”€โ”€ Crossplane                                     โ”‚    โ”‚
โ”‚  โ”‚  โ””โ”€โ”€ Cloud-native (CDK, ARM, Deployment Manager)   โ”‚    โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ”‚
โ”‚                          โ”‚                                   โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                          โ–ผ                                   โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”‚
โ”‚  โ”‚               CLOUD PROVIDERS                        โ”‚    โ”‚
โ”‚  โ”‚  AWS  โ”‚  GCP  โ”‚  Azure  โ”‚  Kubernetes  โ”‚  Others    โ”‚    โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Request Flow

Self-Service Request Flow:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ 1. REQUEST                                                   โ”‚
โ”‚    Developer: "I need a PostgreSQL database for staging"    โ”‚
โ”‚    โ””โ”€โ”€ Via portal, CLI, or API                              โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                          โ”‚
                          โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ 2. VALIDATION                                                โ”‚
โ”‚    โ”œโ”€โ”€ User has permission?          โœ“ Team member          โ”‚
โ”‚    โ”œโ”€โ”€ Request well-formed?          โœ“ Valid config         โ”‚
โ”‚    โ”œโ”€โ”€ Within quotas?                โœ“ Under team limit     โ”‚
โ”‚    โ””โ”€โ”€ Meets policy?                 โœ“ Allowed instance typeโ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                          โ”‚
                          โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ 3. ENRICHMENT                                                โ”‚
โ”‚    โ”œโ”€โ”€ Apply defaults                 db.t3.medium          โ”‚
โ”‚    โ”œโ”€โ”€ Generate names                 myapp-staging-db      โ”‚
โ”‚    โ”œโ”€โ”€ Assign network                 staging-vpc           โ”‚
โ”‚    โ”œโ”€โ”€ Configure monitoring           Datadog integration   โ”‚
โ”‚    โ””โ”€โ”€ Estimate cost                  ~$50/month            โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                          โ”‚
                          โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ 4. APPROVAL (if required)                                    โ”‚
โ”‚    โ”œโ”€โ”€ Auto-approve: staging, dev     โœ“ Auto-approved       โ”‚
โ”‚    โ”œโ”€โ”€ Manual approve: production     (Would need approval) โ”‚
โ”‚    โ””โ”€โ”€ Cost threshold: >$500/month    (Would need approval) โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                          โ”‚
                          โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ 5. EXECUTION                                                 โ”‚
โ”‚    โ”œโ”€โ”€ Generate Terraform             Based on template     โ”‚
โ”‚    โ”œโ”€โ”€ Plan                           Preview changes       โ”‚
โ”‚    โ”œโ”€โ”€ Apply                          Create resources      โ”‚
โ”‚    โ””โ”€โ”€ Verify                         Health checks         โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                          โ”‚
                          โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ 6. DELIVERY                                                  โ”‚
โ”‚    โ”œโ”€โ”€ Connection string โ†’ Vault                            โ”‚
โ”‚    โ”œโ”€โ”€ Notification โ†’ Slack/email                           โ”‚
โ”‚    โ”œโ”€โ”€ Documentation โ†’ Auto-generated                       โ”‚
โ”‚    โ””โ”€โ”€ Registration โ†’ Service catalog                       โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

IaC Module Design

Terraform Module Patterns

Terraform Module Structure:

Organization-Wide Module Library:
terraform-modules/
โ”œโ”€โ”€ databases/
โ”‚   โ”œโ”€โ”€ rds-postgres/
โ”‚   โ”‚   โ”œโ”€โ”€ main.tf
โ”‚   โ”‚   โ”œโ”€โ”€ variables.tf
โ”‚   โ”‚   โ”œโ”€โ”€ outputs.tf
โ”‚   โ”‚   โ”œโ”€โ”€ versions.tf
โ”‚   โ”‚   โ”œโ”€โ”€ README.md
โ”‚   โ”‚   โ””โ”€โ”€ examples/
โ”‚   โ”‚       โ”œโ”€โ”€ simple/
โ”‚   โ”‚       โ””โ”€โ”€ production/
โ”‚   โ””โ”€โ”€ elasticache-redis/
โ”œโ”€โ”€ compute/
โ”‚   โ”œโ”€โ”€ eks-cluster/
โ”‚   โ””โ”€โ”€ ecs-service/
โ”œโ”€โ”€ storage/
โ”‚   โ””โ”€โ”€ s3-bucket/
โ””โ”€โ”€ network/
    โ””โ”€โ”€ vpc/

Module Design Principles:

1. Opinionated Defaults
   # variables.tf
   variable "instance_class" {
     type        = string
     default     = "db.t3.medium"  # Sensible default
     description = "RDS instance type"

     validation {
       condition = can(regex("^db\\.(t3|r5|m5)", var.instance_class))
       error_message = "Only approved instance families allowed."
     }
   }

2. Minimal Required Inputs
   # Only require what can't be defaulted
   variable "name" {
     type        = string
     description = "Database identifier"
   }

   variable "environment" {
     type        = string
     description = "Environment (dev, staging, prod)"
   }

3. Complete Outputs
   # outputs.tf
   output "endpoint" {
     description = "Database connection endpoint"
     value       = aws_db_instance.main.endpoint
   }

   output "connection_secret_arn" {
     description = "ARN of secret with credentials"
     value       = aws_secretsmanager_secret.db_credentials.arn
   }

4. Built-in Best Practices
   # Security hardened by default
   resource "aws_db_instance" "main" {
     # Encryption always on
     storage_encrypted = true

     # No public access
     publicly_accessible = false

     # Automated backups
     backup_retention_period = var.environment == "prod" ? 30 : 7

     # Enhanced monitoring
     monitoring_interval = 60
   }

Module Versioning

Module Versioning Strategy:

Semantic Versioning:
โ”œโ”€โ”€ MAJOR: Breaking changes (new required inputs, removed outputs)
โ”œโ”€โ”€ MINOR: New features (new optional inputs, new outputs)
โ””โ”€โ”€ PATCH: Bug fixes (no interface changes)

Version Constraints:
# Allow patch updates automatically
module "database" {
  source  = "terraform.company.com/modules/rds-postgres"
  version = "~> 2.1.0"  # >=2.1.0, <2.2.0
}

# Pin to exact version (production)
module "database" {
  source  = "terraform.company.com/modules/rds-postgres"
  version = "= 2.1.3"
}

Deprecation Policy:
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Module Version Lifecycle                                     โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Current (v2.x):     Supported, new features                 โ”‚
โ”‚ Previous (v1.x):    Supported, security fixes only          โ”‚
โ”‚ Deprecated (v0.x):  Warning on use, no support              โ”‚
โ”‚ Removed:            Will not work                           โ”‚
โ”‚                                                              โ”‚
โ”‚ Notification:                                                โ”‚
โ”‚ โ”œโ”€โ”€ Slack announcement when version deprecated              โ”‚
โ”‚ โ”œโ”€โ”€ Warning in terraform plan output                        โ”‚
โ”‚ โ”œโ”€โ”€ Dashboard showing deprecated module usage               โ”‚
โ”‚ โ””โ”€โ”€ Migration guide provided                                โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Policy and Guardrails

Policy as Code

Policy as Code Options:

1. HashiCorp Sentinel (Terraform Enterprise)
   # Require encryption for all storage
   import "tfplan/v2" as tfplan

   s3_buckets = filter tfplan.resource_changes as _, rc {
     rc.type is "aws_s3_bucket" and
     rc.mode is "managed" and
     (rc.change.actions contains "create" or
      rc.change.actions contains "update")
   }

   encryption_enabled = rule {
     all s3_buckets as _, bucket {
       bucket.change.after.server_side_encryption_configuration
         is not null
     }
   }

   main = rule { encryption_enabled }

2. Open Policy Agent (OPA)
   # Rego policy for Kubernetes
   package kubernetes.admission

   deny[msg] {
     input.request.kind.kind == "Pod"
     container := input.request.object.spec.containers[_]
     not container.securityContext.runAsNonRoot
     msg := "Containers must run as non-root"
   }

3. Cloud-Native Policies
   # AWS Service Control Policy
   {
     "Version": "2012-10-17",
     "Statement": [{
       "Sid": "RequireEncryption",
       "Effect": "Deny",
       "Action": ["s3:CreateBucket"],
       "Resource": "*",
       "Condition": {
         "StringNotEquals": {
           "s3:x-amz-server-side-encryption": "AES256"
         }
       }
     }]
   }

Guardrail Categories

Infrastructure Guardrails:

1. Security Guardrails
   โ”œโ”€โ”€ Encryption required (at-rest, in-transit)
   โ”œโ”€โ”€ No public access by default
   โ”œโ”€โ”€ Required security groups
   โ”œโ”€โ”€ IAM role requirements
   โ””โ”€โ”€ Vulnerability scanning

2. Cost Guardrails
   โ”œโ”€โ”€ Instance type restrictions
   โ”œโ”€โ”€ Storage size limits
   โ”œโ”€โ”€ Required cost tags
   โ”œโ”€โ”€ Budget thresholds
   โ””โ”€โ”€ Approval for large resources

3. Compliance Guardrails
   โ”œโ”€โ”€ Allowed regions (data residency)
   โ”œโ”€โ”€ Required logging
   โ”œโ”€โ”€ Backup requirements
   โ”œโ”€โ”€ Retention policies
   โ””โ”€โ”€ Audit trail requirements

4. Operational Guardrails
   โ”œโ”€โ”€ Naming conventions
   โ”œโ”€โ”€ Required tags (owner, cost-center)
   โ”œโ”€โ”€ Resource quotas per team
   โ”œโ”€โ”€ Monitoring requirements
   โ””โ”€โ”€ Deletion protection

Guardrail Implementation:
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    Guardrail Timing                          โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                              โ”‚
โ”‚  Pre-Plan (fastest feedback):                               โ”‚
โ”‚  โ”œโ”€โ”€ Validate terraform files                               โ”‚
โ”‚  โ”œโ”€โ”€ Static analysis (tfsec, checkov)                      โ”‚
โ”‚  โ””โ”€โ”€ Module version checks                                  โ”‚
โ”‚                                                              โ”‚
โ”‚  Post-Plan (resource-aware):                                โ”‚
โ”‚  โ”œโ”€โ”€ OPA/Sentinel policy evaluation                        โ”‚
โ”‚  โ”œโ”€โ”€ Cost estimation                                        โ”‚
โ”‚  โ””โ”€โ”€ Blast radius assessment                                โ”‚
โ”‚                                                              โ”‚
โ”‚  Post-Apply (verification):                                 โ”‚
โ”‚  โ”œโ”€โ”€ Configuration validation                               โ”‚
โ”‚  โ”œโ”€โ”€ Security scanning                                      โ”‚
โ”‚  โ””โ”€โ”€ Compliance audit                                       โ”‚
โ”‚                                                              โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Environment Provisioning

Environment Templates

Environment Provisioning:

Environment Types:
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Development Environment                                      โ”‚
โ”‚ โ”œโ”€โ”€ Purpose: Individual developer testing                   โ”‚
โ”‚ โ”œโ”€โ”€ Lifetime: Hours to days                                 โ”‚
โ”‚ โ”œโ”€โ”€ Resources: Minimal (smallest instances)                 โ”‚
โ”‚ โ”œโ”€โ”€ Data: Synthetic or anonymized                           โ”‚
โ”‚ โ””โ”€โ”€ Approval: None (within quota)                           โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Staging Environment                                          โ”‚
โ”‚ โ”œโ”€โ”€ Purpose: Integration testing, QA                        โ”‚
โ”‚ โ”œโ”€โ”€ Lifetime: Persistent per service                        โ”‚
โ”‚ โ”œโ”€โ”€ Resources: Production-like (scaled down)                โ”‚
โ”‚ โ”œโ”€โ”€ Data: Sanitized production subset                       โ”‚
โ”‚ โ””โ”€โ”€ Approval: None (within quota)                           โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Production Environment                                       โ”‚
โ”‚ โ”œโ”€โ”€ Purpose: Live customer traffic                          โ”‚
โ”‚ โ”œโ”€โ”€ Lifetime: Permanent                                      โ”‚
โ”‚ โ”œโ”€โ”€ Resources: Full capacity                                โ”‚
โ”‚ โ”œโ”€โ”€ Data: Real customer data                                โ”‚
โ”‚ โ””โ”€โ”€ Approval: Required (security review)                    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Environment Template:
# environment/main.tf
module "network" {
  source      = "../modules/vpc"
  environment = var.environment
  cidr_block  = var.network_cidr
}

module "kubernetes" {
  source      = "../modules/eks"
  environment = var.environment
  vpc_id      = module.network.vpc_id
  node_count  = var.environment == "prod" ? 5 : 2
}

module "database" {
  source         = "../modules/rds"
  environment    = var.environment
  vpc_id         = module.network.vpc_id
  instance_class = var.environment == "prod" ? "db.r5.xlarge" : "db.t3.medium"
  multi_az       = var.environment == "prod"
}

module "cache" {
  source      = "../modules/elasticache"
  environment = var.environment
  vpc_id      = module.network.vpc_id
  node_type   = var.environment == "prod" ? "cache.r5.large" : "cache.t3.micro"
}

Ephemeral Environments

Ephemeral/Preview Environments:

Use Cases:
โ”œโ”€โ”€ PR preview environments
โ”œโ”€โ”€ Feature branch testing
โ”œโ”€โ”€ Demo environments
โ”œโ”€โ”€ Load testing environments
โ””โ”€โ”€ Incident reproduction

Lifecycle:
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                                                              โ”‚
โ”‚  PR Created โ”€โ”€โ–บ Environment Created โ”€โ”€โ–บ Tests Run           โ”‚
โ”‚       โ”‚              โ”‚                      โ”‚               โ”‚
โ”‚       โ”‚              โ–ผ                      โ–ผ               โ”‚
โ”‚       โ”‚         Preview URL            PR Updated           โ”‚
โ”‚       โ”‚         Posted to PR              โ”‚                 โ”‚
โ”‚       โ”‚                                   โ”‚                 โ”‚
โ”‚       โ–ผ                                   โ–ผ                 โ”‚
โ”‚  PR Merged โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–บ Environment Destroyed   โ”‚
โ”‚                                                              โ”‚
โ”‚  Timeout: Auto-destroy after 7 days of inactivity          โ”‚
โ”‚                                                              โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Implementation:
# .github/workflows/preview.yml
name: Preview Environment

on:
  pull_request:
    types: [opened, synchronize]

jobs:
  deploy-preview:
    runs-on: ubuntu-latest
    steps:
      - name: Create/Update Environment
        run: |
          terraform workspace select pr-${{ github.event.pull_request.number }} || \
          terraform workspace new pr-${{ github.event.pull_request.number }}
          terraform apply -auto-approve

      - name: Comment Preview URL
        uses: actions/github-script@v6
        with:
          script: |
            github.rest.issues.createComment({
              issue_number: context.issue.number,
              body: '๐Ÿš€ Preview: https://pr-${{ github.event.pull_request.number }}.preview.company.com'
            })

Technology Options

Self-Service Platforms

Platform Comparison:

1. Terraform Cloud/Enterprise
   โ”œโ”€โ”€ Native Terraform experience
   โ”œโ”€โ”€ Policy as Code (Sentinel)
   โ”œโ”€โ”€ Private module registry
   โ”œโ”€โ”€ Cost estimation
   โ””โ”€โ”€ Enterprise features (SSO, audit)

2. Pulumi
   โ”œโ”€โ”€ Real programming languages
   โ”œโ”€โ”€ Strong typing and IDE support
   โ”œโ”€โ”€ Policy as Code (CrossGuard)
   โ””โ”€โ”€ Automation API

3. Crossplane
   โ”œโ”€โ”€ Kubernetes-native
   โ”œโ”€โ”€ GitOps workflow
   โ”œโ”€โ”€ Composition for modules
   โ””โ”€โ”€ Multi-cloud abstraction

4. Backstage + Terraform
   โ”œโ”€โ”€ Unified developer portal
   โ”œโ”€โ”€ Software templates
   โ”œโ”€โ”€ Plugin ecosystem
   โ””โ”€โ”€ Service catalog integration

5. Port/Cortex/OpsLevel
   โ”œโ”€โ”€ Commercial developer portals
   โ”œโ”€โ”€ Quick to implement
   โ”œโ”€โ”€ Built-in integrations
   โ””โ”€โ”€ Self-service workflows

Selection Criteria:
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Factor               โ”‚ Best Fit                            โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Existing Terraform   โ”‚ Terraform Cloud/Enterprise         โ”‚
โ”‚ Kubernetes-first     โ”‚ Crossplane                         โ”‚
โ”‚ Developer portal     โ”‚ Backstage or commercial            โ”‚
โ”‚ Programming language โ”‚ Pulumi                             โ”‚
โ”‚ Quick start          โ”‚ Commercial (Port, OpsLevel)        โ”‚
โ”‚ Maximum control      โ”‚ Build custom                       โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Cost Management

Cost Controls

Cost Management in Self-Service:

1. Cost Visibility
   โ”œโ”€โ”€ Estimated cost shown before provisioning
   โ”œโ”€โ”€ Cost tags automatically applied
   โ”œโ”€โ”€ Per-team/project dashboards
   โ””โ”€โ”€ Anomaly detection and alerts

2. Cost Guardrails
   โ”œโ”€โ”€ Instance type restrictions
   โ”œโ”€โ”€ Budget thresholds by team
   โ”œโ”€โ”€ Approval required above threshold
   โ””โ”€โ”€ Auto-shutdown of unused resources

3. Cost Optimization
   โ”œโ”€โ”€ Right-sizing recommendations
   โ”œโ”€โ”€ Reserved instance suggestions
   โ”œโ”€โ”€ Spot instance for non-production
   โ””โ”€โ”€ Scheduled scaling

Cost Estimation Flow:
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Request: PostgreSQL database for staging                    โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                              โ”‚
โ”‚  Cost Estimate:                                             โ”‚
โ”‚  โ”œโ”€โ”€ Compute (db.t3.medium):        $30/month              โ”‚
โ”‚  โ”œโ”€โ”€ Storage (100GB gp3):           $10/month              โ”‚
โ”‚  โ”œโ”€โ”€ Backup storage:                ~$5/month              โ”‚
โ”‚  โ””โ”€โ”€ Data transfer:                 ~$5/month              โ”‚
โ”‚                                     โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€               โ”‚
โ”‚  Estimated Total:                   ~$50/month             โ”‚
โ”‚                                                              โ”‚
โ”‚  โœ“ Within team budget ($500/month quota)                   โ”‚
โ”‚  โœ“ No approval required                                     โ”‚
โ”‚                                                              โ”‚
โ”‚  [Proceed] [Modify] [Cancel]                                โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Best Practices

Self-Service Infrastructure Best Practices:

1. Start Small, Expand Gradually
   โ”œโ”€โ”€ Begin with 2-3 common resources
   โ”œโ”€โ”€ Add based on demand
   โ”œโ”€โ”€ Iterate on feedback
   โ””โ”€โ”€ Don't try to cover everything day 1

2. Balance Autonomy and Governance
   โ”œโ”€โ”€ Guardrails not gates
   โ”œโ”€โ”€ Automate approvals where safe
   โ”œโ”€โ”€ Clear escalation paths
   โ””โ”€โ”€ Trust but verify

3. Optimize for Developer Experience
   โ”œโ”€โ”€ Minimal required inputs
   โ”œโ”€โ”€ Sensible defaults
   โ”œโ”€โ”€ Clear error messages
   โ””โ”€โ”€ Fast feedback loops

4. Maintain Module Quality
   โ”œโ”€โ”€ Automated testing
   โ”œโ”€โ”€ Documentation requirements
   โ”œโ”€โ”€ Versioning strategy
   โ””โ”€โ”€ Deprecation process

5. Monitor and Improve
   โ”œโ”€โ”€ Track provisioning success rate
   โ”œโ”€โ”€ Measure time to provision
   โ”œโ”€โ”€ Gather user feedback
   โ””โ”€โ”€ Identify automation opportunities

6. Handle Edge Cases
   โ”œโ”€โ”€ What if provisioning fails?
   โ”œโ”€โ”€ How to handle orphaned resources?
   โ”œโ”€โ”€ What about existing resources?
   โ””โ”€โ”€ How to migrate between versions?

Anti-Patterns

Self-Service Anti-Patterns:

1. "Self-Service Everything"
   โŒ Every possible configuration option
   โœ“ Curated set of approved patterns

2. "Security Theater"
   โŒ Manual approvals that don't add value
   โœ“ Automated policy enforcement

3. "Configuration Explosion"
   โŒ 50 parameters per resource
   โœ“ Sensible defaults with few overrides

4. "Ignore Cost"
   โŒ No visibility into provisioned cost
   โœ“ Cost estimation and budgets

5. "Build vs Buy Wrong"
   โŒ Building everything from scratch
   โœ“ Use existing tools where appropriate

6. "No Escape Hatch"
   โŒ Blocking legitimate exceptions
   โœ“ Process for justified deviations

Related Skills

  • internal-developer-platform - Platform engineering overview
  • golden-paths - Standardized workflows
  • container-orchestration - Kubernetes infrastructure
  • serverless-patterns - Serverless infrastructure

Repository

melodic-software
melodic-software
Author
melodic-software/claude-code-plugins/plugins/systems-design/skills/self-service-infrastructure
3
Stars
0
Forks
Updated1d ago
Added6d ago