Skip to content

Commit

Permalink
add edge between glacier job and sns topic (#1314)
Browse files Browse the repository at this point in the history
  • Loading branch information
anjafr authored Nov 28, 2022
1 parent 2a95f9c commit 8fedb02
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion plugins/aws/resoto_plugin_aws/resource/glacier.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from resoto_plugin_aws.aws_client import AwsClient
from resoto_plugin_aws.resource.base import AwsApiSpec, AwsResource, GraphBuilder
from resoto_plugin_aws.resource.kms import AwsKmsKey
from resoto_plugin_aws.resource.sns import AwsSnsTopic
from resotolib.baseresources import EdgeType, ModelReference
from resotolib.json_bender import S, Bend, Bender, ForallBend
from resotolib.types import Json
Expand Down Expand Up @@ -155,7 +156,8 @@ def connect_in_graph(self, builder: GraphBuilder, source: Json) -> None:
clazz=AwsKmsKey,
id=AwsKmsKey.normalise_id(self.glacier_job_output_location.s3.encryption.kms_key_id),
)
# TODO add edge to SNS Topic once implemented
if self.glacier_job_sns_topic:
builder.add_edge(self, clazz=AwsSnsTopic, arn=self.glacier_job_sns_topic)


@define(eq=False, slots=False)
Expand Down
2 changes: 1 addition & 1 deletion plugins/aws/test/collector_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def count_kind(clazz: Type[AwsResource]) -> int:
assert len(threading.enumerate()) == 1
# ensure the correct number of nodes and edges
assert count_kind(AwsResource) == 147
assert len(account_collector.graph.edges) == 375
assert len(account_collector.graph.edges) == 376


def test_dependencies() -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"StatusMessage": "string",
"ArchiveSizeInBytes": 123,
"InventorySizeInBytes": 123,
"SNSTopic": "string",
"SNSTopic": "arn:aws:sns:us-west-2:123456789012:my-topic",
"CompletionDate": "2012-03-20T17:03:43.221Z",
"SHA256TreeHash": "string",
"ArchiveSHA256TreeHash": "string",
Expand Down

0 comments on commit 8fedb02

Please sign in to comment.