Class AWS::EC2::VolumeCollection
In: lib/aws/ec2/volume_collection.rb
Parent: Collection

Represents a collection of Amazon EBS volumes. Typically you should get an instance of this class by calling {EC2#volumes}.

@example Create an empty 15GiB volume

  ec2.volumes.create(:size => 15, :availability_zone => "us-west-2a")

@example Get a volume by ID

  volume = ec2.volumes["vol-123"]
  volume.exists?

@example Get a map of volume IDs to volume status

  ec2.volumes.inject({}) { |m, v| m[v.id] = v.status; m }
  # => { "vol-12345678" => :available, "vol-87654321" => :in_use }

Methods

create   each   member_class  

Included Modules

TaggedCollection

Public Instance methods

Creates a new Amazon EBS volume that any Amazon EC2 instance in the same Availability Zone can attach to. For more information about Amazon EBS, go to the [Amazon Elastic Compute Cloud User Guide](docs.amazonwebservices.com/AWSEC2/latest/UserGuide/index.html?using-ebs.html).

@return [Volume] An object representing the new volume.

@param [Hash] options Options for creating the volume.

  `:availability_zone` and one of `:size`, `:snapshot`, or
  `:snapshot_id` is required.

@option options [Integer] :size The size of the volume, in

  GiBs.  Valid values: 1 - 1024.  If `:snapshot` or
  `:snapshot_id` is specified, this defaults to the size of
  the specified snapshot.

@option options [Snapshot] :snapshot The snapshot from which to

  create the new volume.

@option options [String] :snapshot_id The ID of the snapshot

  from which to create the new volume.

@option options [String, AvailabilityZone] :availability_zone

  The Availability Zone in which to create the new volume.
  To get a list of the availability zones you can use, see
  {EC2#availability_zones}.

@option options [String] :iops

@option options [String] :volume_type

@return [Volume]

@yield [Instance] Yields each volume in the collection. @return [nil]

Protected Instance methods

@api private

[Validate]