Stack: Terraform · AWS · Azure · GCP · GitHub Actions (CI/CD)
This project demonstrates how to manage multi-cloud infrastructure using Terraform with modular design, environment isolation, and a CI/CD-driven governance workflow.
The goal: Provision & manage resources across AWS, Azure, and GCP while enforcing automation, reusability, and collaboration best practices.
-
Foundational Layer
- Base network setup (
base-network/) across clouds - Global variables (
global-variables.tf) for naming, tags, and standards
- Base network setup (
-
Abstraction Layer
-
Reusable modules:
aws_vm/→ EC2 instancesazure_storage/→ Storage accountsgcp_vm/→ GCE instances
-
-
Deployment & Governance Layer
-
Environments:
dev/,staging/,prod/ -
CI/CD pipeline via GitHub Actions:
- Plan → Pull request validation
- Apply → Triggered on main branch merge
-
terraform-multicloud/
├── backend.tf # Remote backend config
├── base-network/ # Shared base networking setup
├── docs/ # Documentation & diagrams
├── envs/ # Dev, staging, prod environment configs
├── modules/ # Cloud-specific reusable modules
│ ├── aws_vm/
│ ├── azure_storage/
│ └── gcp_vm/
├── global-variables.tf # Shared tagging & standards
├── provider.tf # Multi-cloud provider setup
├── versions.tf # Terraform version constraints
└── .github/workflows/ # CI/CD pipeline
git clone https://github.com/your-username/terraform-multicloud.git
cd terraform-multicloud-
Setup remote state in AWS S3, GCS, or Azure Blob (see
backend.tf). -
Store cloud credentials in GitHub Actions secrets:
AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEYAZURE_CLIENT_ID,AZURE_CLIENT_SECRET,AZURE_TENANT_ID,AZURE_SUBSCRIPTION_IDGOOGLE_CREDENTIALS(JSON service account)
Run Terraform manually (for testing):
cd envs/dev
terraform init
terraform plan
terraform applyOr via GitHub Actions (preferred):
- Open a PR → triggers
terraform plan - Merge to main → triggers
terraform apply
- CI/CD pipeline enforces code review (Plan stage).
- Environment isolation ensures dev/staging/prod separation.
- Secrets managed in GitHub instead of hardcoded credentials.
- Remote state backend prevents drift & enables team collaboration.
- Unified way to manage AWS, Azure, and GCP with a single codebase.
- Reduced manual cloud management → faster deployments.
- Improved security via GitHub Secrets + remote state backends.
- Reusable modules make it easy to scale & extend.
- Multi-cloud Terraform provisioning
- Infrastructure modularization
- GitHub Actions for IaC CI/CD
- Environment isolation & governance
- Cloud provider interoperability
Abdulrahman A. Muhamad DevOps · Cloud · SRE Enthusiast
