Boto3 to AWS SDK for JavaScript v2 Converter

Turn Python boto3 code into TypeScript that uses the aws-sdk v2 package, for projects that haven't moved to v3. v2 reached end-of-support on September 8, 2025.

Your codePython (boto3)
Drop the file to load it
Tab indents · Esc, Tab exits
ResultTypeScript (SDK v2)
Your TypeScript (SDK v2) will appear hereClick Convert to TypeScript or press Ctrl Enter
converted.ts
Don't paste secrets

How to convert boto3 code to AWS SDK v2

  1. Add your codePaste it into the Python (boto3) editor, drag in a file, or keep the sample to see how it works.
  2. Convert to TypeScriptClick the button or press Ctrl + Enter. The result streams into the right-hand editor.
  3. Review and use itCopy or download the result, then test it before you rely on it. AI output is a strong first draft, not a guarantee.

How boto3 maps to AWS SDK for JavaScript v2

In v2, each boto3 call becomes a method on a service client followed by .promise(). sqs.receive_message(QueueUrl=url, MaxNumberOfMessages=10) becomes await sqs.receiveMessage({ QueueUrl: url, MaxNumberOfMessages: 10 }).promise(). Method names change to camelCase, while parameter names stay the same because both SDKs follow the AWS API.

boto3's DynamoDB Table resource maps to AWS.DynamoDB.DocumentClient, which also accepts native values. Paginators become loops that pass NextToken or ContinuationToken into the next request, and except ClientError becomes a catch that checks err.code.

Choose this converter only if the target project is locked to v2. For anything new, the boto3 to SDK v3 converter produces code on the supported, modular SDK.

AWS SDK for JavaScript v2 reached end-of-support on September 8, 2025 and receives no more updates. The Node.js 18 and later Lambda runtimes don't include it, so v2 code must bundle aws-sdk itself.

Tips for better results

  • Prefer the v3 converter when you can. The output is nearly the same length, and you won't need a second migration later.
  • Check paginated loops. Confirm that every loop stops when the response has no next token, and test it with more than one page of results.
  • Match error codes. boto3's err.response["Error"]["Code"] values, like ResourceNotFoundException, appear as err.code in v2.
  • Don't bring credentials across. Remove any hard-coded keys. v2 reads the same environment variables, ~/.aws profiles and IAM roles as boto3.

Frequently asked questions

Should I convert to SDK v2 or v3?

Convert to v3 unless the project must stay on v2 for now. v2 reached end-of-support on September 8, 2025, so new v2 code adds to a migration you'll need later.

Is the output TypeScript or JavaScript?

TypeScript. The aws-sdk v2 package includes its own type definitions. If you need JavaScript, remove the type annotations. The SDK calls don't change.

How are boto3 resources converted?

DynamoDB tables map to the v2 DocumentClient. Other resource calls, like iterating bucket.objects.all(), become the equivalent client calls with a pagination loop.