Class: AWS::EC2::Instance

Inherits:
Object
  • Object
show all
Defined in:
lib/mongolly/extensions/aws/ec2/instance.rb

Instance Method Summary collapse

Instance Method Details

#volumes_with_tag(key) ⇒ Object



5
6
7
8
9
10
11
12
13
# File 'lib/mongolly/extensions/aws/ec2/instance.rb', line 5

def volumes_with_tag(key)
  volumes = []
  attachments.each do |_, attachment|
    next  unless attachment.status == :attached
    volume = attachment.volume
    volumes << volume if volume.status == :in_use && volume.tags.key?(key)
  end
  volumes
end