Module: Terraspace::Terraform::Api::Client

Extended by:
Memoist
Included in:
Tfc::Runs::Base, Tfc::Runs::Pruner, Tfc::Sync, Tfc::Workspace
Defined in:
lib/terraspace/terraform/api/client.rb

Instance Method Summary collapse

Instance Method Details

#apiObject

api may be overridden in classes including this Concern



24
25
26
27
# File 'lib/terraspace/terraform/api/client.rb', line 24

def api
  return unless backend.dig('remote','workspaces') # in case called by terraspace down demo -y --destroy-workspace with a non-remote backend
  Terraspace::Terraform::Api.new(@mod, remote)
end

#backendObject

backend may be overridden in classes including this Concern



18
19
20
# File 'lib/terraspace/terraform/api/client.rb', line 18

def backend
  Terraspace::Terraform::Runner::Backend::Parser.new(@mod).result
end

#buildObject



12
13
14
# File 'lib/terraspace/terraform/api/client.rb', line 12

def build
  Terraspace::Builder.new(@options).run
end

#remoteObject



4
5
6
# File 'lib/terraspace/terraform/api/client.rb', line 4

def remote
  backend["remote"]
end

#workspace_nameObject



8
9
10
# File 'lib/terraspace/terraform/api/client.rb', line 8

def workspace_name
  remote['workspaces']['name']
end