Module: AWS

Defined in:
lib/fog/aws/bin.rb

Instance Method Summary collapse

Instance Method Details

#[](service) ⇒ Object


10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/fog/aws/bin.rb', line 10

def [](service)
  @@connections ||= Hash.new do |hash, key|
    credentials = Fog.credentials.reject do |k, v|
      ![:aws_access_key_id, :aws_secret_access_key].include?(k)
    end
    hash[key] = case key
    when :ec2
      Fog::AWS::EC2.new(credentials)
    when :s3
      Fog::AWS::S3.new(credentials)
    end
  end
  @@connections[service]
end

#addressesObject


25
26
27
# File 'lib/fog/aws/bin.rb', line 25

def addresses
  self[:ec2].addresses
end

#directoriesObject


29
30
31
# File 'lib/fog/aws/bin.rb', line 29

def directories
  self[:s3].directories
end

#flavorsObject


33
34
35
# File 'lib/fog/aws/bin.rb', line 33

def flavors
  self[:ec2].flavors
end

#imagesObject


37
38
39
# File 'lib/fog/aws/bin.rb', line 37

def images
  self[:ec2].images
end

#initialized?Boolean

Returns:

  • (Boolean)

6
7
8
# File 'lib/fog/aws/bin.rb', line 6

def initialized?
  true
end

#key_pairsObject


45
46
47
# File 'lib/fog/aws/bin.rb', line 45

def key_pairs
  self[:ec2].key_pairs
end

#security_groupsObject


49
50
51
# File 'lib/fog/aws/bin.rb', line 49

def security_groups
  self[:ec2].security_groups
end

#serversObject


41
42
43
# File 'lib/fog/aws/bin.rb', line 41

def servers
  self[:ec2].servers
end

#snapshotsObject


53
54
55
# File 'lib/fog/aws/bin.rb', line 53

def snapshots
  self[:ec2].snapshots
end

#volumesObject


57
58
59
# File 'lib/fog/aws/bin.rb', line 57

def volumes
  self[:ec2].volumes
end