aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2018-06-03 13:09:46 +0100
committerChristopher Baines <mail@cbaines.net>2018-06-03 14:09:13 +0100
commit084b086cf72260a5fe2379a35e8f5951a4ae9935 (patch)
tree5965e7351dba7b8c4aaf2fb116954b6c90eaf192
parent89f23d284796f51a0386c7127ee56be231189edd (diff)
downloadgovuk-mini-environment-admin-084b086cf72260a5fe2379a35e8f5951a4ae9935.tar
govuk-mini-environment-admin-084b086cf72260a5fe2379a35e8f5951a4ae9935.tar.gz
Support data snapshots for the AWS backend
-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}",