Menu
AWS re:Invent 2025 - Best practices for performing custom code transformation with agentic AI-MAM344

AWS re:Invent 2025 - Best practices for performing custom code transformation with agentic AI-MAM344

AWS Events

4 views 3 months ago

Video Summary

The video introduces AWS Transform Custom, a new service designed to address technical debt and facilitate large-scale code modernization. Traditional methods like rule-based automation and general-purpose coding AIs have limitations in consistency and scalability. AWS Transform Custom aims to overcome these by offering a user-friendly, automation-focused mechanism that learns and improves over time. The service allows users to define custom code transformations using natural language, which the AI then interprets and applies, with features for continuous learning and collaborative refinement. A key insight is that the tool can handle complex, organization-specific transformations, even for proprietary libraries, by learning from provided documentation and examples, significantly reducing manual effort and costs associated with technical debt.

One particularly interesting fact is that AWS Transform Custom can convert VBA script embedded in Excel spreadsheets into maintainable Python code, showcasing its versatility beyond typical software development scenarios. This flexibility, combined with its scalability and cost-effectiveness, positions it as a powerful solution for managing the ever-present challenge of technical debt across diverse codebases and scenarios.

Short Highlights

  • Technical debt is a significant problem that costs money, slows innovation, and introduces security vulnerabilities.
  • Existing code modernization approaches like rule-based automation and general coding AIs have limitations in flexibility, consistency, and scalability.
  • AWS Transform Custom offers a scalable, low-barrier-to-entry mechanism for custom code transformations, designed for automation.
  • The service learns from user input and past executions, continuously improving its transformations.
  • Pre-built transformations are available for common tasks like language and SDK version upgrades, with custom transformations capable of handling organization-specific needs, including proprietary libraries.
  • The pricing is usage-based, designed to be affordable and incentivize large-scale adoption.
  • Transformations are represented as importable and exportable resources, allowing for organization-wide distribution and IP protection.
  • A companion web application provides a dashboard for monitoring transformation campaigns and visualizing progress.
  • The tool can handle various code types, from Lambda functions and Java applications to even VBA scripts within Excel.
  • Batch processing and integration into existing CI/CD pipelines are supported for large-scale execution.

Key Details

#### Technical Debt and Existing Solutions [00:46]

  • Technical debt incurs significant costs in terms of money, time, and slowed innovation, and can lead to security vulnerabilities and difficulty in hiring developers.
  • Types of technical debt include security and compliance risks, maintenance burdens, performance limitations, and strategic misalignment due to acquisitions or evolving technology stacks.
  • Existing approaches like rule-based automation (e.g., as-grep, OpenRewrite) are deterministic but brittle and require specialized expertise.
  • General-purpose coding AIs are powerful but struggle with enforcing consistency across multiple developers or large-scale tasks, often requiring human-in-the-loop interaction, which is costly for repetitive tasks. Learnings from these interactions can remain siloed.

"generally speaking, tech debt bad."

#### AWS Transform Custom: A New Approach [07:21]

  • AWS Transform Custom is designed to address the need for scalable, automated code transformation with a low barrier to entry.
  • It allows users to teach the agent custom code transformations for various needs like API upgrades, runtime upgrades, or framework upgrades.
  • The service is intended to be easily scriptable, run in a headless fashion, and facilitate the sharing and reuse of learnings across teams.
  • The core components include a CLI that interacts with the agent using natural language, encoding AWS's best practices for code modernization.
  • It asks clarifying questions to gather necessary context like API documentation, examples, or schemas, reducing the need for deep domain expertise from the user.
  • Transformations can be executed via the CLI, either interactively or non-interactively, and can be scripted for automated workflows.

"you can teach it your own custom code transformation, you can do your weird stuff with it, which is cool."

#### Transformation Definitions and Registries [11:06]

  • A "transformation definition" represents the agent's understanding of a specific code transformation, comprising markdown files, RAG, and a database of learned insights.
  • This definition is considered intellectual property (IP) of the user and is not shared or learned from by AWS.
  • Users create an initial definition, test and refine it iteratively with the agent, providing feedback until satisfied.
  • Transformation definitions are stored in a registry within an AWS account, making them discoverable and shareable with other users in the organization via IAM permissions.
  • Transformations are ARN-able AWS resources, leveraging existing AWS permissioning and resource management concepts.

"this is something that we consider to be your IP. We don't look at it. We don't learn from it."

