sample-helper-aws-appconfig
raw JSON → 2.3.1 verified Fri May 01 auth: no python
A sample helper library for AWS AppConfig that simplifies configuration retrieval and management. Current version 2.3.1, supports Python >=3.10, <4.0.
pip install sample-helper-aws-appconfig Common errors
error ImportError: cannot import name 'AppConfigHelper' from 'sample_helper_aws_appconfig' ↓
cause Using wrong import path due to package name hyphen vs underscore confusion.
fix
Use: from sample_helper_aws_appconfig import AppConfigHelper
error botocore.exceptions.ClientError: An error occurred (ResourceNotFoundException) when calling the GetConfiguration operation: Configuration 'my-config' not found ↓
cause The specified configuration name does not exist in AppConfig.
fix
Verify that the application, environment, and configuration names are correct and that the configuration has been created in AWS AppConfig.
error TypeError: get_configuration() missing 1 required positional argument: 'client_id' ↓
cause The client_id parameter was omitted when calling get_configuration, but it is required.
fix
Ensure you pass client_id to the helper constructor or to get_configuration().
Warnings
deprecated The `get_configuration` method returns raw configuration content without validation; use `get_configuration_validated` for schema validation. ↓
fix Use `helper.get_configuration_validated()` and provide a schema.
gotcha Client ID must be unique; reusing the same client ID across multiple instances may cause throttling. ↓
fix Generate a unique client ID per instance (e.g., using uuid.uuid4()).
breaking In version 2.0.0, the `get_configuration` method changed from returning a dict to returning a string. Code expecting a dict will break. ↓
fix Use `json.loads(helper.get_configuration())` to parse the string if needed.
Imports
- AppConfigHelper wrong
from appconfig_helper import AppConfigHelpercorrectfrom sample_helper_aws_appconfig import AppConfigHelper
Quickstart
import os
from sample_helper_aws_appconfig import AppConfigHelper
helper = AppConfigHelper(
application='my-app',
environment='production',
configuration='my-config',
client_id='my-client'
)
config = helper.get_configuration()
print(config)