AppConfig
Advanced feature flags utility
Usage Documentation
| CLASS | DESCRIPTION |
|---|---|
AppConfigStore |
|
AppConfigStore ¶
AppConfigStore(environment: str, application: str, name: str, max_age: int = 5, sdk_config: Config | None = None, envelope: str | None = '', jmespath_options: dict | None = None, logger: Logger | Logger | None = None, boto_config: Config | None = None, boto3_session: Session | None = None, boto3_client: AppConfigDataClient | None = None)
Bases: StoreProvider
| PARAMETER | DESCRIPTION |
|---|---|
environment
|
Appconfig environment, e.g. 'dev/test' etc.
TYPE:
|
application
|
AppConfig application name, e.g. 'powertools'
TYPE:
|
name
|
AppConfig configuration name e.g.
TYPE:
|
max_age
|
cache expiration time in seconds, or how often to call AppConfig to fetch latest configuration
TYPE:
|
sdk_config
|
Botocore Config object to pass during client initialization
TYPE:
|
envelope
|
JMESPath expression to pluck feature flags data from config
TYPE:
|
jmespath_options
|
Alternative JMESPath options to be included when filtering expr
TYPE:
|
logger
|
Used to log messages. If None is supplied, one will be created. |
boto_config
|
Botocore configuration to pass during client initialization
TYPE:
|
boto3_session
|
Boto3 session to use for AWS API communication
TYPE:
|
boto3_client
|
Boto3 AppConfigDataClient Client to use, boto3_session and boto_config will be ignored if both are provided
TYPE:
|
| METHOD | DESCRIPTION |
|---|---|
get_configuration |
Fetch feature schema configuration from AWS AppConfig |
| ATTRIBUTE | DESCRIPTION |
|---|---|
get_raw_configuration |
Fetch feature schema configuration from AWS AppConfig |
Source code in aws_lambda_powertools/utilities/feature_flags/appconfig.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 | |
get_raw_configuration
property
¶
get_raw_configuration: dict[str, Any]
Fetch feature schema configuration from AWS AppConfig
get_configuration ¶
get_configuration() -> dict[str, Any]
Fetch feature schema configuration from AWS AppConfig
If envelope is set, it'll extract and return feature flags from configuration, otherwise it'll return the entire configuration fetched from AWS AppConfig.
| RAISES | DESCRIPTION |
|---|---|
ConfigurationStoreError
|
Any validation error or AppConfig error that can occur |
| RETURNS | DESCRIPTION |
|---|---|
dict[str, Any]
|
parsed JSON dictionary |
Source code in aws_lambda_powertools/utilities/feature_flags/appconfig.py
128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 | |