Skip to main content

ASAP CLI Tool

Project description

๐Ÿš€ ASAP CLI - AWS Migration Assistant

ASAP (AWS SQL Analytics Platform) is an AI-powered CLI tool designed to accelerate SQL and ETL migrations to AWS. Built by the AWS ProServ Data & Analytics Latam Team, it provides expert-level migration assistance with interactive guidance and validation.

๐ŸŽฏ Overview

ASAP CLI leverages advanced AI agents to:

  • Migrate SQL/ETL from legacy platforms (Oracle, Teradata, SQL Server) to AWS services
  • Optimize queries for performance and cost efficiency
  • Assess migration complexity and risks
  • Generate implementation roadmaps with step-by-step guidance
  • Suggest AWS-native architectures using Glue, EMR, Redshift, and Athena
  • Validate data quality and provide testing strategies

โœจ Key Features

๐Ÿ”„ SQL/ETL Migration

  • Multi-platform support: Oracle, Teradata, SQL Server โ†’ AWS
  • Target platforms: Amazon Redshift, Spark SQL, AWS Glue
  • Interactive migration process with feedback loops
  • Semantic preservation of business logic and data types

โšก Query & Transformation Optimization

  • Performance tuning recommendations
  • Cost optimization strategies
  • AWS-specific optimizations (DISTKEY, SORTKEY, partitioning)

๐ŸŽฏ Expert Migration Assessment

  • Complexity and risk analysis
  • Compatibility issue identification
  • Business rules validation
  • Migration readiness evaluation

๐Ÿ“‹ Implementation Planning

  • Detailed migration roadmaps
  • Step-by-step execution plans
  • Field mapping documentation
  • Test case generation

๐Ÿ—๏ธ AWS Architecture Guidance

  • Service recommendations (Glue, EMR, Redshift, Athena)
  • Best practices implementation
  • Performance optimization
  • Security considerations

๐Ÿ› ๏ธ Debug & Validation Tools

  • SQL debugging and correction
  • Data quality validation
  • Test result comparison
  • Automated fixing with explanations

๐Ÿš€ Quick Start

Prerequisites

  • Python 3.10+
  • AWS CLI configured with appropriate permissions
  • AWS Bedrock access (Claude models)
  • Git for version control

Installation

  1. Clone the repository:

    git clone git@ssh.gitlab.aws.dev:jorsie/asap-cli.git
    cd asap-cli
    
  2. Install dependencies:

    pip install -r requirements.txt
    
  3. Install the CLI tool:

    pip install -e .
    
  4. Set up aws account:

    1. Go to your aws account.
    2. Create user with access granted to aws bedrock.
    3. Configure your acces key and secret acces key for aws cli.
    4. Activate your aws cli profile.
    5. Go to aws bedrock and ensure access to Claude 3.7 Sonnet and Claude Sonnet 4

Altenative Installation

  1. pip install asap-cli
    
  2. Set up aws account:

    1. Go to your aws account.
    2. Create user with access granted to aws bedrock.
    3. Configure your acces key and secret acces key for aws cli.
    4. Activate your aws cli profile.
    5. Go to aws bedrock and ensure access to Claude 3.7 Sonnet and Claude Sonnet 4

Usage

Start the interactive migration assistant:

asap agent run

The CLI will guide you through:

  1. Pipeline identification - Name your migration pipeline
  2. Source platform - Specify your current SQL dialect
  3. Target platform - Choose your AWS destination
  4. Migration execution - Follow interactive prompts
  5. Validation & debugging - Test and refine results

๐Ÿ“– Usage Examples

Example 1: SQL Server to Redshift Migration

