DEV Community

Cover image for Leveraging IBM Bob for Migrating App Runner to ECS Express Mode by Using Git Diff or Final State
Bervianto Leo Pratama
Bervianto Leo Pratama

Posted on

Leveraging IBM Bob for Migrating App Runner to ECS Express Mode by Using Git Diff or Final State

Background

Based on this documentation, I need to migrate my existing services to ECS Express Mode. However, I was not sure I was using AI effectively to assist with the migration process. As shown in my previous post, I tried one of my more "complex" applications as the first migration. I hope the diff and lessons learned from that effort will help streamline subsequent migrations by leveraging the git diff or the "final state" of the migration.

Migrating the "Same" CDK Code

I attempted the second migration on my CDK code, which uses the same language (TypeScript). I started with the git diff on the first run. Unfortunately, it still tried to rely on older knowledge and crafted detailed ECS service configurations. On the positive side, I did not need to explain or re-prompt regarding the CI/CD setup, as it was already captured in the diff.

In the second chat, I tried to guide IBM Bob to use a specific class. IBM Bob did a great job exploring the library. However, it missed the IAM role, so I asked IBM Bob to investigate it. Surprisingly, IBM Bob was able to understand how the role works without much guidance.

Some Samples

  • First/initial chat

First Chat

  • Second chat

Second chat

  • Role chat

Role chat

Lessons from the Second Migration

I appreciate how IBM Bob can quickly migrate existing services easily and seamlessly. Since it was the same language, I expected the migration to be straightforward, and it largely was.

Costs

It took 4.6 Bob coins.

Migrating Another Language

Migrating CDK in Python

I was genuinely impressed by how IBM Bob tried to follow the rules I set. I asked it to use the diff as a reference for the migration; however, I forgot that the original code was in TypeScript while my target was Python. IBM Bob attempted to create a new script, which makes sense since the migration process should not delete or remove existing code and infrastructure directly.

That was my fault for not being clear enough in the prompt. After I clarified that we should stick with Python, IBM Bob naturally fell back on its previous knowledge, which was the non-express mode approach.

I then asked IBM Bob to explore the CDK library before proceeding. It got close to the goal, but I noticed a slight hallucination — it was not using the correct class. IBM Bob then tried to self-verify by generating a simple CDK script, which was a good approach.

Once the code migration was complete and I kicked off the deployment, I encountered a failure during the first infrastructure initialization due to an outdated config. It turned out I needed to update the config before validating IBM Bob's output. Thankfully, IBM Bob also helped me review both the config and the application to resolve the issue.

Some Chats

  • Guiding IBM Bob back to the goal

IBM Bob use python

  • Hallucination

Hallucination

Costs

It took 12.88 Bob coins. (Higher due to the additional help with reviewing the application and config.)

Migrating My Last Service (in C#)

After the misstep with Python, I was more deliberate this time — I explicitly prompted IBM Bob to keep the C# language and ensure the CI/CD pipeline remained consistent. Even so, I noticed that IBM Bob did not explore the CDK before starting the migration. Once it realized the language was different from the reference, it stopped exploring on its own. I had to prompt it again to continue the CDK exploration.

The first attempt failed because the task execution role was incorrect. After sharing the error in the chat, IBM Bob was able to fix it. I consider this acceptable, given that IBM Bob had to reason across different programming languages as well as the AWS infrastructure specifics.

Some Chats

  • Summary

Summary image

Costs

It took approximately 4.69–6.06 Bob coins.

List of Repositories

Here are the repositories that were migrated (mostly) with IBM Bob.

  1. Tell Me Everything API: TypeScript
  2. Invitation API: TypeScript
  3. my-telegram-bot: Python
  4. SimplePasswordManagerService: C#

Thank you

Thank you for reading. Have a great day!

Great Day GIF

Top comments (0)