Module: Terrafying::State

Defined in:
lib/terrafying/state.rb

Defined Under Namespace

Classes: LocalStateStore

Constant Summary collapse

STATE_FILENAME =
"terraform.tfstate"

Class Method Summary collapse

Class Method Details

.local(config) ⇒ Object



16
17
18
# File 'lib/terrafying/state.rb', line 16

def self.local(config)
  LocalStateStore.new(config.path)
end

.remote(config) ⇒ Object



20
21
22
# File 'lib/terrafying/state.rb', line 20

def self.remote(config)
  Terrafying::DynamoDb::StateStore.new(config.scope)
end

.store(config) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/terrafying/state.rb', line 8

def self.store(config)
  if LocalStateStore.has_local_state?(config)
    local(config)
  else
    remote(config)
  end
end