Enterprise-Grade Multi-Cloud Infrastructure Automation & Orchestration Platform
- β¨ Overview
- ποΈ System Architecture
- π Folder Structure
- π Quick Start
- ποΈ Cloud Account Setup & Auth
- βοΈ Environment Lifecycle
- π‘οΈ Policy as Code & Security Scanning
- π₯οΈ Next.js Web Interface
- π§° Automation Scripts
- π Cost Optimization
- π©Ί Monitoring & Observability
- π Security Policy
- πΊοΈ Roadmap
- β FAQ
- π License
TerraDeploy is a unified multi-cloud infrastructure orchestration and lifecycle platform designed to deploy, manage, and audit resources across Amazon Web Services (AWS), Google Cloud Platform (GCP), and Microsoft Azure.
With an integrated React/Next.js dashboard, secure pipelines, cost breakdown projections, and Open Policy Agent (OPA) validation constraints, TerraDeploy delivers GitOps best practices in one complete codebase.
graph TD
User([Platform Engineer]) -->|Push Code| GitHub[GitHub Repository]
GitHub -->|Trigger Workflow| GHA[GitHub Actions CI/CD]
subgraph "CI/CD Security & Check Stage"
GHA -->|1. Linter Audit| Lint[TFLint / Checkov / TFSec / Terrascan]
GHA -->|2. Cost breakdown| Infracost[Infracost]
GHA -->|3. Policy as Code| OPA[Open Policy Agent]
end
OPA -->|Plan Approved| ManualGate{Manual Approval Gate}
ManualGate -->|Apply| TF[Terraform Engine]
TF -->|State Management| Backend[(Remote Backend S3/GCS/Blob)]
TF -->|Provision| AWS[AWS Cloud Resources]
TF -->|Provision| GCP[Google Cloud Resources]
TF -->|Provision| Azure[Azure Cloud Resources]
Dashboard[Next.js Dashboard Portal] -->|Query State| Backend
Dashboard -->|Monitor Health| HealthChecks[scripts/health-check.sh]
Dashboard -->|Trigger Local Actions| RunDeploy[scripts/deploy.sh]
The project has been organized according to enterprise platform standards:
.
βββ .github/workflows/ # π Multi-stage Parallel deployment Workflows
β βββ drift-detection.yml # Daily state configuration drift alerts
β βββ terraform-deployment.yml # Format, lint, security scans, cost, OPA check, Apply
βββ dashboard/ # π» Next.js 16 Web Dashboard Application
β βββ src/
β β βββ app/ # App Router pages and Server API routes
β β β βββ api/ # SSE logs, state parsing, cost, security APIs
β β β βββ settings/ # Theme providers and application setup
β β βββ components/ # Sidebar, wizards, terminals, dynamic tables
β βββ public/ # Deployment logs and assets
βββ policy/ # π‘οΈ Open Policy Agent (OPA) Guardrails (Rego)
β βββ infrastructure.rego # Public bucket, open SG ports, tags, naming policies
β βββ infrastructure_test.rego # OPA verification unit test specifications
βββ scripts/ # π οΈ Command validation and lifecycle scripts
β βββ bootstrap.sh # Backend remote state storage setups
β βββ cleanup.sh # Safely removes cached local states and logs
β βββ deploy.sh # Runs local deployments with OPA checking
β βββ destroy.sh # Destructive state teardown with confirm gates
β βββ health-check.sh # Queries API / Web endpoints for status checks
β βββ setup.sh # Validates local machine dependencies
β βββ verify.sh # Pre-commit formatting and linter runner
βββ terraform/
βββ environments/ # π Independent Environment Workspaces
β βββ dev/
β βββ staging/
β βββ prod/
βββ modules/ # π§© Reusable Sub-resource Provider Components
βββ aws/ # VPC, Security Groups, IAM, EC2, S3, RDS, ECS, EKS, DNS
βββ gcp/ # VPC, GCS, Cloud SQL, Compute VM, Run, GKE, IAM, Secrets
βββ azure/ # Resource Group, Network, storage, VM, AKS, Azure SQL, KeyVaultExecute the setup tool to inspect local CLI runtimes and resolve dashboard modules:
chmod +x scripts/*.sh
./scripts/setup.shCreate and populate your variable files inside the environment folders:
terraform/environments/dev/terraform.tfvarsterraform/environments/staging/terraform.tfvarsterraform/environments/prod/terraform.tfvars
Deploy the development stack locally:
./scripts/deploy.sh --env devStart the visualization user interface:
cd dashboard
npm run devThe interface is exposed at http://localhost:3000.
TerraDeploy communicates using native SDK parameters. Export the following keys locally or add them as GitHub Actions Secrets:
export AWS_ACCESS_KEY_ID="your-access-key"
export AWS_SECRET_ACCESS_KEY="your-secret-key"
export AWS_DEFAULT_REGION="us-east-1"export GOOGLE_APPLICATION_CREDENTIALS="/path/to/service-account.json"
export GCP_PROJECT_ID="your-project-id"export ARM_CLIENT_ID="your-app-id"
export ARM_CLIENT_SECRET="your-app-password"
export ARM_SUBSCRIPTION_ID="your-sub-id"
export ARM_TENANT_ID="your-tenant-id"TerraDeploy segregates work environments using hard isolation parameters:
| Parameter | Development | Staging | Production |
|---|---|---|---|
| Workspace | dev |
staging |
prod |
| Instance Type | t3.micro / e2-micro |
t3.small / e2-medium |
t3.medium / e2-standard-2 |
| Database | Single Zone (Micro) | Single Zone | Multi-AZ High Availability |
| Deploy Rule | Local CLI or Push | Automated on Merges | Requires Manual approvals |
| Force Destroy | Allowed | Restricted | Banned |
Governance policies are enforced prior to resource allocation:
- Public Storage Blocked: Disallows public-read S3 ACL policies.
- Open Ingress Checked: Blocks exposing port
22(SSH),3389(RDP), and5432(Postgres) globally (0.0.0.0/0). - IAM Least Privilege: Fails build if wildcard
Action: *is coupled withResource: *in policies. - Mandatory Tagging: Validates presence of
EnvironmentandProjecttags.
Validate policies locally:
./scripts/verify.shThe integrated React Next.js dashboard features:
- State Parsing API: Reads
.tfstatefiles directly to show resource count, IPs, and endpoints. - Deploy SSE Terminal: Streams deployment outputs from CLI executions directly to the console UI.
- Cost breakdowns: Provides recommendations and burn forecast tracking charts.
- Compliance Panel: Visualizes vulnerabilities found in linter runs.
- Dark Mode Support: Smooth toggles for modern layouts.
scripts/bootstrap.sh: Automatically provisions remote S3 buckets/DynamoDB locks for your state.scripts/deploy.sh: Runs local workspace plans, queries OPA policies, and applies infrastructure.scripts/destroy.sh: Handles resource terminations with confirmation validation.scripts/health-check.sh: Checks live endpoint status via network probes.scripts/cleanup.sh: Cleans local file workspace targets.
TerraDeploy implements cost budgets through Infracost integration. It estimates budget changes on pull requests, compares monthly running costs across environments, and suggests rightsizing for underutilized instances.
Observability features:
- AWS: CloudWatch log groups and CPU utilization threshold alarms.
- GCP: Project-level logging sinks forwarding audit metrics to Cloud Storage.
- Azure: Log Analytics workspaces unified with Application Insights telemetry.
We enforce strict least-privilege permissions. All code commits should be signed. Dependabot updates libraries weekly, and CodeQL scans workflows for vulnerability alerts. Refer to the security policy document for details.
- Dynamic Multi-tenant Environments: Launch environments directly from the UI.
- OpenID Connect (OIDC) Setup Helpers: Automatic CLI federation setup script.
- Slack/Teams Notification Routing: Multi-channel alerting integration.
- Execute
./scripts/bootstrap.sh --provider aws --env devto build state storage. - Update the
backendblocks inside the environment folder. - Execute
terraform init -migrate-state.
The OPA agent returns a failure exit code if any resource changes violate constraints in infrastructure.rego. This stops the pipeline before terraform apply runs.
Distributed under the MIT License. See LICENSE for details.
