aboutsummaryrefslogtreecommitdiff
path: root/app/models/backends
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/backends')
-rw-r--r--app/models/backends/terraform_aws.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/app/models/backends/terraform_aws.rb b/app/models/backends/terraform_aws.rb
index d5abfee..c918a86 100644
--- a/app/models/backends/terraform_aws.rb
+++ b/app/models/backends/terraform_aws.rb
@@ -71,6 +71,14 @@ class Backends::TerraformAws < ApplicationRecord
)
end
+ def create_data_snapshot
+ GovukGuix::CreateDataSnapshotJob.enqueue(
+ run_remotely_on_host: "ubuntu@guix-daemon.#{domain}",
+ backend_type: self.class.name,
+ backend_id: id
+ )
+ end
+
def start(mini_environment)
logger.info "Setting up #{mini_environment.name}"
@@ -115,6 +123,10 @@ class Backends::TerraformAws < ApplicationRecord
end
end
+ def available_data_snapshots
+ GovukGuix::DataSnapshot.where(backend: self)
+ end
+
def within_terraform_working_directory(mini_environment, &block)
TerraformWorkingDirectory.new(
"mini_environment/#{mini_environment.id}",