Class: Phase::Adapters::AWS

Inherits:
Object
  • Object
show all
Defined in:
lib/phase/adapters/aws.rb

Instance Method Summary collapse

Instance Method Details

#ec2Object



22
23
24
# File 'lib/phase/adapters/aws.rb', line 22

def ec2
  @ec2 ||= ::Fog::Compute::AWS.new(region: ::Phase.config.aws_region)
end

#find_servers(options = {}) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/phase/adapters/aws.rb', line 7

def find_servers(options = {})
  query = {}

  if options[:role]
    query["tag:Role"] = options[:role]
  end

  ec2.servers.all(query).map do |h|
    {
      hostname: h.dns_name,
      user: "orca"
    }
  end
end