diff --git a/plugins/gcp/fix_plugin_gcp/resources/sqladmin.py b/plugins/gcp/fix_plugin_gcp/resources/sqladmin.py index 483f3ca0d2..81fd6d2ee5 100644 --- a/plugins/gcp/fix_plugin_gcp/resources/sqladmin.py +++ b/plugins/gcp/fix_plugin_gcp/resources/sqladmin.py @@ -1,6 +1,6 @@ import logging from datetime import datetime -from typing import ClassVar, Dict, Optional, List, Type +from typing import Any, ClassVar, Dict, Optional, List, Tuple, Type from attr import define, field @@ -1072,7 +1072,7 @@ class GcpSqlUser(GcpResource): ) reference_kinds: ClassVar[ModelReference] = {"predecessors": {"default": ["gcp_sql_database_instance"]}} mapping: ClassVar[Dict[str, Bender]] = { - "id": S("name").or_else(K("(anonymous)@") + S("host", default="localhost")), + "id": S("name").or_else(K("(anonymous)") + S("host", default="localhost")), "tags": S("labels", default={}), "name": S("name", default="(anonymous)"), "ctime": S("creationTimestamp"), @@ -1104,5 +1104,8 @@ def connect_in_graph(self, builder: GraphBuilder, source: Json) -> None: if self.instance: builder.add_edge(self, reverse=True, clazz=GcpSqlDatabaseInstance) + def _keys(self) -> Tuple[Any, ...]: + return self.kind, self.cloud().id, self.account().id, self.region().id, self.zone().id, self.id, self.instance + resources: List[Type[GcpResource]] = [GcpSqlDatabaseInstance]