Skip to content

Commit

Permalink
ERv2: Add AWS tags to input (#4426)
Browse files Browse the repository at this point in the history
  • Loading branch information
lechuk47 authored Jun 6, 2024
1 parent 4f6304f commit 7a18b31
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions reconcile/external_resources/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
AWSRdsFactory,
AWSResourceFactory,
)
from reconcile.external_resources.meta import QONTRACT_INTEGRATION
from reconcile.external_resources.model import (
ExternalResource,
ExternalResourceKey,
Expand All @@ -28,6 +29,14 @@

T = TypeVar("T")

AWS_DEFAULT_TAGS = [
{
"tags": {
"app": "app-sre-infra",
}
}
]


class ObjectFactory(Generic[T]):
def __init__(self) -> None:
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 7a18b31

Please sign in to comment.