aboutsummaryrefslogtreecommitdiff
path: root/app/models/backends/terraform_aws/backend_methods.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/backends/terraform_aws/backend_methods.rb')
-rw-r--r--app/models/backends/terraform_aws/backend_methods.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/app/models/backends/terraform_aws/backend_methods.rb b/app/models/backends/terraform_aws/backend_methods.rb
index f8338a4..89509bd 100644
--- a/app/models/backends/terraform_aws/backend_methods.rb
+++ b/app/models/backends/terraform_aws/backend_methods.rb
@@ -78,6 +78,19 @@ module Backends::TerraformAws::BackendMethods
end
end
+ def stop_backend
+ TerraformWorkingDirectory.new(
+ terraform_state_id,
+ 'terraform/aws/backend'
+ ).within_working_directory do
+ RubyTerraform.destroy(
+ vars: backend_terraform_variables,
+ target: 'aws_spot_instance_request.main',
+ force: true
+ )
+ end
+ end
+
def available_data_snapshots
GovukGuix::DataSnapshot.where(backend: self)
end