Skip to content

Feature request: improve return types for Secrets Manager Parameters #1409

Closed
@dreamorosi

Description

@dreamorosi

Use case

Note
This is a follow up issue to #1386 and aims at continuing the work started in #1387

Currently when retrieving parameter values from Secrets Manager, the Parameter utility has somewhat generic return types.

For example, when calling the getSecret function the current return type is a Promise that can resolve to undefined | string | Uint8Array | Record<string, unknown>. These types were chosen because they map to the following cases:

  • string applies when a SecretString value is retrieved and no transform is applied - this also applies when a base64 encoded value stored in a SecretString is retrieved and a binary transform is applied
  • Uint8Array applies when retrieving a SecretBinary value is retrieved an no transform is applied
  • Record<string, unknown> applies whenever a transform: 'json' is applied - in this case Parameters parses the value and returns an object
  • undefined is returned whenever a parameter is not found

Given that the utility knows both the types returned by the API and the transformation to be applied, there's an opportunity to improve the return types by applying some heuristics.

Solution/User Experience

TBD

Alternative solutions

N/A

Acknowledgment

Future readers

Please react with 👍 and your use case to help us understand customer demand.

Metadata

Metadata

Assignees

Labels

completedThis item is complete and has been merged/shippedfeature-requestThis item refers to a feature request for an existing or new utilityparametersThis item relates to the Parameters Utility

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions