diff --git a/plugins/aws/resoto_plugin_aws/resource/glacier.py b/plugins/aws/resoto_plugin_aws/resource/glacier.py index a847191d29..4df81f3b3c 100644 --- a/plugins/aws/resoto_plugin_aws/resource/glacier.py +++ b/plugins/aws/resoto_plugin_aws/resource/glacier.py @@ -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 @@ -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) diff --git a/plugins/aws/test/collector_test.py b/plugins/aws/test/collector_test.py index 648451eeee..da9c9f0bfe 100644 --- a/plugins/aws/test/collector_test.py +++ b/plugins/aws/test/collector_test.py @@ -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: diff --git a/plugins/aws/test/resources/files/glacier/list-jobs__nice_vault.json b/plugins/aws/test/resources/files/glacier/list-jobs__nice_vault.json index b3078f9542..674ea81af7 100644 --- a/plugins/aws/test/resources/files/glacier/list-jobs__nice_vault.json +++ b/plugins/aws/test/resources/files/glacier/list-jobs__nice_vault.json @@ -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",