class Opsworks::Ssh::Config::Environment

Constants

LAYER_NAME

Attributes

layer[R]
stack[R]
stack_id[R]

Public Class Methods

new(stack: nil) click to toggle source
# File lib/opsworks/ssh/config/environment.rb, line 9
def initialize(stack: nil)
  @stack = stack
  @stack_id = stack.stack_id
end

Public Instance Methods

name() click to toggle source
# File lib/opsworks/ssh/config/environment.rb, line 14
def name
  @name ||= @stack.name.gsub(/-/, '_')
end
servers() click to toggle source
# File lib/opsworks/ssh/config/environment.rb, line 18
def servers
  instances.map do |instance|
    Server.new(instance: instance)
  end.select(&:active?)
end

Private Instance Methods

instances() click to toggle source
# File lib/opsworks/ssh/config/environment.rb, line 36
def instances
  Config.opsworks.describe_instances(layer_id: layer.layer_id).instances
end
layers() click to toggle source
# File lib/opsworks/ssh/config/environment.rb, line 26
def layers
  Config.opsworks.describe_layers(stack_id: stack_id).layers
end