Method: AWS::EC2::Base#create_snapshot

Defined in:
lib/AWS/EC2/snapshots.rb

#create_snapshot(options = {}) ⇒ Object

The CreateSnapshot operation creates a snapshot of an Amazon EBS volume and stores it in Amazon S3. You can use snapshots for backups, to launch instances from identical snapshots, and to save data before shutting down an instance.

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :volume_id (String) — default: ''
  • :description (optional, String) — default: ''

    Description of the Amazon EBS snapshot.

Raises:



27
28
29
30
31
32
33
34
35
# File 'lib/AWS/EC2/snapshots.rb', line 27

def create_snapshot( options = {} )
  options = { :volume_id => '' }.merge(options)
  raise ArgumentError, "No :volume_id provided" if options[:volume_id].nil? || options[:volume_id].empty?
  params = {
    "VolumeId" => options[:volume_id]
  }
  params["Description"] = options[:description] unless options[:description].nil?
  return response_generator(:action => "CreateSnapshot", :params => params)
end