asap agent run
โ”œโ”€โ”€ migration/                 # Migration workspace
โ”‚   โ””โ”€โ”€ {pipeline_name}/
โ”‚       โ”œโ”€โ”€ source/           # Source SQL files
  1. The first you need to do is open the directory in your terminal where you are gonna work
  2. Create the migration directory and inside that create a new folder with the pipeline name
  3. Inside the pipeline name folder add new folder call source and inside this folder create the .sql file you want to migrate. (The system accept .sql and .txt files)
  4. After that you are ready to make it your firts migration.

Command example

aws-proserv:~$ I need to migrate my sales pipeline from SQL Server to Redshift

# The agent will:
# 1. Ask for pipeline name: "sales"
# 2. Request source SQL files in migration/sales/source/
# 3. Generate assessment and translation
# 4. Provide interactive feedback loop
# 5. Output optimized Redshift SQL

Example 2: Debugging SQL Issues

โ”œโ”€โ”€ migration/                 # Migration workspace (use this as an example)
โ”‚   โ””โ”€โ”€ {pipeline_name}/
โ”‚       โ”œโ”€โ”€ source/           # Source SQL files
โ”‚       โ”œโ”€โ”€ target_sql/       # Translated SQL output
โ”‚       โ”œโ”€โ”€ assessment/       # Migration assessments
โ”‚       โ”œโ”€โ”€ expected_result/  # Test expected results
โ”‚       โ””โ”€โ”€ query_result/     # Actual test results

For debugging firts you need to extract two main things:

  1. Get an expected result of your query, this is the result from your source sql. Save in expected_result folder inside your pipeline name folder.

  2. Get the actual result form the target sql query, this is result you obtain after execute the same values with the target sql query. Save in query_result folder Note: The system only recieve files in .csv format.

  3. For the expected_result and query_result you have to assign the same name, this name is your test case name.ย  The agent use that to make the debugging procees. You could have more that one test case, the only rule you have to follow is same name for each expected_result and query_result files and not repeat test case names.

Example 2: Example on command

aws-proserv:~$ Debug my customer_analytics pipeline with test case "revenue_calculation"

# The agent will:
# 1. Compare expected vs actual results
# 2. Identify discrepancies
# 3. Fix the SQL with explanations
# 4. Save corrected version

๐Ÿ—๏ธ Project Structure

asap-cli/
โ”œโ”€โ”€ asap/
โ”‚   โ”œโ”€โ”€ cli.py                 # Main CLI entry point
โ”‚   โ””โ”€โ”€ agent/
โ”‚       โ”œโ”€โ”€ main.py            # Agent command registration
โ”‚       โ””โ”€โ”€ utils/
โ”‚           โ”œโ”€โ”€ agents/
โ”‚           โ”‚   โ”œโ”€โ”€ config.py              # Agent configuration
โ”‚           โ”‚   โ”œโ”€โ”€ factory_agent.py       # Agent factory
โ”‚           โ”‚   โ”œโ”€โ”€ migration_assistant_agent.py  # Core agent logic
โ”‚           โ”‚   โ””โ”€โ”€ tools/
โ”‚           โ”‚       โ”œโ”€โ”€ translate/         # SQL translation tools
โ”‚           โ”‚       โ”œโ”€โ”€ debug/             # Debugging tools
โ”‚           โ”‚       โ””โ”€โ”€ general/           # Shared utilities
โ”‚           โ””โ”€โ”€ general/
โ”‚               โ””โ”€โ”€ ui.py                  # User interface utilities
โ”œโ”€โ”€ migration/                 # Migration workspace (use this as an example)
โ”‚   โ””โ”€โ”€ {pipeline_name}/
โ”‚       โ”œโ”€โ”€ source/           # Source SQL files
โ”‚       โ”œโ”€โ”€ target_sql/       # Translated SQL output
โ”‚       โ”œโ”€โ”€ assessment/       # Migration assessments
โ”‚       โ”œโ”€โ”€ expected_result/  # Test expected results
โ”‚       โ””โ”€โ”€ query_result/     # Actual test results
โ”œโ”€โ”€ requirements.txt          # Python dependencies
โ”œโ”€โ”€ pyproject.toml           # Package configuration
โ””โ”€โ”€ README.md               # This file

