You are viewing documentation for version 2 of the AWS SDK for Ruby. Version 3 documentation can be found here.
Class: Aws::EC2::Snapshot
- Inherits:
-
Resources::Resource
- Object
- Resources::Resource
- Aws::EC2::Snapshot
- Defined in:
- (unknown)
Instance Attribute Summary collapse
-
#data_encryption_key_id ⇒ String
readonly
The data encryption key identifier for the snapshot.
-
#description ⇒ String
readonly
The description for the snapshot.
-
#encrypted ⇒ Boolean
readonly
Indicates whether the snapshot is encrypted.
-
#id ⇒ String
readonly
-
#kms_key_id ⇒ String
readonly
The Amazon Resource Name (ARN) of the AWS Key Management Service (AWS KMS) customer master key (CMK) that was used to protect the volume encryption key for the parent volume.
-
#owner_alias ⇒ String
readonly
The AWS owner alias, from an Amazon-maintained list (
amazon
). -
#owner_id ⇒ String
readonly
The AWS account ID of the EBS snapshot owner.
-
#progress ⇒ String
readonly
The progress of the snapshot, as a percentage.
-
#snapshot_id ⇒ String
readonly
The ID of the snapshot.
-
#start_time ⇒ Time
readonly
The time stamp when the snapshot was initiated.
-
#state ⇒ String
readonly
The snapshot state.
-
#state_message ⇒ String
readonly
Encrypted Amazon EBS snapshots are copied asynchronously.
-
#tags ⇒ Array<Types::Tag>
readonly
Any tags assigned to the snapshot.
-
#volume_id ⇒ String
readonly
The ID of the volume that was used to create the snapshot.
-
#volume_size ⇒ Integer
readonly
The size of the volume, in GiB.
Attributes inherited from Resources::Resource
Instance Method Summary collapse
-
#copy(options = {}) ⇒ Types::CopySnapshotResult
Copies a point-in-time snapshot of an EBS volume and stores it in Amazon S3.
-
#create_tags(options = {}) ⇒ Array<Tag>
-
#delete(options = {}) ⇒ Struct
Deletes the specified snapshot.
When you make periodic snapshots of a volume, the snapshots are incremental, and only the blocks on the device that have changed since your last snapshot are saved in the new snapshot.
-
#delete_tags(options = {}) ⇒ Array<Tag>
-
#describe_attribute(options = {}) ⇒ Types::DescribeSnapshotAttributeResult
Describes the specified attribute of the specified snapshot.
-
#initialize ⇒ Object
constructor
-
#modify_attribute(options = {}) ⇒ Struct
Adds or removes permission settings for the specified snapshot.
-
#reset_attribute(options = {}) ⇒ Struct
Resets permission settings for the specified snapshot.
For more information about modifying snapshot permissions, see Sharing snapshots in the Amazon Elastic Compute Cloud User Guide.
. -
#volume ⇒ Volume?
-
#wait_until_completed {|waiter| ... } ⇒ Snapshot
Waits until this Snapshot is completed.
Methods inherited from Resources::Resource
add_data_attribute, add_identifier, #data, data_attributes, #data_loaded?, identifiers, #load, #wait_until
Methods included from Resources::OperationMethods
#add_batch_operation, #add_operation, #batch_operation, #batch_operation_names, #batch_operations, #operation, #operation_names, #operations
Constructor Details
#initialize(id, options = {}) ⇒ Object #initialize(options = {}) ⇒ Object
Instance Attribute Details
#data_encryption_key_id ⇒ String (readonly)
The data encryption key identifier for the snapshot. This value is a unique identifier that corresponds to the data encryption key that was used to encrypt the original volume or snapshot copy. Because data encryption keys are inherited by volumes created from snapshots, and vice versa, if snapshots share the same data encryption key identifier, then they belong to the same volume/snapshot lineage. This parameter is only returned by DescribeSnapshots.
#description ⇒ String (readonly)
The description for the snapshot.
#encrypted ⇒ Boolean (readonly)
Indicates whether the snapshot is encrypted.
#id ⇒ String (readonly)
#kms_key_id ⇒ String (readonly)
The Amazon Resource Name (ARN) of the AWS Key Management Service (AWS KMS) customer master key (CMK) that was used to protect the volume encryption key for the parent volume.
#owner_alias ⇒ String (readonly)
The AWS owner alias, from an Amazon-maintained list (amazon
). This is
not the user-configured AWS account alias set using the IAM console.
#owner_id ⇒ String (readonly)
The AWS account ID of the EBS snapshot owner.
#progress ⇒ String (readonly)
The progress of the snapshot, as a percentage.
#snapshot_id ⇒ String (readonly)
The ID of the snapshot. Each snapshot receives a unique identifier when it is created.
#start_time ⇒ Time (readonly)
The time stamp when the snapshot was initiated.
#state ⇒ String (readonly)
The snapshot state.
Possible values:
- pending
- completed
- error
#state_message ⇒ String (readonly)
Encrypted Amazon EBS snapshots are copied asynchronously. If a snapshot copy operation fails (for example, if the proper AWS Key Management Service (AWS KMS) permissions are not obtained) this field displays error state details to help you diagnose why the error occurred. This parameter is only returned by DescribeSnapshots.
#tags ⇒ Array<Types::Tag> (readonly)
Any tags assigned to the snapshot.
#volume_id ⇒ String (readonly)
The ID of the volume that was used to create the snapshot. Snapshots created by the CopySnapshot action have an arbitrary volume ID that should not be used for any purpose.
#volume_size ⇒ Integer (readonly)
The size of the volume, in GiB.
Instance Method Details
#copy(options = {}) ⇒ Types::CopySnapshotResult
Copies a point-in-time snapshot of an EBS volume and stores it in Amazon S3. You can copy the snapshot within the same Region or from one Region to another. You can use the snapshot to create EBS volumes or Amazon Machine Images (AMIs).
Copies of encrypted EBS snapshots remain encrypted. Copies of unencrypted snapshots remain unencrypted, unless you enable encryption for the snapshot copy operation. By default, encrypted snapshot copies use the default AWS Key Management Service (AWS KMS) customer master key (CMK); however, you can specify a different CMK.
To copy an encrypted snapshot that has been shared from another account, you must have permissions for the CMK used to encrypt the snapshot.
Snapshots created by copying another snapshot have an arbitrary volume ID that should not be used for any purpose.
For more information, see Copying an Amazon EBS snapshot in the Amazon Elastic Compute Cloud User Guide.
#create_tags(options = {}) ⇒ Array<Tag>
#delete(options = {}) ⇒ Struct
Deletes the specified snapshot.
When you make periodic snapshots of a volume, the snapshots are incremental, and only the blocks on the device that have changed since your last snapshot are saved in the new snapshot. When you delete a snapshot, only the data not needed for any other snapshot is removed. So regardless of which prior snapshots have been deleted, all active snapshots will have access to all the information needed to restore the volume.
You cannot delete a snapshot of the root device of an EBS volume used by a registered AMI. You must first de-register the AMI before you can delete the snapshot.
For more information, see Deleting an Amazon EBS snapshot in the Amazon Elastic Compute Cloud User Guide.
#delete_tags(options = {}) ⇒ Array<Tag>
#describe_attribute(options = {}) ⇒ Types::DescribeSnapshotAttributeResult
Describes the specified attribute of the specified snapshot. You can specify only one attribute at a time.
For more information about EBS snapshots, see Amazon EBS Snapshots in the Amazon Elastic Compute Cloud User Guide.
#modify_attribute(options = {}) ⇒ Struct
Adds or removes permission settings for the specified snapshot. You may add or remove specified AWS account IDs from a snapshot's list of create volume permissions, but you cannot do both in a single operation. If you need to both add and remove account IDs for a snapshot, you must use multiple operations. You can make up to 500 modifications to a snapshot in a single operation.
Encrypted snapshots and snapshots with AWS Marketplace product codes cannot be made public. Snapshots encrypted with your default CMK cannot be shared with other accounts.
For more information about modifying snapshot permissions, see Sharing snapshots in the Amazon Elastic Compute Cloud User Guide.
#reset_attribute(options = {}) ⇒ Struct
Resets permission settings for the specified snapshot.
For more information about modifying snapshot permissions, see Sharing snapshots in the Amazon Elastic Compute Cloud User Guide.
#volume ⇒ Volume?
#wait_until_completed {|waiter| ... } ⇒ Snapshot
Waits until this Snapshot is completed. This method waits by polling Client#describe_snapshots until successful. An error is raised after a configurable number of failed checks.
This waiter uses the following defaults:
Configuration | Default |
---|---|
#delay |
15 |
#max_attempts |
40 |
You can modify defaults and register callbacks by passing a block argument.