You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by vi...@apache.org on 2026/04/29 13:07:15 UTC
(airflow) branch main updated: Added logging for skipped lookups in SM and SSM backends (#66059)
This is an automated email from the ASF dual-hosted git repository.
vincbeck pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new f7cf3c9ed39 Added logging for skipped lookups in SM and SSM backends (#66059)
f7cf3c9ed39 is described below
commit f7cf3c9ed39edef2a70c714afe4b891d063b8bcb
Author: Justin Pakzad <11...@users.noreply.github.com>
AuthorDate: Wed Apr 29 09:07:07 2026 -0400
Added logging for skipped lookups in SM and SSM backends (#66059)
---
.../airflow/providers/amazon/aws/secrets/secrets_manager.py | 10 ++++++++++
.../airflow/providers/amazon/aws/secrets/systems_manager.py | 10 ++++++++++
2 files changed, 20 insertions(+)
diff --git a/providers/amazon/src/airflow/providers/amazon/aws/secrets/secrets_manager.py b/providers/amazon/src/airflow/providers/amazon/aws/secrets/secrets_manager.py
index 3c778080e81..ea922237424 100644
--- a/providers/amazon/src/airflow/providers/amazon/aws/secrets/secrets_manager.py
+++ b/providers/amazon/src/airflow/providers/amazon/aws/secrets/secrets_manager.py
@@ -316,8 +316,18 @@ class SecretsManagerBackend(BaseSecretsBackend, LoggingMixin):
:param team_name: Team name associated to the task trying to access the variable (if any)
"""
if lookup_pattern and not re.match(lookup_pattern, secret_id, re.IGNORECASE):
+ self.log.debug(
+ "Skipping lookup of %r: does not match configured lookup_pattern %r.",
+ secret_id,
+ lookup_pattern,
+ )
return None
if team_name is None and re.fullmatch(r"[^-]+--.+", secret_id):
+ self.log.warning(
+ "Secret ID %r contains a '--' separator, which is reserved for team-scoped lookups, "
+ "but no team context was provided. Returning None.",
+ secret_id,
+ )
return None
if path_prefix and team_name:
secrets_path = self.build_path(path_prefix, f"{team_name}--{secret_id}", self.sep)
diff --git a/providers/amazon/src/airflow/providers/amazon/aws/secrets/systems_manager.py b/providers/amazon/src/airflow/providers/amazon/aws/secrets/systems_manager.py
index 3d072a48b46..ed99d5f6ccd 100644
--- a/providers/amazon/src/airflow/providers/amazon/aws/secrets/systems_manager.py
+++ b/providers/amazon/src/airflow/providers/amazon/aws/secrets/systems_manager.py
@@ -195,8 +195,18 @@ class SystemsManagerParameterStoreBackend(BaseSecretsBackend, LoggingMixin):
:param team_name: Team name associated to the task trying to access the variable (if any)
"""
if lookup_pattern and not re.match(lookup_pattern, secret_id, re.IGNORECASE):
+ self.log.debug(
+ "Skipping lookup of %r: does not match configured lookup_pattern %r.",
+ secret_id,
+ lookup_pattern,
+ )
return None
if team_name is None and re.fullmatch(r"[^-]+--.+", secret_id):
+ self.log.warning(
+ "Secret ID %r contains a '--' separator, which is reserved for team-scoped lookups, "
+ "but no team context was provided. Returning None.",
+ secret_id,
+ )
return None
if team_name:
ssm_path = self.build_path(path_prefix, f"{team_name}--{secret_id}")