diff --git a/data_safe_haven/infrastructure/stack_manager.py b/data_safe_haven/infrastructure/stack_manager.py index 0023ceff73..0acc55b7e6 100644 --- a/data_safe_haven/infrastructure/stack_manager.py +++ b/data_safe_haven/infrastructure/stack_manager.py @@ -39,6 +39,8 @@ def __init__( self.work_dir = config.work_directory / "pulumi" / self.program.short_name self.work_dir.mkdir(parents=True, exist_ok=True) self.login() # Log in to the Pulumi backend + self.initialise_workdir() + self.install_plugins() @property def local_stack_path(self) -> pathlib.Path: @@ -137,8 +139,6 @@ def copy_secret(self, name: str, other_stack: "StackManager") -> None: def deploy(self, *, force: bool = False) -> None: """Deploy the infrastructure with Pulumi.""" try: - self.initialise_workdir() - self.install_plugins() self.apply_config_options() if force: self.cancel() @@ -357,8 +357,6 @@ def set_config(self, name: str, value: str, *, secret: bool) -> None: def teardown(self) -> None: """Teardown the infrastructure deployed with Pulumi.""" try: - self.initialise_workdir() - self.install_plugins() self.refresh() self.destroy() self.remove_workdir()