AppConfig
AWS App Config configuration retrieval and caching utility
CLASS | DESCRIPTION |
---|---|
AppConfigProvider |
AWS App Config Provider |
FUNCTION | DESCRIPTION |
---|---|
get_app_config |
Retrieve a configuration value from AWS App Config. |
AppConfigProvider ¶
AppConfigProvider(
environment: str,
application: str | None = None,
config: Config | None = None,
boto_config: Config | None = None,
boto3_session: boto3.session.Session | None = None,
boto3_client: AppConfigDataClient | None = None,
)
Bases: BaseProvider
AWS App Config Provider
PARAMETER | DESCRIPTION | ||
---|---|---|---|
environment
|
Environment of the configuration to pass during client initialization
TYPE:
|
||
application
|
Application of the configuration to pass during client initialization
TYPE:
|
||
config
|
Botocore configuration to pass during client initialization
TYPE:
|
||
boto3_session
|
TYPE:
|
||
boto3_client
|
TYPE:
|
Example
Retrieves the latest configuration value from App Config
1 2 3 4 5 6 7 8 |
|
Retrieves a configuration value from App Config in another AWS region
1 2 3 4 5 6 7 8 9 10 |
|
Source code in aws_lambda_powertools/utilities/parameters/appconfig.py
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 |
|
get_app_config ¶
get_app_config(
name: str,
environment: str,
application: str | None = None,
transform: TransformOptions = None,
force_fetch: bool = False,
max_age: int | None = None,
**sdk_options
) -> str | bytes | list | dict
Retrieve a configuration value from AWS App Config.
PARAMETER | DESCRIPTION |
---|---|
name
|
Name of the configuration
TYPE:
|
environment
|
Environment of the configuration
TYPE:
|
application
|
Application of the configuration
TYPE:
|
transform
|
Transforms the content from a JSON object ('json') or base64 binary string ('binary')
TYPE:
|
force_fetch
|
Force update even before a cached item has expired, defaults to False
TYPE:
|
max_age
|
Maximum age of the cached value
TYPE:
|
sdk_options
|
SDK options to propagate to
DEFAULT:
|
RAISES | DESCRIPTION |
---|---|
GetParameterError
|
When the parameter provider fails to retrieve a parameter value for a given name. |
TransformParameterError
|
When the parameter provider fails to transform a parameter value. |
Example
Retrieves the latest version of configuration value from App Config
1 2 3 4 5 6 |
|
Retrieves a configuration value and decodes it using a JSON decoder
1 2 3 4 5 6 |
|
Source code in aws_lambda_powertools/utilities/parameters/appconfig.py
157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 |
|