From 084b086cf72260a5fe2379a35e8f5951a4ae9935 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Sun, 3 Jun 2018 13:09:46 +0100 Subject: Support data snapshots for the AWS backend --- app/models/backends/terraform_aws.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'app') 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}", -- cgit v1.2.3