Module: RSpec::Lono::Runner::Concerns

Extended by:
Memoist
Includes:
Lono::AwsServices
Included in:
RSpec::Lono::Runner
Defined in:
lib/rspec/lono/runner/concerns.rb

Instance Method Summary collapse

Instance Method Details

#describe_stack_resources(options = {}) ⇒ Object



27
28
29
# File 'lib/rspec/lono/runner/concerns.rb', line 27

def describe_stack_resources(options={})
  cfn.describe_stack_resources(options)
end

#outputsObject

Example:

{
  "SecurityGroupId"=>"sg-08ca356e0a6d607e4",
  "SecurityGroup"=>"demo-test-SecurityGroup-17X56VTN9PRXH"
}


11
12
13
14
15
# File 'lib/rspec/lono/runner/concerns.rb', line 11

def outputs
  stack.outputs.inject({}) do |acc,o|
    acc.merge(o.output_key => o.output_value)
  end
end

#resourcesObject



17
18
19
20
# File 'lib/rspec/lono/runner/concerns.rb', line 17

def resources
  resp = describe_stack_resources(stack_name: @stack)
  resp.stack_resources
end

#stackObject



22
23
24
# File 'lib/rspec/lono/runner/concerns.rb', line 22

def stack
  find_stack(@stack)
end