#### Execution and Continuous Learning [13:10]

  • Transformations can be executed at scale through push campaigns (central team performs transformations) or pull campaigns (application teams are mandated to use the tool).
  • Human verification is a key step, and the system incorporates continuous learning by recording insights from execution and interactive sessions.
  • If an agent encounters an incompatibility or needs to backtrack, it learns from this experience to optimize future executions.
  • Interactive sessions allow users to guide the agent, and these corrections are remembered for subsequent runs.

"The humans verify and the continual learning goes back into the transformation definition."

#### Available and Custom Transformations [13:15]

  • AWS provides pre-built, out-of-the-box transformations for common tasks like Java, Python, and Node.js runtime upgrades, and AWS SDK version upgrades.
  • Early access transformations include a comprehensive codebase analysis tool that generates documentation, diagrams, dependency trees, and identifies technical debt.
  • Another early access feature is an upgrade for Java code to support Graviton processors.
  • Users can build fully custom transformations for scenarios like VBA to Python conversion, or language-to-language conversions for self-contained code segments, though large-scale rewrites are cautioned against.

"we've built a whole bunch of transformations that we thought were useful using this and we have done some pretty comprehensive benchmarking on them."

#### Best Practices and Workflow Integration [15:39]

  • Start with pilots to build and test transformations at a small scale to gauge efficacy and cost.
  • Pricing is usage-based on agent minutes, with a typical thousand-line Lambda costing around $1.
  • The tool is designed to integrate seamlessly into existing workflows, requiring minimal dependencies (Node, Git, AWS connection).
  • It can be run in various environments like Linux, macOS, WSL, CI/CD pipelines, Docker containers, or AWS Batch jobs.
  • The AWS Transform web application offers a dashboard for visualizing campaign status, charts, and graphs, and allows for agent-based querying of the data.

"use your current workflow. There's a lot of code transformation products out there that I've seen that kind of ask you to onboard to a totally new way of doing things. And I think that's lame."

#### Live Demo: Python Runtime Upgrade [19:15]

  • The demo showcases the CLI in both interactive and non-interactive modes.
  • Out-of-the-box transformations include SDK v1 to v2 upgrades, Python/NodeJS runtime upgrades, and comprehensive codebase analysis.
  • A Python runtime upgrade (3.8 to 3.13) for a Lambda function is executed, demonstrating automated modernization, test case addition, and documentation updates.
  • The tool creates a local branch for changes, allowing for review and rollback.
  • The process can take time, as the focus is on correctness over speed, but ongoing work aims to improve performance.

"We are working to make it a little quicker, but we figured it's better to be slow and right than fast and wrong."

#### Live Demo: Custom Library Migration [27:17]

  • This demo illustrates creating a custom transformation for migrating an internal Amazon ticketing system from "Fluxo" to "Tickety."
  • The agent is fed a migration guide from a private GitHub repository to learn the specific transformation rules.
  • The process is shown in interactive mode, where the agent asks for details about the libraries, functionalities, and programming languages.
  • It leverages an MCP server to pull context from internal repositories.
  • The transformation definition includes clear objectives, entry criteria (identifying code using Fluxo), step-by-step implementation instructions, and validation criteria.
  • The agent plans, executes, and validates the transformation, with options for human review of the plan and execution.

"The large language models does not know what what what the hell is flux or tity, right? That's where I'm going to give more information, right?"

#### Live Demo: Codebase Analysis and Batch Execution [48:15]

  • The comprehensive codebase analysis transformation is demonstrated on the old "Doom" game engine code.
  • It generates detailed documentation, including overview, file inventory, architecture diagrams, component maps, dependency trees, and analysis of patterns, behavior, and error handling.
  • It also identifies technical debt, security vulnerabilities, and outdated platform dependencies.
  • The batch mode execution is shown, where the CLI is wrapped in a script to run the documentation analysis across multiple GitHub repositories in parallel.
  • This highlights the ability to automate transformations at scale across an organization's codebase.

"It's like every way you could think of to represent code without having the code itself. we try to to capture in here."

#### Knowledge Items and Continuous Learning [53:40]

  • Knowledge items represent the continuous learning aspect of the tool, storing insights from agent executions.
  • These items are disabled by default, requiring human review and enablement before being applied to future transformations.
  • Examples include identifying incompatibilities between Java sealed classes and JPA, or project-specific issues like those found in the SolarWinds project.
  • This mechanism ensures that learnings are captured, validated, and can be systematically incorporated to improve transformation accuracy over time.

"these knowledge items when they are created they're disabled by default which means a human in the loop can review it and if they want to apply it for the next time they can enable it."

Other People Also See