Module: CloudInfo::Instances::Aws

Included in:
CloudInfo::Instances
Defined in:
lib/cloud_info/instances.rb

Instance Method Summary collapse

Instance Method Details

#aws_group_for_instance_id(instance_id) ⇒ Object



127
128
129
130
# File 'lib/cloud_info/instances.rb', line 127

def aws_group_for_instance_id(instance_id)
  instance = aws_instances.find{|x| x[:aws_instance_id] == instance_id}
  aws_group = instance[:aws_groups].first
end

#aws_groupsObject



123
124
125
# File 'lib/cloud_info/instances.rb', line 123

def aws_groups
  @@aws_groups ||= aws_instances.collect{|x| x[:aws_groups]}.flatten.uniq
end

#aws_instancesObject



119
120
121
# File 'lib/cloud_info/instances.rb', line 119

def aws_instances
  @@aws_instances ||= @ec2.describe_instances
end