Class: OpenStax::Aws::StackParameters

Inherits:
Object
  • Object
show all
Defined in:
lib/openstax/aws/stack_parameters.rb

Instance Method Summary collapse

Constructor Details

#initialize(stack:, params:, recover_previous_values: true) ⇒ StackParameters

Returns a new instance of StackParameters.



4
5
6
7
8
# File 'lib/openstax/aws/stack_parameters.rb', line 4

def initialize(stack:, params:, recover_previous_values: true)
  @stack = stack
  @raw_params = params
  @recover_previous_values = recover_previous_values
end

Instance Method Details

#[](key) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/openstax/aws/stack_parameters.rb', line 10

def [](key)
  if @recover_previous_values && @raw_params[key] == :use_previous_value
    @stack.deployed_parameters[key]
  else
    @raw_params[key]
  end
end