aboutsummaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2018-06-23 22:33:58 +0100
committerChristopher Baines <mail@cbaines.net>2018-06-23 22:33:58 +0100
commit482e707ecb5cb8a1924f6c9fd8e72b2d6ea946a1 (patch)
treee86eef9f9945ec372d76e1e4da21b7fca09467de /app/models
parent785e20ce34069cc2a0470cc3b9624f25194d5dba (diff)
downloadgovuk-mini-environment-admin-482e707ecb5cb8a1924f6c9fd8e72b2d6ea946a1.tar
govuk-mini-environment-admin-482e707ecb5cb8a1924f6c9fd8e72b2d6ea946a1.tar.gz
Support the refresh action on the terraform aws backend
Diffstat (limited to 'app/models')
-rw-r--r--app/models/backends/terraform_aws/mini_environment_methods.rb8
1 files changed, 8 insertions, 0 deletions
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}",