Skip to content

EC2  >  Operations  >  delete_snapshot

delete_snapshot

Operation

delete_snapshot async

delete_snapshot(input: DeleteSnapshotInput, plugins: list[Plugin] | None = None) -> DeleteSnapshotOutput

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 deregister the AMI before you can delete the snapshot.

For more information, see Delete an Amazon EBS snapshot in the Amazon EBS User Guide.

Parameters:

Name Type Description Default
input DeleteSnapshotInput

An instance of DeleteSnapshotInput.

required
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None

Returns:

Type Description
DeleteSnapshotOutput

An instance of DeleteSnapshotOutput.

Input

DeleteSnapshotInput dataclass

Bases: _SerdeShape

Dataclass for DeleteSnapshotInput structure.

Attributes

dry_run class-attribute instance-attribute
dry_run: bool | None = ...

Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

snapshot_id class-attribute instance-attribute
snapshot_id: str | None = ...

The ID of the EBS snapshot.

Output

DeleteSnapshotOutput dataclass

Bases: _SerdeShape

Dataclass for DeleteSnapshotOutput structure.

Attributes

response_metadata class-attribute instance-attribute
response_metadata: ResponseMetadata = ...

Metadata about the response that produced this output. Use this to recover the request identifiers a service's support team needs in order to investigate a call. Members of the metadata are individually optional.