From 7a18b31e94c3b808d20906dbadfc7b3e032271d0 Mon Sep 17 00:00:00 2001 From: Jordi Piriz Date: Thu, 6 Jun 2024 09:26:13 +0200 Subject: [PATCH] ERv2: Add AWS tags to input (#4426) --- reconcile/external_resources/factories.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/reconcile/external_resources/factories.py b/reconcile/external_resources/factories.py index 112a9a529e..38bf32a4ea 100644 --- a/reconcile/external_resources/factories.py +++ b/reconcile/external_resources/factories.py @@ -9,6 +9,7 @@ AWSRdsFactory, AWSResourceFactory, ) +from reconcile.external_resources.meta import QONTRACT_INTEGRATION from reconcile.external_resources.model import ( ExternalResource, ExternalResourceKey, @@ -28,6 +29,14 @@ T = TypeVar("T") +AWS_DEFAULT_TAGS = [ + { + "tags": { + "app": "app-sre-infra", + } + } +] + class ObjectFactory(Generic[T]): def __init__(self) -> None: @@ -102,6 +111,8 @@ def __init__( def create_external_resource(self, spec: ExternalResourceSpec) -> ExternalResource: f = self.resource_factories.get_factory(spec.provider) data = f.resolve(spec) + data["tags"] = spec.tags(integration=QONTRACT_INTEGRATION) + data["default_tags"] = AWS_DEFAULT_TAGS region = data.get("region") if region: