Skip to main content

Landing Zone as a Service - AWS Account Factory Automation Command Line Interface

Project description

LZaaS CLI

๐Ÿš€ Landing Zone as a Service - Command Line Interface

A powerful CLI tool for managing AWS Account Factory (AFT) through GitOps Infrastructure as Code principles.

Version Status License LZaaS

Overview

LZaaS CLI v1.0.0 provides a streamlined interface for:

  • Account Migration Planning: Plan and preview AWS account migrations between Organizational Units
  • Beautiful CLI Interface: Rich tables, animations, and comprehensive dry-run capabilities
  • AWS Organizations Integration: Discover accounts and OUs automatically
  • Infrastructure as Code: Generate Terraform previews and Pull Request details
  • Migration Status Monitoring: Track ongoing and completed migrations

๐Ÿš€ Quick Start

Option 1: Install from PyPI (Recommended)

# Create and activate virtual environment
python -m venv lzaas-env
source lzaas-env/bin/activate  # On Windows: lzaas-env\Scripts\activate

# Install from PyPI
pip install lzaas-cli

# Initialize configuration
lzaas config init

# Test with a dry-run migration
lzaas migrate simple --source spitzkop --target sandbox --dry-run

# Create your first account
lzaas account create --template dev --email dev@company.com --client-id your-team

Option 2: Install from Source (Development)

# Create and activate virtual environment
python -m venv lzaas-env
source lzaas-env/bin/activate  # On Windows: lzaas-env\Scripts\activate

# Clone the repository
git clone https://github.com/Cloud-Cockpit/sse-landing-zone.git
cd sse-landing-zone/lzaas-cli

# Install in development mode
pip install -e .

# Using install script
./install-lzaas.sh

# Initialize configuration
lzaas config init

# Test with a dry-run migration
lzaas migrate simple --source spitzkop --target sandbox --dry-run

# Create your first account
lzaas account create --template dev --email dev@company.com --client-id your-team

Uinstall LZaaS CLI

./uninstall-lzaas.sh

๐Ÿ“š Documentation

See the development Installation Guide for development environment detailed setup instructions.

Technical Documentation

โœจ Key Features

Beautiful Migration Planning

# Plan account migration with beautiful output
lzaas migrate simple --source spitzkop --target sandbox --dry-run

Example Output:

๐Ÿ”„ Infrastructure as Code Account Migration
All changes will be made through Git repository updates

        ๐Ÿ—๏ธ Infrastructure as Code Migration Plan
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”“
โ”ƒ Field            โ”ƒ Value                            โ”ƒ
โ”กโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ฉ
โ”‚ Source Account   โ”‚ SPITZKOP (198610579545)          โ”‚
โ”‚ Current Location โ”‚ Root                             โ”‚
โ”‚ Target OU        โ”‚ Sandbox (ou-lcnt-dmpxlwlu)       โ”‚
โ”‚ Repository       โ”‚ Cloud-Cockpit/sse-landing-zone   โ”‚
โ”‚ Method           โ”‚ Git-based Infrastructure as Code โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ“ Repository Changes:
  ~ terraform/live/account-factory/lzaas-account-198610579545.tf (create/update)
  ~ terraform/live/account-factory/lzaas-metadata.tf (update)

๐Ÿ” DRY RUN MODE - No changes will be made

AWS Organizations Discovery

# List all available Organizational Units
lzaas migrate list-ous

# Check migration status
lzaas migrate status

Configuration Management

# Initialize configuration
lzaas config init

# Show current configuration
lzaas config show

# Validate AWS connectivity
lzaas config validate

๐Ÿ“‹ Essential Commands

Migration Commands

# Plan account migration (dry-run mode)
lzaas migrate simple --source ACCOUNT_NAME --target TARGET_OU --dry-run

# List available Organizational Units
lzaas migrate list-ous

# Check migration status
lzaas migrate status

# Filter status by account or OU
lzaas migrate status --account-id 123456789012
lzaas migrate status --ou "Development"

Configuration Commands

# Initialize configuration
lzaas config init

# Show current configuration
lzaas config show

# Validate configuration and AWS access
lzaas config validate

# Update specific configuration values
lzaas config set github.organization "your-org"
lzaas config set aws.profile "your-profile"

Account Management Commands

# Create new account request
lzaas account create --name "MyAccount" --email "admin@example.com" --ou "Development"

# List account requests
lzaas account list

# Show account request details
lzaas account show REQUEST_ID

Template Commands

# List available templates
lzaas template list

# Show template details
lzaas template show TEMPLATE_NAME

# Validate template
lzaas template validate TEMPLATE_NAME

Information Commands

# Show CLI version
lzaas --version

# Show help for any command
lzaas COMMAND --help

# Show general help
lzaas --help

๐Ÿ—๏ธ Architecture

LZaaS CLI v1.0.0 follows Infrastructure as Code principles:

LZaaS CLI โ†’ AWS Organizations โ†’ Migration Planning โ†’ Terraform Preview โ†’ GitHub PR (mock)

