generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 180
Closed
Labels
completedThis item is complete and has been merged/shippedThis item is complete and has been merged/shippeddocumentationImprovements or additions to documentationImprovements or additions to documentationparametersThis item relates to the Parameters UtilityThis item relates to the Parameters Utility
Description
What were you searching in the docs?
Subsequent calls to getAppConfig for different applications/environments fail. Looking at its implementation it make sense because the environment as well as the application arguments are cached.
Therefore, something like this fails with some unintuitive "ConfigurationNotFound" error:
import { getAppConfig } from '@aws-lambda-powertools/parameters/appconfig';
// This works just fine
let config = await getAppConfig('config1', {
environment: 'first',
application: 'myApp',
transform: 'json'
});
console.log(config);
// This will throw an error
config = await getAppConfig('config2', {
environment: 'second',
application: 'myApp',
transform: 'json'
});
console.log(config);Is this related to an existing documentation section?
How can we improve?
Just state that the applications/environment arguments are cached and one has to go with the AppConfigProvider class if one wants to fetch multiple configurations from multiple apps/environments within the same lambda function.
Got a suggestion in mind?
N/A
Acknowledgment
- I understand the final update might be different from my proposed suggestion, or refused.
Metadata
Metadata
Assignees
Labels
completedThis item is complete and has been merged/shippedThis item is complete and has been merged/shippeddocumentationImprovements or additions to documentationImprovements or additions to documentationparametersThis item relates to the Parameters UtilityThis item relates to the Parameters Utility
Type
Projects
Status
Shipped