Multi-Cloud Module Layout
This folder shows the structural idea behind a multi-cloud Terraform project: one root module orchestrates separate provider-specific modules so you can keep cloud-specific details isolated while preserving a single entry point.
What this example teaches
- How one root configuration can call multiple child modules.
- Why provider-specific logic belongs in separate module folders.
- How Terraform can support multi-cloud layouts without forcing all resources into one giant file.
- How a shared top-level project can become the control point for platform patterns across providers.
Files to inspect
main.tf: calls the AWS and GCP modules.modules/aws/main.tf: AWS-specific resources and provider lock data.modules/gcp/main.tf: GCP-specific resources.
Suggested workflow
- Read the root module first so you understand the composition pattern.
- Open each provider module and compare how the resources differ.
- Think about which values should be standardized and which must remain cloud-specific.
- Treat this as a structural template rather than a production-ready landing zone.
Notes before reuse
- Avoid committing provider caches or generated artifacts in long-lived projects.
- Introduce shared variables, outputs, and remote state strategy before scaling this pattern.
- Consider separate state files when clouds or environments should be deployed independently.