Class/Module Index [+]

Quicksearch

Ironfan::Provider::Ec2

Public Class Methods

applicable(computer) click to toggle source
# File lib/ironfan/provider/ec2.rb, line 47
def self.applicable(computer)
  computer.server and computer.server.clouds.include?(:ec2)
end
aws_account_id() click to toggle source
# File lib/ironfan/provider/ec2.rb, line 28
def self.aws_account_id()
  Chef::Config[:knife][:aws_account_id]
end
connection() click to toggle source

Utility functions

# File lib/ironfan/provider/ec2.rb, line 14
def self.connection
  @@connection ||= Fog::Compute.new(self.aws_credentials.merge({ :provider => 'AWS' }))
end
elb() click to toggle source
# File lib/ironfan/provider/ec2.rb, line 18
def self.elb
  @@elb ||= Fog::AWS::ELB.new(self.aws_credentials)
end
ensure_tags(tags,fog) click to toggle source

Ensure that a fog object (machine, volume, etc.) has the proper tags on it

# File lib/ironfan/provider/ec2.rb, line 33
def self.ensure_tags(tags,fog)
  tags.delete_if {|k, v| fog.tags[k] == v.to_s  rescue false }
  return if tags.empty?

  Ironfan.step(fog.name,"tagging with #{tags.inspect}", :green)
  tags.each do |k, v|
    Chef::Log.debug( "tagging #{fog.name} with #{k} = #{v}" )
    Ironfan.safely do
      config = {:key => k, :value => v.to_s, :resource_id => fog.id }
      connection.tags.create(config)
    end
  end
end
iam() click to toggle source
# File lib/ironfan/provider/ec2.rb, line 22
def self.iam
  credentials = self.aws_credentials
  credentials.delete(:region)
  @@iam ||= Fog::AWS::IAM.new(credentials)
end
resources() click to toggle source
# File lib/ironfan/provider/ec2.rb, line 7
def self.resources
  [ Machine, ElasticIp, EbsVolume, Keypair, SecurityGroup, IamServerCertificate, ElasticLoadBalancer ]
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.