Closed
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
Type
Projects
Status
Shipped