From 482e707ecb5cb8a1924f6c9fd8e72b2d6ea946a1 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Sat, 23 Jun 2018 22:33:58 +0100 Subject: Support the refresh action on the terraform aws backend --- app/models/backends/terraform_aws/mini_environment_methods.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'app') diff --git a/app/models/backends/terraform_aws/mini_environment_methods.rb b/app/models/backends/terraform_aws/mini_environment_methods.rb index 31d7b19..e0fe03b 100644 --- a/app/models/backends/terraform_aws/mini_environment_methods.rb +++ b/app/models/backends/terraform_aws/mini_environment_methods.rb @@ -66,6 +66,14 @@ module Backends::TerraformAws::MiniEnvironmentMethods end end + def refresh(mini_environment) + within_terraform_working_directory(mini_environment) do + RubyTerraform.refresh( + vars: terraform_variables(mini_environment) + ) + end + end + def within_terraform_working_directory(mini_environment, &block) TerraformWorkingDirectory.new( "mini_environment/#{mini_environment.id}", -- cgit v1.2.3