Skip to content

About

TerraDeploy is a production-grade cloud infrastructure automation platform designed to simplify and scale multi-cloud management. It provides a unified interface for deploying and managing resources across AWS, GCP, and Azure, wrapped in a modern dashboard with integrated security and CI/CD.

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

Β 

History

14 Commits

Folders and files

Repository files navigation

πŸš€ TerraDeploy

Enterprise-Grade Multi-Cloud Infrastructure Automation & Orchestration Platform

Terraform Next.js GitHub Actions AWS GCP Azure

TerraDeploy Dashboard


πŸ“– Table of Contents


✨ Overview

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.


πŸ—οΈ System Architecture

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]
Loading

πŸ“‚ Folder Structure

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, KeyVault

πŸš€ Quick Start

πŸ“‹ Prerequisites

  • Terraform (>= 1.5.0)
  • Node.js (>= 18.0.0)
  • OPA CLI (optional, for local policy verification)

1️⃣ Run Local System Validation

Execute the setup tool to inspect local CLI runtimes and resolve dashboard modules:

chmod +x scripts/*.sh
./scripts/setup.sh

2️⃣ Configure Environment Parameters

Create and populate your variable files inside the environment folders:

  • terraform/environments/dev/terraform.tfvars
  • terraform/environments/staging/terraform.tfvars
  • terraform/environments/prod/terraform.tfvars

3️⃣ Local Plan & Apply

Deploy the development stack locally:

./scripts/deploy.sh --env dev

4️⃣ Boot Web Dashboard Portal

Start the visualization user interface:

cd dashboard
npm run dev

The interface is exposed at http://localhost:3000.


πŸ—οΈ Cloud Account Setup & Auth

TerraDeploy communicates using native SDK parameters. Export the following keys locally or add them as GitHub Actions Secrets:

AWS Authentication

export AWS_ACCESS_KEY_ID="your-access-key"
export AWS_SECRET_ACCESS_KEY="your-secret-key"
export AWS_DEFAULT_REGION="us-east-1"

GCP Authentication

export GOOGLE_APPLICATION_CREDENTIALS="/path/to/service-account.json"
export GCP_PROJECT_ID="your-project-id"

Azure Authentication

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"

βš™οΈ Environment Lifecycle

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

πŸ›‘οΈ Policy as Code & Security Scanning

Governance policies are enforced prior to resource allocation:

  1. Public Storage Blocked: Disallows public-read S3 ACL policies.
  2. Open Ingress Checked: Blocks exposing port 22 (SSH), 3389 (RDP), and 5432 (Postgres) globally (0.0.0.0/0).
  3. IAM Least Privilege: Fails build if wildcard Action: * is coupled with Resource: * in policies.
  4. Mandatory Tagging: Validates presence of Environment and Project tags.

Validate policies locally:

./scripts/verify.sh

πŸ–₯️ Next.js Web Interface

The integrated React Next.js dashboard features:

  • State Parsing API: Reads .tfstate files 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.

🧰 Automation Scripts

  • 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.

πŸ“Š Cost Optimization

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.


🩺 Monitoring & Observability

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.

πŸ”’ Security Policy

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.


πŸ—ΊοΈ Roadmap

  • 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.

❓ FAQ

How do I migrate from local state to remote state?

  1. Execute ./scripts/bootstrap.sh --provider aws --env dev to build state storage.
  2. Update the backend blocks inside the environment folder.
  3. Execute terraform init -migrate-state.

How does the policy check fail the build?

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.


πŸ“„ License

Distributed under the MIT License. See LICENSE for details.

About

TerraDeploy is a production-grade cloud infrastructure automation platform designed to simplify and scale multi-cloud management. It provides a unified interface for deploying and managing resources across AWS, GCP, and Azure, wrapped in a modern dashboard with integrated security and CI/CD.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages