This directory contains a suite of powerful automation scripts designed to streamline the deployment, management, and destruction of Stellar Engine environments. These tools are built to be robust, resumable, and transparent.
A shared library providing consistent logging, error handling, and utility functions across all scripts.
The main entry point for deploying the Stellar Engine environment.
- Guides you interactively through setting up your
config.env. - Executes Terraform stages in the correct order (
0-bootstrap->1-resman->2-networking->3-project-factory). - Captures all output automatically to timestamped files in
logs/deploy/. - Checks for common configuration issues and cloud resource states.
A safe and reliable script for tearing down the environment.
- Tracks progress in
state/last_operation_${PREFIX}.envso interrupted runs can resume from the last successful stage. - Archives previous destroy states to
logs/destroy/to prevent conflicts. - Reverts Terraform backend configurations to ensure clean destruction.
- Pulls remote state to local automatically if the GCS backend is detected and the bucket might be at risk, ensuring destruction can proceed even if the bucket is deleted.
- Performs an optional deep clean of all local Terraform state (
terraform.tfstate,.terraform/) and configuration (*-providers.tf,*.auto.tfvars.json) across all stages to leave a clean environment for redeployment. - Deletes projects and folders in parallel to reduce destruction time.
- Supports both GNU/Linux and macOS (BSD) environments.
- Verifies prefixes and prompts for confirmation before destructive actions.
WARNING: DESTRUCTIVE. A utility for cleaning up organization-level resources such as Tags, Custom Roles, Log Sinks, and Org Policies.
- Deletes only resources matching the configured
PREFIXto avoid affecting other deployments. - Includes the same final cleanup logic as
destroy.shto remove local state and config files.
A helper script to assist in restoring an environment where the prefix has not changed. It can undelete projects, re-enable billing, and import Terraform state. Use with caution.
A targeted fix for BigQuery permission issues (gcp.restrictServiceUsage) that can occur during deployment.
The config.env file is the single source of truth for your deployment configuration.
deploy.shcan generate this file interactively.- Contains settings such as
PREFIX,ORGANIZATION_ID,BILLING_ACCOUNT, and region preferences.
All script executions are logged to the logs/ directory, organized by script name.
- Log files use the path format
logs/<script_name>/<script_name>_<YYYYMMDD_HHMMSS>.txt. - These logs contain the full output of the terminal session for debugging and review.
These scripts rely on POSIX path resolution, symbolic links, and standard GNU/BSD utilities (bash, sed, awk, grep, jq). The following environments are supported:
- Linux
- macOS
- Google Cloud Shell
- WSL2 (Windows Subsystem for Linux) on Windows workstations
Running these scripts directly from PowerShell, Command Prompt (cmd.exe), Git Bash (MINGW64/MSYS), or Cygwin is not supported and is blocked by the pre-flight check (check_os_environment) in common-functions.sh. Native Windows terminals can encounter the following issues:
- Path separator translation issues (
\vs/) when generating Terraform stage links and backend paths. - Symbolic link creation failures (
ln -s) unless Windows Developer Mode or elevated privileges are enabled. - Line-ending (
CRLFvsLF) and file permission incompatibilities in generated configuration files.
- Ensure you are running in a supported shell environment (Linux, macOS, Cloud Shell, or WSL2) and have the required permissions and dependencies (
gcloud,terraform,jq). - Run
./deploy.shand follow the prompts. - Run
./destroy.shwhen you need to tear down the environment.
Disclaimer: These tools perform powerful operations on your Google Cloud environment. Always verify your configuration and backups before running destructive commands.