diff --git a/monkey/monkey_island/cc/services/initialize.py b/monkey/monkey_island/cc/services/initialize.py index 5c951eca3..d51383132 100644 --- a/monkey/monkey_island/cc/services/initialize.py +++ b/monkey/monkey_island/cc/services/initialize.py @@ -44,7 +44,10 @@ AGENT_BINARIES_PATH = Path(MONKEY_ISLAND_ABS_PATH) / "cc" / "binaries" def initialize_services(data_dir: Path) -> DIContainer: container = DIContainer() _register_conventions(container, data_dir) + container.register_instance(AWSInstance, AWSInstance()) + container.register_instance(MongoClient, MongoClient(MONGO_URL, serverSelectionTimeoutMS=100)) + _register_repositories(container, data_dir) _register_services(container) @@ -66,9 +69,6 @@ def _register_conventions(container: DIContainer, data_dir: Path): "default_ransomware_agent_configuration", DEFAULT_RANSOMWARE_AGENT_CONFIGURATION, ) - container.register_convention( - MongoClient, "mongo", MongoClient(MONGO_URL, serverSelectionTimeoutMS=100) - ) def _register_repositories(container: DIContainer, data_dir: Path):