Parent

Blimpy::Boxes::AWS

Constants

DEFAULT_IMAGE_ID

Default to 12.04 64-bit

DEFAULT_REGION

Default to US West (Oregon)

Public Class Methods

fog_server_for_instance(id, blimpdata) click to toggle source
# File lib/blimpy/boxes/aws.rb, line 12
def self.fog_server_for_instance(id, blimpdata)
  region = blimpdata[:region] || DEFAULT_REGION
  fog = Fog::Compute.new(:provider => 'AWS', :region => region)
  fog.servers.get(id)
end
new(server=nil) click to toggle source
# File lib/blimpy/boxes/aws.rb, line 18
def initialize(server=nil)
  super(server)
  @allowed_regions = ['us-west-1', 'us-west-2', 'us-east-1']
  @region = DEFAULT_REGION
  @image_id = DEFAULT_IMAGE_ID
  @username = 'ubuntu'
  @flavor = 't1.micro'
  @group = 'default'
end

Public Instance Methods

fog() click to toggle source
# File lib/blimpy/boxes/aws.rb, line 38
def fog
  @fog ||= begin
    Fog::Compute.new(:provider => 'AWS', :region => @region)
  end
end
validate!() click to toggle source
# File lib/blimpy/boxes/aws.rb, line 28
def validate!
  if @region.nil?
    raise Blimpy::BoxValidationError, "Cannot spin up machine without a set region"
  end

  if fog.security_groups.get(@group).nil?
    raise Blimpy::BoxValidationError, "The security group '#{@group}' does not exist in #{@region}"
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.