v1.0.0 Features:

  • โœ… Complete Migration Planning: Full dry-run capabilities with beautiful output
  • โœ… AWS Organizations Integration: Real account and OU discovery
  • โœ… Terraform Preview Generation: Shows exact code that would be created
  • โœ… Mock GitHub Integration: Demonstrates PR workflow without actual changes
  • โœ… Account ID-based Naming: Terraform-compatible file naming
  • โœ… Rich CLI Interface: Tables, animations, and progress indicators

Coming in Future Releases:

  • ๐Ÿ”„ Full GitHub Integration: Actual repository modifications and PR creation
  • ๐Ÿ”„ Advanced Migration Workflows: Complex multi-account migrations
  • ๐Ÿ”„ Enhanced Templates: More sophisticated account configurations
  • ๐Ÿ”„ Monitoring Dashboard: Real-time migration status tracking

โš™๏ธ Prerequisites

  • Python 3.8+ with pip
  • AWS CLI configured with appropriate credentials
  • AWS SSO session (if using SSO)
  • AWS Organizations access in your management account
  • Organizational Units configured for migration targets

๐Ÿ”ง Configuration

AWS Authentication

# Check AWS configuration
aws sts get-caller-identity

# If using SSO, login first
aws sso login --profile your-profile

LZaaS Configuration

# Initialize LZaaS configuration
lzaas config init

# This will prompt you for:
# - AWS profile name
# - AWS region
# - GitHub organization (for future releases)
# - Repository settings

๐ŸŽฏ Account Templates

Template Purpose Security Level Use Case
dev Development Standard Feature development, testing
staging Pre-production Production-like UAT, integration testing
production Live workloads Maximum Production deployments
sandbox Experimentation Basic Learning, individual testing

๐Ÿ” Troubleshooting

Common Issues

AWS Authentication Errors:

# Error: "The SSO session associated with this profile has expired"
aws sso login --profile your-profile

Permission Errors:

# Ensure your AWS user/role has these permissions:
# - organizations:ListAccounts
# - organizations:ListOrganizationalUnitsForParent
# - organizations:ListRoots
# - organizations:DescribeAccount
# - organizations:DescribeOrganizationalUnit

Configuration Issues:

# Reset configuration
rm ~/.lzaas/config.yaml
lzaas config init

Debug Mode

# Run any command with debug output
lzaas --debug migrate simple --source spitzkop --target sandbox --dry-run

๐Ÿ“ž Support

Access Documentation via CLI

# Complete user guide with business logic
lzaas docs user-guide

# Quick command reference
lzaas docs quick-reference

# Installation instructions
lzaas docs installation

# List all available documentation
lzaas docs list

๐ŸŽ‰ What's New in v1.0.0

  • โœ… Beautiful CLI Interface: Rich tables, animations, and comprehensive output
  • โœ… Complete Migration Planning: Full dry-run capabilities with Terraform previews
  • โœ… AWS Organizations Integration: Real-time account and OU discovery
  • โœ… Infrastructure as Code: Generate complete Terraform code and PR details
  • โœ… Account ID-based Architecture: Terraform-compatible file naming and structure
  • โœ… Mock GitHub Integration: Demonstrates full workflow without actual changes
  • โœ… Comprehensive Documentation: Getting started guide and user documentation

๐Ÿ“ˆ Version Information

Current Version: v1.0.0 (October 7, 2025)

Installation Methods:

  • PyPI Package: pip install lzaas-cli (gets v1.0.0)
  • Source Repository: pip install -e . (gets v0.0.post19+dirty for development)

Version Display: The CLI dynamically retrieves version information, so you'll see the correct version whether installed from PyPI or source.


๐Ÿ’ก Pro Tip: Start with the Getting Started Guide for complete installation instructions, configuration setup, and your first migration planning session!

๐Ÿš€ Ready to get started? Install LZaaS CLI and plan your first account migration in minutes!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lzaas_cli-1.0.1.tar.gz (91.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lzaas_cli-1.0.1-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file lzaas_cli-1.0.1.tar.gz.

File metadata

  • Download URL: lzaas_cli-1.0.1.tar.gz
  • Upload date:
  • Size: 91.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.18

File hashes

Hashes for lzaas_cli-1.0.1.tar.gz
Algorithm Hash digest
SHA256 3de71e5b374d3dba2373c4ad8e6f1df8137ac400c14db28138054dbc36ca50b5
MD5 f1ad2ed103bf8cc07fbb209a886e064a
BLAKE2b-256 2af3f5fa91a9f1d79ee6da979fc3bf6c797afb4029c31caf2378ae0c6b6dd072

See more details on using hashes here.

File details

Details for the file lzaas_cli-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: lzaas_cli-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 7.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.18

File hashes

Hashes for lzaas_cli-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2412b86385610993a2e79349e596414794cc354f02b65ef0e7bdd6d7d3dbce94
MD5 00eb7cdaa26581da371115b3317a8986
BLAKE2b-256 ad733de48b0ad8b136668915bc1a1ce5be042b5e185d43ea2f132ce63c02903a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page