Skip to content

Commit

Permalink
[resotolib][feat] Support RDS Clusters (#1420)
Browse files Browse the repository at this point in the history
* [resotolib][fix] Database endpoint is optional

* [resotolib][feat] Support RDS Clusters

* add edges to security group and kinesis

* make security group a dependant node

* aws_kinesis -> aws_kinesis_stream
  • Loading branch information
aquamatthias committed Feb 9, 2023
1 parent 8bf6625 commit defd0a3
Show file tree
Hide file tree
Showing 9 changed files with 661 additions and 17 deletions.
1 change: 1 addition & 0 deletions plugins/aws/resoto_plugin_aws/aws_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ def call(
code = e.response["Error"]["Code"] or "Unknown Code"
if code in expected_errors:
log.debug(f"Expected error: {code}")
return None
else:
raise

Expand Down
6 changes: 3 additions & 3 deletions plugins/aws/resoto_plugin_aws/resource/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
)
from resotolib.config import Config, current_config
from resotolib.core.actions import CoreFeedback
from resotolib.graph import Graph, EdgeKey, ByNodeId, BySearchCriteria
from resotolib.graph import Graph, EdgeKey, ByNodeId, BySearchCriteria, NodeSelector
from resotolib.json import to_json as to_js, from_json as from_js
from resotolib.json_bender import Bender, bend
from resotolib.types import Json
Expand Down Expand Up @@ -434,8 +434,8 @@ def add_edge(
def add_deferred_edge(
self, from_node: BaseResource, edge_type: EdgeType, to_node: str, reverse: bool = False
) -> None:
node1 = ByNodeId(from_node.chksum)
node2 = BySearchCriteria(to_node)
node1: NodeSelector = ByNodeId(from_node.chksum)
node2: NodeSelector = BySearchCriteria(to_node)
start, end = (node2, node1) if reverse else (node1, node2)
self.graph.add_deferred_edge(start, end, edge_type)

Expand Down
282 changes: 277 additions & 5 deletions plugins/aws/resoto_plugin_aws/resource/rds.py

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions plugins/aws/test/collector_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ def count_kind(clazz: Type[AwsResource]) -> int:
# make sure all threads have been joined
assert len(threading.enumerate()) == 1
# ensure the correct number of nodes and edges
assert count_kind(AwsResource) == 198
assert len(account_collector.graph.edges) == 464
assert count_kind(AwsResource) == 200
assert len(account_collector.graph.edges) == 468
assert len(account_collector.graph.deferred_edges) == 2


Expand Down
Loading

0 comments on commit defd0a3

Please sign in to comment.