Skip to content

Commit

Permalink
feat(tags): add support for default and user/global tags
Browse files Browse the repository at this point in the history
  • Loading branch information
kkiani committed Aug 2, 2024
1 parent e62f95b commit b88f6e6
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/damavand/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,31 @@ def __init__(
app_name: str,
provider: CloudProvider,
resources: list[BaseResource] = [],
tags: dict[str, str] = {},
) -> None:
self.app_name = app_name
self.provider = provider
self._resources = resources
self._user_defined_tags = tags

@property
def default_tags(self) -> dict[str, str]:
return {
"application": self.app_name,
"environment": "development",
"iac_optimizer": "damavand",
}

@property
def user_defined_tags(self) -> dict[str, str]:
return self._user_defined_tags

@property
def all_tags(self) -> dict[str, str]:
return {
**self.default_tags,
**self.user_defined_tags,
}

def provision_all_resources(self) -> None:
"""Provision all resources in the factory"""
Expand Down

0 comments on commit b88f6e6

Please sign in to comment.