Class: Stackster::AWS::EC2

Inherits:
Object
  • Object
show all
Defined in:
lib/stackster/aws/ec2.rb

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ EC2

Returns a new instance of EC2.



7
8
9
10
11
12
# File 'lib/stackster/aws/ec2.rb', line 7

def initialize(args)
  c = args[:config]
  @connect = Fog::Compute::AWS.new :aws_access_key_id => c.access_key,
                                   :aws_secret_access_key => c.secret_key,
                                   :region => c.region
end

Instance Method Details

#describe_instance(instance) ⇒ Object



14
15
16
17
# File 'lib/stackster/aws/ec2.rb', line 14

def describe_instance(instance)
  @connect.describe_instances('instance-state-name' => 'running',
                              'instance-id' => instance).body['reservationSet']
end