Closed
Description
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
Type
Projects
Status
Shipped