0.2.5 • Published 5 months ago

@androbinco/robin-terraform v0.2.5

Weekly downloads
-
License
MIT
Repository
-
Last release
5 months ago

Robin Terraform CLI

CLI tool to fetch Terraform configurations for GCP and AWS services.

Installation

Global Installation

# Using npm
npm install -g @androbinco/robin-terraform

# Using pnpm
pnpm add -g @androbinco/robin-terraform

Using npx (No Installation Required)

You can use the CLI without installing it globally by using npx:

# Basic usage
npx @androbinco/robin-terraform fetch gcp cloudrun

# List available services
npx @androbinco/robin-terraform list

# Show configuration files
npx @androbinco/robin-terraform show gcp cloudrun

# Clean up
npx @androbinco/robin-terraform clean

Local Development

If you're working on the CLI locally:

# Clone the repository
git clone https://github.com/your-org/robin_monorepo-cli.git
cd robin_monorepo-cli

# Install dependencies
pnpm install

# Run the CLI locally
pnpm --filter @androbinco/robin-terraform start

# Or use npx with local path
npx ./packages/robin-terraform-cli/src/index.js fetch gcp cloudrun

Usage

Fetch Terraform configuration

# Interactive mode - shows provider selection then service
robin-terraform fetch

# Fetch specific provider and service
robin-terraform fetch gcp cloudrun
robin-terraform fetch gcp lb
robin-terraform fetch gcp cloudbuild
robin-terraform fetch gcp bucket
robin-terraform fetch gcp database

Specify target directory

robin-terraform fetch gcp cloudrun --path ./infrastructure

Force overwrite

robin-terraform fetch gcp cloudrun --force

List available configurations

# List all providers and services
robin-terraform list

# List services for specific provider
robin-terraform list gcp

# Show all with --list flag
robin-terraform fetch --list

Preview configuration files

# List files in a configuration
robin-terraform show gcp cloudrun

# View specific file
robin-terraform show gcp cloudrun main.tf
robin-terraform show gcp cloudrun variables.tf

Clean up

# Remove terraform directory when done
robin-terraform clean

# Remove specific directory
robin-terraform clean --path ./infrastructure

Available Services

GCP

  • cloudrun - Cloud Run service deployment
  • lb - Load Balancer configuration
  • cloudbuild - Cloud Build CI/CD pipeline
  • bucket - Cloud Storage buckets
  • database - Cloud SQL instance

Complete Workflow Example

# 1. Create new project
mkdir my-api && cd my-api

# 2. Get Terraform config for GCP Cloud Run
robin-terraform fetch gcp cloudrun

# 3. Deploy
cd terraform
terraform init
terraform plan
terraform apply

# 4. Clean up
cd ..
robin-terraform clean

Options

CommandOptionsDescription
fetch--path, -pTarget directory (default: ./terraform)
fetch--force, -fOverwrite existing directory
fetch--list, -lList all providers and services
listproviderOptional: specific provider to list
showRequires: provider, service, file
clean--path, -pDirectory to remove (default: ./terraform)

Examples

Basic usage

# Quick fetch for different services
robin-terraform fetch gcp cloudrun
robin-terraform fetch gcp lb

# Interactive selection
robin-terraform fetch

# Preview before fetching
robin-terraform show gcp cloudrun main.tf
robin-terraform fetch gcp cloudrun

Multi-service deployment

# API service
robin-terraform fetch gcp cloudrun --path ./services/api/terraform

# Load Balancer
robin-terraform fetch gcp lb --path ./services/lb/terraform

# Database
robin-terraform fetch gcp database --path ./services/database/terraform

# Storage
robin-terraform fetch gcp bucket --path ./services/storage/terraform

Working with existing projects

# Check what you're about to overwrite
robin-terraform show gcp cloudrun

# Force update existing terraform
robin-terraform fetch gcp cloudrun --force

# Clean up after deployment
robin-terraform clean

Tips

  • Always review variables.tf after fetching to set your project-specific values
  • Use --path flag to organize multiple terraform configurations
  • Run terraform plan before apply to review changes
  • Use robin-terraform clean to remove terraform files when done
  • Keep your terraform state files in a backend (GCS, S3) for team collaboration

Updating

# Check current version
robin-terraform --version

# Update to latest
npm update -g @androbinco/robin-terraform
# or
pnpm update -g @androbinco/robin-terraform
0.2.5

5 months ago

0.2.4

5 months ago

0.2.3

5 months ago

0.2.2

5 months ago

0.2.1

5 months ago

0.2.0

5 months ago

0.1.0

5 months ago