Skip to content

Commit

Permalink
[resotolib][feat] Add base resources for organizations (#1896)
Browse files Browse the repository at this point in the history
  • Loading branch information
lloesche authored Feb 2, 2024
1 parent d502962 commit 04ba9e3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
6 changes: 3 additions & 3 deletions plugins/aws/resoto_plugin_aws/collector.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
)
from resoto_plugin_aws.resource.base import AwsAccount, AwsApiSpec, AwsRegion, AwsResource, GraphBuilder

from resotolib.baseresources import Cloud, EdgeType
from resotolib.baseresources import Cloud, EdgeType, BaseOrganizationalRoot, BaseOrganizationalUnit
from resotolib.core.actions import CoreFeedback
from resotolib.core.progress import ProgressDone, ProgressTree
from resotolib.graph import Graph, BySearchCriteria, ByNodeId
Expand Down Expand Up @@ -373,14 +373,14 @@ def add_accounts(parent: Union[AwsOrganizationalRoot, AwsOrganizationalUnit]) ->


@define(eq=False, slots=False)
class AwsOrganizationalRoot(AwsResource):
class AwsOrganizationalRoot(BaseOrganizationalRoot, AwsResource):
kind: ClassVar[str] = "aws_organizational_root"
kind_display: ClassVar[str] = "AWS Organizational Root"
kind_description: ClassVar[str] = "An AWS Organizational Root is the root of an AWS Organization."


@define(eq=False, slots=False)
class AwsOrganizationalUnit(AwsResource):
class AwsOrganizationalUnit(BaseOrganizationalUnit, AwsResource):
kind: ClassVar[str] = "aws_organizational_unit"
kind_display: ClassVar[str] = "AWS Organizational Unit"
kind_description: ClassVar[str] = "An AWS Organizational Unit is a container for AWS Accounts."
16 changes: 16 additions & 0 deletions resotolib/resotolib/baseresources.py
Original file line number Diff line number Diff line change
Expand Up @@ -1248,6 +1248,22 @@ def _keys(self) -> tuple[Any, ...]:
)


@define(eq=False, slots=False)
class BaseOrganizationalRoot(BaseResource):
kind: ClassVar[str] = "organizational_root"
kind_display: ClassVar[str] = "Organizational Root"
kind_description: ClassVar[str] = "An Organizational Root."
metadata: ClassVar[Dict[str, Any]] = {"icon": "resource", "group": "misc"}


@define(eq=False, slots=False)
class BaseOrganizationalUnit(BaseResource):
kind: ClassVar[str] = "organizational_unit"
kind_display: ClassVar[str] = "Organizational Unit"
kind_description: ClassVar[str] = "An Organizational Unit."
metadata: ClassVar[Dict[str, Any]] = {"icon": "resource", "group": "misc"}


@define(eq=False, slots=False)
class UnknownCloud(BaseCloud):
kind: ClassVar[str] = "unknown_cloud"
Expand Down

0 comments on commit 04ba9e3

Please sign in to comment.