Class: Migrant::Clouds::AWS

Inherits:
Base
  • Object
show all
Defined in:
lib/migrant/clouds/aws.rb

Instance Attribute Summary

Attributes inherited from Base

#connection

Instance Method Summary collapse

Methods inherited from Base

#bootstrap_server, #connect_to_server, #destroy, #execute, register, registered

Constructor Details

#initialize(env) ⇒ AWS

Returns a new instance of AWS.



6
7
8
9
10
11
# File 'lib/migrant/clouds/aws.rb', line 6

def initialize(env)
  super
  @server_def[:username] = 'ubuntu'
  @server_def[:groups] = ['d2-server']
  
end

Instance Method Details

#connectObject



13
14
15
16
17
# File 'lib/migrant/clouds/aws.rb', line 13

def connect
  @connection = Fog::Compute.new(:provider => 'AWS',
                                 :aws_access_key_id => @environment.setting('provider.access_key'),
                                 :aws_secret_access_key => @environment.setting('provider.secret_key'))
end

#log_server_infoObject



19
20
21
22
23
24
# File 'lib/migrant/clouds/aws.rb', line 19

def log_server_info
  super
  @environment.ui.notice "  Flavor:     #{@environment.server.flavor.name}"
  @environment.ui.notice "DNS Name:     #{@environment.server.dns_name}"
  @environment.ui.notice "    Zone:     #{@environment.server.availability_zone}"
end