Skip to content

Commit a38c575

Browse files
committed
refactor(parameters): Contistently reference env
Use the defined constants to look up service name environment varialbe NOTE: This does not default to `service_undefined`
1 parent 437ec9e commit a38c575

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

aws_lambda_powertools/utilities/parameters/appconfig.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import boto3
1111
from botocore.config import Config
1212

13+
from ...shared import constants
1314
from .base import DEFAULT_PROVIDERS, BaseProvider
1415

1516
CLIENT_ID = str(uuid4())
@@ -33,6 +34,7 @@ class AppConfigProvider(BaseProvider):
3334
**Retrieves the latest configuration value from App Config**
3435
3536
>>> from aws_lambda_powertools.utilities import parameters
37+
>>>
3638
>>> appconf_provider = parameters.AppConfigProvider(environment="my_env", application="my_app")
3739
>>>
3840
>>> value : bytes = appconf_provider.get("my_conf")
@@ -66,7 +68,7 @@ def __init__(
6668

6769
config = config or Config()
6870
self.client = boto3.client("appconfig", config=config)
69-
self.application = application or os.getenv("POWERTOOLS_SERVICE_NAME") or "application_undefined"
71+
self.application = application or os.getenv(constants.SERVICE_NAME_ENV, "service_undefined")
7072
self.environment = environment
7173
self.current_version = ""
7274

0 commit comments

Comments
 (0)