aws / aws/aws-sdk-js-codemod

[Feature]: Support the AWS.DynamoDB.Converter methods

Open
#751 0 comments 1 reaction 0 assignees View on GitHub
enhancement p2
Dominant language
TypeScript
Stars
89
Forks
13
Avg merge
9h 59m
Merged PRs (30d)
1

Description

### Self-service

- [ ] I'd be willing to implement this feature

### Problem

As I'm processing DynamoDB notifications with a lambda function, I have the following code:

```js
const keys = AWS.DynamoDB.Converter.unmarshall(record.dynamodb.Keys);
```
But this is not being converted, just left as is.
Note that the `const AWS = require("aws-sdk");` line is not removed in that case leading to a non running code.

### Solution

Ideally, this should add the following import

```js
const { unmarshall } = require("@aws-sdk/util-dynamodb");
```

and change the code to this

```js
const keys = unmarshall(record.dynamodb.Keys);
```

### Alternatives

Converting manually was easy enough in my case

### Additional context

_No response_

Contributor guide

Open the contributing guide

Research direction

Locate the transform that handles AWS.DynamoDB APIs and its existing tests; the issue does not name a file or test. Reproduce the shown Lambda example, then verify that Converter.unmarshall is replaced with util-dynamodb's unmarshall, the required import is added, and the unused aws-sdk import is removed.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, javascript, node.js
Domain
databases, tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.