๐Ÿ”ง Configuration

AWS Bedrock Models

ASAP CLI uses multiple Claude models for different tasks:

  • Primary: us.anthropic.claude-sonnet-4-20250514-v1:0
  • Fallback: us.anthropic.claude-3-7-sonnet-20250219-v1:0

๐Ÿ“š Documentation

Core Components

  • MigrationAssistantAgent: Main conversational agent with tool integration
  • TranslateSQL Tool: Handles SQL dialect conversion and optimization
  • DebugSQL Tool: Identifies and fixes SQL issues with explanations
  • BedrockLLamager: Manages AWS Bedrock model interactions with failover

Migration Process

  1. Assessment Phase:

    • Analyzes source SQL complexity
    • Identifies compatibility issues
    • Maps business rules and requirements
  2. Translation Phase:

    • Converts SQL to target dialect
    • Applies AWS-specific optimizations
    • Preserves semantic accuracy
  3. Validation Phase:

    • Compares expected vs actual results
    • Provides debugging assistance
    • Generates corrected SQL with explanations

๐Ÿ” Troubleshooting

Common Issues

"Could not load agent command"

# Ensure Python path includes the project directory
export PYTHONPATH="${PYTHONPATH}:$(pwd)"

AWS Bedrock Access Denied

# Verify AWS credentials and Bedrock access
aws bedrock list-foundation-models --region us-east-1

Migration Files Not Found

# Ensure proper directory structure
mkdir -p migration/{pipeline_name}/{source,target_sql,assessment,expected_result,query_result}

๐Ÿ“Š Supported Platforms

Source Platforms

  • Oracle (PL/SQL, Oracle SQL)
  • Teradata (Teradata SQL)
  • Microsoft SQL Server (T-SQL)
  • Generic SQL (ANSI SQL)
  • Other SQL platforms (ANSI SQL)

Target Platforms

  • Amazon Redshift (PostgreSQL-based)
  • Spark SQL (Apache Spark)
  • AWS Glue (PySpark/Scala)
  • Amazon Athena (Presto SQL)

๐Ÿ‘ฅ Team

Developed by: AWS ProServ Data & Analytics Latam Team
Author: Jorge Sierra (jorsie@amazon.com)
Version: 0.0.1

๐Ÿ†˜ Support

For support and questions:

  • Internal AWS Users: Contact the ProServ Data & Analytics Latam Team, jorsie on slack
  • Issues: Use the internal GitLab issue tracker

๐Ÿš€ Ready to accelerate your data migration journey with AWS ProServ expertise!

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

asap_cli-0.0.4.tar.gz (6.7 MB view details)

Uploaded Source

Built Distribution

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

asap_cli-0.0.4-py3-none-any.whl (6.8 MB view details)

Uploaded Python 3

File details

Details for the file asap_cli-0.0.4.tar.gz.

File metadata

  • Download URL: asap_cli-0.0.4.tar.gz
  • Upload date:
  • Size: 6.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for asap_cli-0.0.4.tar.gz
Algorithm Hash digest
SHA256 02c25442629953cc9dcacecbf5d58e7860b785fd64401cf56d7c77c2930cd024
MD5 9583432efdaee695b8e6486993c04a26
BLAKE2b-256 e9f94c9e9407e2b684d10fb26ae0eb903be4792d354b4d22429b1577a8b32eef

See more details on using hashes here.

File details

Details for the file asap_cli-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: asap_cli-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 6.8 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for asap_cli-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 0a7627de817b9f516f95b9cd2d48f7e951d95a95f0b4889a2ee0b0039eab2bc6
MD5 ca134076a526a0fb5c5de2ce0490eada
BLAKE2b-256 5ec6ad9414c255a2cbc82c36edc00eebd7355d0c6a07961722b58254d4365c8b

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