Skip to content

Bug: Secrets Manager & DynamoDB providers incorrect undefined return type #1670

Closed
@dreamorosi

Description

@dreamorosi

Expected Behaviour

The Parameters utility supports adaptive return types based on the transform passed when retrieving the value.

Retrieving a value with any provider and using any option other than transform (i.e. getSecret('my-secret', { maxAge: 10 })) the return type should be the same as when no option is passed, which is the default return type for that provider.

Current Behaviour

Currently, with Secrets Manager and DynamoDB, when retrieving a value with options but without specifying any transform, the return type gets set to undefined (see code snippet below).

Code snippet

const result = await getSecret('my-secret', { maxAge: 10 });
//        ^ is typed as undefined

Steps to Reproduce

N/A

Possible Solution

Review return types and account for this case.

Powertools for AWS Lambda (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

Status

Shipped

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions