Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
dreamorosi opened this issue Sep 4, 2023 · 2 comments · Fixed by #1671
Closed

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

dreamorosi opened this issue Sep 4, 2023 · 2 comments · Fixed by #1671
Assignees
Labels
bug Something isn't working completed This item is complete and has been merged/shipped parameters This item relates to the Parameters Utility

Comments

@dreamorosi
Copy link
Contributor

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

@dreamorosi dreamorosi added bug Something isn't working triage This item has not been triaged by a maintainer, please wait labels Sep 4, 2023
@dreamorosi dreamorosi self-assigned this Sep 4, 2023
@dreamorosi dreamorosi added parameters This item relates to the Parameters Utility confirmed The scope is clear, ready for implementation and removed triage This item has not been triaged by a maintainer, please wait labels Sep 4, 2023
@dreamorosi dreamorosi linked a pull request Sep 4, 2023 that will close this issue
9 tasks
@github-project-automation github-project-automation bot moved this from Working on it to Coming soon in Powertools for AWS Lambda (TypeScript) Sep 4, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Sep 4, 2023

⚠️ COMMENT VISIBILITY WARNING ⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

@github-actions github-actions bot added pending-release This item has been merged and will be released soon and removed confirmed The scope is clear, ready for implementation labels Sep 4, 2023
@github-actions
Copy link
Contributor

This is now released under v1.13.0 version!

@github-actions github-actions bot added completed This item is complete and has been merged/shipped and removed pending-release This item has been merged and will be released soon labels Sep 18, 2023
@dreamorosi dreamorosi moved this from Coming soon to Shipped in Powertools for AWS Lambda (TypeScript) Sep 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working completed This item is complete and has been merged/shipped parameters This item relates to the Parameters Utility
Projects
1 participant