Managing Terraform across multiple cloud providers at scale requires discipline. Here are the patterns we use across 100+ client environments.
Module Structure
Organize modules by service, not by provider: modules/ kubernetes/ # Works across EKS, AKS, GKE database/ # RDS, Cloud SQL, Azure Database networking/ # VPC, VNet, VPC-native GKE security/ # IAM, RBAC, Security Groups
State Management
Use remote state with locking — S3 + DynamoDB for AWS, Azure Blob Storage for Azure, GCS for GCP. Never use local state in team environments.
Workspace Strategy
Use Terraform workspaces for environment separation (dev/staging/prod) within a single configuration, with environment-specific variable files.
Provider Version Pinning
Always pin provider versions exactly:
terraform {
required_providers {
aws = { source = "hashicorp/aws", version = "= 5.50.0" }
}
}Drift Detection
Run terraform plan in CI on a schedule (daily) to detect infrastructure drift before it becomes a problem.
InfraOpex IaC Services
We design and manage Terraform infrastructure across all major clouds with best practices built in from day one. Contact us for an IaC assessment.