Skip to content

Bug: DynamoDBProvider not tokenizing projection values/names correctly #1238

Closed
@dreamorosi

Description

@dreamorosi

Expected Behaviour

As a customer, when using the DynamoDBProvider part of the Parameters utility, I want to be able to retrieve values from a DynamoDB Table that uses any of the reserved words as attribute name.

In order to allow this, the provider should be able to transparently tokenize these words under the hood.

Current Behaviour

At the moment, using any of the reserved words as attribute name causes the SDK client to throw an error as they are not tokenized.

Code snippet

const provider = new DynamoDBProvider({
  tableName: 'some-table',
  valueAttr: 'value' // <- this is a reserved word
});

Possible Solution

Use the ExpressionAttributeNames field in the query requests.

Steps to Reproduce

N/A

AWS Lambda Powertools for TypeScript version

latest

AWS Lambda function runtime

18.x

Packaging format used

Npm

Execution logs

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcompletedThis item is complete and has been merged/shippedparametersThis item relates to the Parameters Utility

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions