-
Notifications
You must be signed in to change notification settings - Fork 173
Closed
Labels
completedThis item is complete and has been merged/shippedThis item is complete and has been merged/shippedfeature-requestThis item refers to a feature request for an existing or new utilityThis item refers to a feature request for an existing or new utilityparametersThis item relates to the Parameters UtilityThis item relates to the Parameters Utility
Milestone
Description
Use case
The upcoming Parameters utility should allow customers to pass their own AWS SDK v3 client to a given provider.
This is useful for those cases in which a client is already available, for tracing the requests made by the client, or for testing (injection).
The feature is supported by the Python's version and already present in the documentation, however the implementation was left out initially.
Solution/User Experience
Note
The example below shows theSSMProvider
, but the feature should be supported by all other providers that use clients
import { SSMProvider } from '@aws-lambda-powertools/parameters/ssm';
import { SSMClient } from '@aws-sdk/client-ssm';
// construct your clients with any custom configuration
const ssmClient = new SSMClient({ region: 'us-east-1' });
// pass the client to the provider
const parametersProvider = new SSMProvider({ awsSdkV3Client: ssmClient });
export const handler = async (): Promise<void> => {
// Retrieve a single parameter
const parameter = await parametersProvider.get('/my/parameter');
console.log(parameter);
};
Alternative solutions
N/A
Acknowledgment
- This feature request meets Lambda Powertools Tenets
- Should this be considered in other Lambda Powertools languages? i.e. Python, Java
darivera-fender
Metadata
Metadata
Assignees
Labels
completedThis item is complete and has been merged/shippedThis item is complete and has been merged/shippedfeature-requestThis item refers to a feature request for an existing or new utilityThis item refers to a feature request for an existing or new utilityparametersThis item relates to the Parameters UtilityThis item relates to the Parameters Utility