AppConfig Extension
AWS AppConfig configuration retrieval through the AWS AppConfig Agent Lambda extension
| CLASS | DESCRIPTION |
|---|---|
AppConfigExtensionProvider |
AWS AppConfig provider backed by the AWS AppConfig Agent Lambda extension. |
AppConfigExtensionProvider ¶
AppConfigExtensionProvider(environment: str, application: str | None = None, port: int | None = None, timeout: float = DEFAULT_EXTENSION_TIMEOUT_SECS)
Bases: BaseProvider
AWS AppConfig provider backed by the AWS AppConfig Agent Lambda extension.
The extension runs as a Lambda layer, keeps a local cache of configuration data, polls AWS AppConfig in the background, and serves configuration over HTTP on localhost. This provider reads from that local endpoint instead of calling the AppConfig APIs with boto3.
| PARAMETER | DESCRIPTION |
|---|---|
environment
|
Environment of the configuration
TYPE:
|
application
|
Application of the configuration, by default POWERTOOLS_SERVICE_NAME
TYPE:
|
port
|
Port of the extension's local HTTP server, by default AWS_APPCONFIG_EXTENSION_HTTP_PORT or 2772
TYPE:
|
timeout
|
Seconds to wait for a response from the extension, by default 3
TYPE:
|
Example
Retrieves a configuration from the AppConfig Agent Lambda extension
1 2 3 4 5 | |
Retrieves selected feature flags only
1 | |
Notes
Attach the AWS-AppConfig-Extension layer to the function and grant the execution role
appconfig:StartConfigurationSession and appconfig:GetLatestConfiguration. The extension
uses those permissions; this provider only talks to localhost.
Source code in aws_lambda_powertools/utilities/parameters/appconfig_extension.py
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | |