You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* If instead you'd like to always ensure you fetch the latest parameter from the store regardless if already available in cache, use the `forceFetch` parameter.
63
+
*
64
+
* @example
65
+
* ```typescript
66
+
* import { SecretsProvider } from '@aws-lambda-powertools/parameters/secrets';
* This object accepts the same options as the [AWS SDK v3 for JavaScript Secrets Manager client](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-secrets-manager/interfaces/getsecretvaluecommandinput.html).
113
+
*
114
+
* ### Customize AWS SDK v3 for JavaScript client
115
+
*
116
+
* By default, the provider will create a new Secrets Manager client using the default configuration.
117
+
*
118
+
* You can customize the client by passing a custom configuration object to the provider.
119
+
*
120
+
* @example
121
+
* ```typescript
122
+
* import { SecretsProvider } from '@aws-lambda-powertools/parameters/secrets';
123
+
*
124
+
* const secretsProvider = new SecretsProvider({
125
+
* clientConfig: { region: 'eu-west-1' },
126
+
* });
127
+
* ```
128
+
*
129
+
* This object accepts the same options as the [AWS SDK v3 for JavaScript Secrets Manager client](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-secrets-manager/interfaces/secretsmanagerclientconfig.html).
130
+
*
131
+
* Otherwise, if you want to use a custom client altogether, you can pass it to the provider.
132
+
*
133
+
* @example
134
+
* ```typescript
135
+
* import { SecretsProvider } from '@aws-lambda-powertools/parameters/secrets';
136
+
* import { SecretsManagerClient } from '@aws-sdk/client-secrets-manager';
137
+
*
138
+
* const client = new SecretsManagerClient({ region: 'eu-west-1' });
139
+
* const secretsProvider = new SecretsProvider({
140
+
* awsSdkV3Client: client,
141
+
* });
142
+
* ```
143
+
*
144
+
* This object must be an instance of the [AWS SDK v3 for JavaScript Secrets Manager client](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-secrets-manager/classes/secretsmanagerclient.html).
145
+
*
146
+
* For more usage examples, see [our documentation](https://awslabs.github.io/aws-lambda-powertools-typescript/latest/utilities/parameters/).
* If instead you'd like to always ensure you fetch the latest parameter from the store regardless if already available in cache, use the `forceFetch` parameter.
50
+
*
51
+
* @example
52
+
* ```typescript
53
+
* import { getSecret } from '@aws-lambda-powertools/parameters/secrets';
* // Retrieve a single secret and pass extra options to the AWS SDK v3 for JavaScript client
84
+
* const secret = await getSecret('my-secret', {
85
+
* sdkOptions: {
86
+
* VersionId: 1,
87
+
* },
88
+
* });
89
+
* };
90
+
* ```
91
+
*
92
+
* This object accepts the same options as the [AWS SDK v3 for JavaScript Secrets Manager client](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-secrets-manager/interfaces/getsecretvaluecommandinput.html).
93
+
*
94
+
* ### Built-in provider class
95
+
*
96
+
* For greater flexibility such as configuring the underlying SDK client used by built-in providers, you can use the {@link SecretsProvider} class.
97
+
*
98
+
* For more usage examples, see [our documentation](https://awslabs.github.io/aws-lambda-powertools-typescript/latest/utilities/parameters/).
99
+
*
100
+
*
101
+
* @param {string} name - The name of the secret to retrieve
102
+
* @param {SecretsGetOptionsInterface} options - Options to configure the provider
0 commit comments