

# Archive Amazon EBS snapshots
<a name="snapshot-archive"></a>

Amazon EBS Snapshots Archive is a storage tier that you can use for low-cost, long-term storage of your rarely-accessed snapshots that do not need frequent or fast retrieval.

By default, when you create a snapshot, it is stored in the Amazon EBS Snapshot Standard tier (*standard tier*). Snapshots stored in the standard tier are incremental. This means that only the blocks on the volume that have changed after your most recent snapshot are saved.

When you archive a snapshot, the incremental snapshot is converted to a full snapshot, and it is moved from the standard tier to the Amazon EBS Snapshots Archive tier (*archive tier*). Full snapshots include all of the blocks that were written to the volume at the time when the snapshot was created.

When you need to access an archived snapshot, you can restore it from the archive tier to the standard tier, and then use it in the same way that you use any other snapshot in your account.

Amazon EBS Snapshots Archive offers up to 75 percent lower snapshot storage costs for snapshots that you plan to store for 90 days or longer and that you rarely need to access.

Some typical use cases include:
+ Archiving the only snapshot of a volume, such as end-of-project snapshots
+ Archiving full, point-in-time incremental snapshots for compliance reasons.
+ Archiving monthly, quarterly, or yearly incremental snapshots.

**Topics**
+ [Quotas](#archive-quotas)
+ [Considerations and limitations](snapshot-archive-considerations.md)
+ [Pricing and billing](snapshot-archive-pricing.md)
+ [Guidelines and best practices](archiving-guidelines.md)
+ [Required permissions](snapshot-archiving-iam.md)
+ [Archive a snapshot](archive-snapshot.md)
+ [Restore an archived snapshot](restore-archived-snapshot.md)
+ [Modify the restore period](modify-temp-restore-period.md)
+ [View archived snapshots](view-archived-snapshot.md)
+ [Monitor snapshot archiving](monitor-snapshot-archiving.md)

## Quotas
<a name="archive-quotas"></a>

This section describes the default quotas for archived and in-progress snapshots. 


| Quota | Default quota | 
| --- | --- | 
| Archived snapshots per volume | 25 | 
| Concurrent in-progress snapshot archives per account | 25 | 
| Concurrent in-progress snapshot restores per account | 5 | 

If you need more than the default limits, complete the Support Center [Create case](https://console.aws.amazon.com/support/home#/case/create?issueType=service-limit-increase&limitType=service-code-ebs) form to request a limit increase. 

# Considerations and limitations for archiving Amazon EBS snapshots
<a name="snapshot-archive-considerations"></a>

Keep the following in mind when archiving Amazon EBS snapshots.

**Considerations**
+ The minimum archive period is 90 days. If you delete or permanently restore an archived snapshot before the minimum archive period of 90 days, you are billed for remaining days in the archive tier, rounded to the nearest hour. For more information, see [Pricing and billing for archiving Amazon EBS snapshots](snapshot-archive-pricing.md).
+ It can take up to 72 hours to restore an archived snapshot from the archive tier to the standard tier, depending on the size of the snapshot.
+ Archived snapshots are always full snapshots. A full snapshot contains all the blocks written to the volume at the time the snapshot was created. The full snapshot will likely be larger than the incremental snapshot from which it was created. However, if you have only one snapshot of a volume on the standard tier, the size of the full snapshot in the archive tier will be the same size as the snapshot in standard tier. This is because the first snapshot taken of a volume is always a full snapshot. To get the full snapshot size, use the [ describe-snapshots](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-snapshots.html) AWS CLI command.
+ Archiving is recommended for monthly, quarterly, or yearly snapshots. Archiving daily incremental snapshots of a single volume can lead to higher costs when compared to keeping them in the standard tier.
+ When a snapshot is archived, the data of the snapshot that is referenced by other snapshots in the snapshot lineage are retained in the standard tier. Data and storage costs associated with the referenced data that is retained on the standard tier are allocated to the next snapshot in the lineage. This ensures that subsequent snapshots in the lineage are not affected by the archival.
+ If you delete an archived snapshot that matches a Recycle Bin retention rule, the archived snapshot is retained in the Recycle Bin for the retention period defined in the retention rule. To use the snapshot, you must first recover it from the Recycle Bin and then restore it from the archive tier. For more information, see [Recycle Bin](recycle-bin.md) and [Pricing and billing for archiving Amazon EBS snapshots](snapshot-archive-pricing.md).
+ You can't use an archived snapshot in a block device mapping or to create an Amazon EBS volume.
+ You can archive snapshots created by AWS Backup using the AWS Backup console, APIs, or command line tools. For more information, see [ Creating a backup plan](https://docs.aws.amazon.com/aws-backup/latest/devguide/creating-a-backup-plan.html) in the *AWS Backup Developer Guide*.

**Limitations**
+ You can archive snapshots that are in the `completed` state only.
+ You can archive only snapshots that you own in your account. To archive a snapshot that is shared with you, first copy the snapshot to your account and then archive the snapshot copy.
+ Before you can use an archived snapshot, you must first restore it to the standard tier. Restoring to the standard tier is required to create a volume from the snapshot through the `CreateVolume` and `RunInstances` API operations as well as to share or copy a snapshot. For more information, see [Restore an archived Amazon EBS snapshot](restore-archived-snapshot.md).
+ You can archive a snapshot that is associated with one or more AMIs only if all of the associated AMIs are disabled. For more information, see [Disable an AMI](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/disable-an-ami.html).
+ You can't enable a disabled AMI if the associated snapshots are temporarily restored. All of the associated snapshots must be permanently restored before you can enable the AMI.
+ You can't cancel the snapshot archive or snapshot restore process after it has been started.
+ You can't share archived snapshots. If you archive a snapshot that you have shared with other accounts, the accounts with which the snapshot is shared lose access after the snapshot is archived.
+ You can't copy an archived snapshot. If you need to copy an archived snapshot, you must first restore it.
+ You can't enable fast snapshot restore for an archived snapshot. Fast snapshot restore is automatically disabled when a snapshot is archived. If you need to use fast snapshot restore, you must manually enable it after restoring the snapshot.

# Pricing and billing for archiving Amazon EBS snapshots
<a name="snapshot-archive-pricing"></a>

Archived snapshots are billed at a rate of \$10.0125 per GB-month. For example, if you archive a 100 GiB snapshot, you are billed \$11.25 (100 GiB \$1 \$10.0125) per month.

Snapshot restores are billed at a rate of \$10.03 per GB of data restored. For example, if you restore a 100 GiB snapshot from the archive tier, you are billed one time for \$13 (100 GiB \$1 \$10.03).

After the snapshot is restored to the standard tier, the snapshot is billed at the standard rate for snapshots of \$10.05 per GB-month. 

For more information, see [Amazon EBS pricing](https://aws.amazon.com/ebs/pricing/).

**Billing for the minimum archive period**  
The minimum archive period is 90 days. If you delete or permanently restore an archived snapshot before the minimum archive period of 90 days, you are billed a pro-rated charge equal to the archive tier storage charge for the remaining days, rounded to the nearest hour. For example, if you delete or permanently restore an archived snapshot after 40 days, you are billed for the remaining 50 days of the minimum archive period.

**Note**  
Temporarily restoring an archived snapshot before the minimum archive period of 90 days does not incur this charge.

**Temporary restores**  
When you temporarily restore a snapshot, the snapshot is restored from the archive tier to the standard tier, and a copy of the snapshot remains in the archive tier. You are billed for both the snapshot in the standard tier and the snapshot copy in the archive tier for the duration of the temporary restore period. When the temporarily restored snapshot is removed from the standard tier, you are no longer billed for it, and you are billed for the snapshot in the archive tier only.

**Permanent restores**  
When you permanently restore a snapshot, the snapshot is restored from the archive tier to the standard tier, and the snapshot is deleted from the archive tier. You are billed for the snapshot in the standard tier only.

**Deleting snapshots**  


If you delete a snapshot while it is being archived, you are billed for the snapshot data that has already been moved to the archive tier. This data is subject to the minimum archive period of 90 days and billed accordingly upon deletion. For example, if you archive a 100 GiB snapshot, and you delete the snapshot after only 40 GiB has been archived, you are billed \$11.50 for the minimum archive period of 90 days for the 40 GiB that has already been archived (\$10.0125 per GB-month \$1 40 GB \$1 (90 days \$1 24 hours) / (24 hours/day \$1 30-day month).

If you delete a snapshot while it is being restored from the archive tier, you are billed for the snapshot restore for the full size of the snapshot (snapshot size \$1 \$10.03). For example, if you restore a 100 GiB snapshot from the archive tier, and you delete the snapshot at any point before the snapshot restore completes, you are billed \$13 (100 GiB snapshot size \$1 \$10.03).

**Recycle Bin**  
Archived snapshots are billed at the rate for archived snapshots while they are in the Recycle Bin. Archived snapshots that are in the Recycle Bin are subject to the minimum archive period of 90 days and they are billed accordingly if they are deleted by Recycle Bin before the minimum archive period. In other words, if a retention rule deletes an archived snapshot from the Recycle Bin before the minimum period of 90 days, you are billed for the remaining days.

If you delete a snapshot that matches a retention rule while the snapshot is being archived, the archived snapshot is retained in the Recycle Bin for the retention period defined in the retention rule. It is billed at the rate for archived snapshots.

If you delete a snapshot that matches a retention rule while the snapshot is being restored, the restored snapshot is retained in the Recycle Bin for the remainder of the retention period, and billed at the standard snapshot rate. To use the restored snapshot, you must first recover it from the Recycle Bin.

For more information, see [Recycle Bin](recycle-bin.md).

**Cost tracking**  
Archived snapshots appear in the AWS Cost and Usage Report with their same resource ID and Amazon Resource Name (ARN). For more information, see the [AWS Cost and Usage Report User Guide](https://docs.aws.amazon.com/cur/latest/userguide/what-is-cur.html).

You can use the following usage types to identify the associated costs:
+ `SnapshotArchiveStorage` — fee for monthly data storage
+ `SnapshotArchiveRetrieval` — one-time fee for snapshot restores
+ `SnapshotArchiveEarlyDelete` — fee for deleting or permanently restoring a snapshot before the minimum archive period (90 days)

# Guidelines and best practices for archiving Amazon EBS snapshots
<a name="archiving-guidelines"></a>

This section provides some guidelines and best practices for archiving snapshots.

**Topics**
+ [Archiving the only snapshot of a volume](#guidelines-single-snapshot)
+ [Archiving incremental snapshots of a single volume](#guidelines-incremental-snapshot)
+ [Archiving full snapshots for compliance reasons](#guidelines-full-snapshot)
+ [Determining the reduction in standard tier storage costs](#archive-guidelines)

## Archiving the only snapshot of a volume
<a name="guidelines-single-snapshot"></a>

When you have only one snapshot of a volume, the snapshot is always the same size as the blocks written to the volume at the time the snapshot was created. When you archive such a snapshot, the snapshot in the standard tier is converted to an equivalent-sized full snapshot and it is moved from the standard tier to the archive tier.

Archiving these snapshots can help you save with lower storage costs. If you no longer need the source volume, you can delete the volume for further storage cost savings.

![\[Creating a snapshot, archiving it, and then deleting the source volume.\]](http://docs.aws.amazon.com/ebs/latest/userguide/images/archive-single-snap.png)


## Archiving incremental snapshots of a single volume
<a name="guidelines-incremental-snapshot"></a>

When you archive an incremental snapshot, the snapshot is converted to a full snapshot and it is moved to the archive tier. For example, in the following image, if you archive **Snap B**, the snapshot is converted to a full snapshot that is 10 GiB in size and moved to the archive tier. Similarly, if you archive **Snap C**, the size of the full snapshot in the archive tier is 14 GiB.

![\[Archiving incremental snapshots of a volume.\]](http://docs.aws.amazon.com/ebs/latest/userguide/images/snapshot_1e.png)


If you are archiving snapshots to reduce your storage costs in the standard tier, you should not archive the first snapshot in a set of incremental snapshots. These snapshots are referenced by subsequent snapshots in the snapshot lineage. In most cases, archiving these snapshots will not reduce storage costs.

**Note**  
You should not archive the last snapshot in a set of incremental snapshots. The last snapshot is the most recent snapshot taken of a volume. You will need this snapshot in the standard tier if you want to create volumes from it in the case of a volume corruption or loss.

If you archive a snapshot that contains data that is referenced by a later snapshot in the lineage, the data storage and storage costs associated with the referenced data are allocated to the later snapshot in the lineage. In this case, archiving the snapshot will not reduce data storage or storage costs. For example, in the preceding image, if you archive **Snap B**, its 4 GiB of data is attributed to **Snap C**. In this case, your overall storage costs will increase because you incur storage costs for the full version of **Snap B** in the archive tier, and your storage costs for the standard tier remain unchanged.

If you archive **Snap C**, your standard tier storage will decrease by 4 GiB because the data is not referenced by any other snapshots later in the lineage. And your archive tier storage will increase by 14 GiB because the snapshot is converted to a full snapshot.

## Archiving full snapshots for compliance reasons
<a name="guidelines-full-snapshot"></a>

You might need to create full backups of volumes on a monthly, quarterly, or yearly basis for compliance reasons. For these backups, you might need standalone snapshots without backward or forward references to other snapshots in the snapshot lineage. Snapshots archived with EBS Snapshots Archive are full snapshots, and they do not have any references to other snapshots in the lineage. Additionally, you will likely need to retain these snapshots for compliance reasons for several years. EBS Snapshots Archive makes it cost-effective to archive these full snapshots for long-term retention.

## Determining the reduction in standard tier storage costs
<a name="archive-guidelines"></a>

If you want to archive an incremental snapshot to reduce your storage costs, you should consider the size of the full snapshot in the archive tier and the reduction in storage in the standard tier. This section explains how to do this.

**Important**  
The API responses are data accurate at the point-in-time when the APIs are called. API responses can differ as the data associated with a snapshot changes as a result of changes in the snapshot lineage.

To determine the reduction in storage and storage costs in the standard tier, use the following steps.

1. For the snapshot that you want to archive, check the full snapshot size and the source volume from which it was created. Use the [ describe-snapshots](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-snapshots.html) command, and for `--snapshot-id`, specify the ID of the snapshot that you want to archive.

   ```
   $ aws ec2 describe-snapshots --snapshot-id snapshot_id
   ```

   The `FullSnapshotSizeInBytes` reponse value indicates the full snapshot size, in bytes, and the `VolumeId` response value indicates the ID of the source volume.

   For example, the following command returns information about snapshot `snap-09c9114207084f0d9`.

   ```
   $ aws ec2 describe-snapshots --snapshot-id snap-09c9114207084f0d9
   ```

   The following example output shows that the full snapshot size is `5678912341` bytes (5.28 GiB), and the source volume is `vol-0f3e2c292c52b85c3`.

   ```
   {
       "Snapshots": [
           {
               "Description": "", 
               "Tags": [], 
               "Encrypted": false, 
               "VolumeId": "vol-0f3e2c292c52b85c3",
               "State": "completed", 
               "VolumeSize": 8, 
               "StartTime": "2021-11-16T08:29:49.840Z", 
               "Progress": "100%", 
               "OwnerId": "123456789012", 
               "FullSnapshotSizeInBytes" : "5678912341",
               "SnapshotId": "snap-09c9114207084f0d9"
           }
       ]
   }
   ```

1. Find all of the snapshots created from the source volume. Use the [describe-snapshots](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-snapshots.html) command. Specify the `volume-id` filter, and for the filter value, specify the volume ID from the previous step.

   ```
   $ aws ec2 describe-snapshots --filters "Name=volume-id, Values=volume_id"
   ```

   For example, the following command returns all snapshots created from volume `vol-0f3e2c292c52b85c3`.

   ```
   $ aws ec2 describe-snapshots --filters "Name=volume-id, Values=vol-0f3e2c292c52b85c3"
   ```

   The following is the command output, which indicates that three snapshots were created from volume `vol-0f3e2c292c52b85c3`.

   ```
   {
       "Snapshots": [
           {
               "Description": "", 
               "Tags": [], 
               "Encrypted": false, 
               "VolumeId": "vol-0f3e2c292c52b85c3", 
               "State": "completed", 
               "VolumeSize": 8, 
               "StartTime": "2021-11-14T08:57:39.300Z",
               "Progress": "100%", 
               "OwnerId": "123456789012", 
               "SnapshotId": "snap-08ca60083f86816b0"
           }, 
           {
               "Description": "", 
               "Tags": [], 
               "Encrypted": false, 
               "VolumeId": "vol-0f3e2c292c52b85c3", 
               "State": "completed", 
               "VolumeSize": 8, 
               "StartTime": "2021-11-15T08:29:49.840Z", 
               "Progress": "100%", 
               "OwnerId": "123456789012", 
               "SnapshotId": "snap-09c9114207084f0d9"
           }, 
           {
               "Description": "01", 
               "Tags": [], 
               "Encrypted": false, 
               "VolumeId": "vol-0f3e2c292c52b85c3", 
               "State": "completed", 
               "VolumeSize": 8, 
               "StartTime": "2021-11-16T07:50:08.042Z", 
               "Progress": "100%", 
               "OwnerId": "123456789012", 
               "SnapshotId": "snap-024f49fe8dd853fa8"
           }
       ]
   }
   ```

1. Using the output from the previous command, sort the snapshots by their creation times, from oldest to newest. The `StartTime` response parameter for each snapshot indicates its creation time, in UTC time format.

   For example, the snapshots returned in the previous step arranged by creation time, from oldest to newest, is as follows:

   1. `snap-08ca60083f86816b0` (oldest – created before the snapshot that you want to archive)

   1. `snap-09c9114207084f0d9` (the snapshot to archive)

   1. `snap-024f49fe8dd853fa8` (newest – created after the snapshot that you that want to archive)

1. Identify the snapshots that were created immediately before and after the snapshot that you want to archive. In this case, you want to archive snapshot `snap-09c9114207084f0d9`, which was the second incremental snapshot created in the set of three snapshots. Snapshot `snap-08ca60083f86816b0` was created immediately before, and snapshot `snap-024f49fe8dd853fa8` was created immediately after.

1. Find the unreferenced data in the snapshot that you want to archive. First, find the blocks that are different between the snapshot that was created immediately before the snapshot that you want to archive, and the snapshot that you want to archive. Use the [list-changed-blocks](https://docs.aws.amazon.com/cli/latest/reference/ebs/list-changed-blocks.html) command. For `--first-snapshot-id`, specify the ID of the snapshot that was created immediately before the snapshot that you want to archive. For `--second-snapshot-id`, specify the ID of the snapshot that you want to archive.

   ```
   $ aws ebs list-changed-blocks --first-snapshot-id snapshot_created_before --second-snapshot-id snapshot_to_archive
   ```

   For example, the following command shows the block indexes for the blocks that are different between snapshot `snap-08ca60083f86816b0` (the snapshot created before the snapshot you want to archive), and snapshot `snap-09c9114207084f0d9` (the snapshot you want to archive).

   ```
   $ aws ebs list-changed-blocks --first-snapshot-id snap-08ca60083f86816b0 --second-snapshot-id snap-09c9114207084f0d9
   ```

   The following shows the command output, with some blocks omitted.

   ```
   {
       "BlockSize": 524288, 
       "ChangedBlocks": [
           {
               "FirstBlockToken": "ABgBAX6y+WH6Rm9y5zq1VyeTCmEzGmTT0jNZG1cDirFq1rOVeFbWXsH3W4z/", 
               "SecondBlockToken": "ABgBASyx0bHHBnTERu+9USLxYK/81UT0dbHIUFqUjQUkwTwK5qkjP8NSGyNB", 
               "BlockIndex": 4
           }, 
           {
               "FirstBlockToken": "ABgBAcfL+EfmQmlNgstqrFnYgsAxR4SDSO4LkNLYOOChGBWcfJnpn90E9XX1", 
               "SecondBlockToken": "ABgBAdX0mtX6aBAt3EBy+8jFCESMpig7csKjbO2Ocd08m2iNJV2Ue+cRwUqF", 
               "BlockIndex": 5
           }, 
           {
               "FirstBlockToken": "ABgBAVBaFJmbP/eRHGh7vnJlAwyiyNUi3MKZmEMxs2wC3AmM/fc6yCOAMb65", 
               "SecondBlockToken": "ABgBAdewWkHKTcrhZmsfM7GbaHyXD1Ctcn2nppz4wYItZRmAo1M72fpXU0Yv", 
               "BlockIndex": 13
           }, 
           {
               "FirstBlockToken": "ABgBAQGxwuf6z095L6DpRoVRVnOqPxmx9r7Wf6O+i+ltZ0dwPpGN39ijztLn", 
               "SecondBlockToken": "ABgBAUdlitCVI7c6hGsT4ckkKCw6bMRclnV+bKjViu/9UESTcW7CD9w4J2td", 
               "BlockIndex": 14
           }, 
           {
               "FirstBlockToken": "ABgBAZBfEv4EHS1aSXTXxSE3mBZG6CNeIkwxpljzmgSHICGlFmZCyJXzE4r3", 
               "SecondBlockToken": "ABgBAVWR7QuQQB0AP2TtmNkgS4Aec5KAQVCldnpc91zBiNmSfW9ouIlbeXWy", 
               "BlockIndex": 15
           },
           .....
           {
               "SecondBlockToken": "ABgBAeHwXPL+z3DBLjDhwjdAM9+CPGV5VO5Q3rEEA+ku50P498hjnTAgMhLG", 
               "BlockIndex": 13171
           }, 
           {
               "SecondBlockToken": "ABgBAbZcPiVtLx6U3Fb4lAjRdrkJMwW5M2tiCgIp6ZZpcZ8AwXxkjVUUHADq", 
               "BlockIndex": 13172
           }, 
           {
               "SecondBlockToken": "ABgBAVmEd/pQ9VW9hWiOujOAKcauOnUFCO+eZ5ASVdWLXWWC04ijfoDTpTVZ", 
               "BlockIndex": 13173
           }, 
           {
               "SecondBlockToken": "ABgBAT/jeN7w+8ALuNdaiwXmsSfM6tOvMoLBLJ14LKvavw4IiB1d0iykWe6b", 
               "BlockIndex": 13174
           }, 
           {
               "SecondBlockToken": "ABgBAXtGvUhTjjUqkwKXfXzyR2GpQei/+pJSG/19ESwvt7Hd8GHaUqVs6Zf3", 
               "BlockIndex": 13175
           }
       ], 
       "ExpiryTime": 1637648751.813, 
       "VolumeSize": 8
   }
   ```

   Next, use the same command to find blocks that are different between the snapshot that you want to archive and the snapshot that was created immediately after it. For `--first-snapshot-id`, specify the ID of the snapshot that you want to archive. For `--second-snapshot-id`, specify the ID of the snapshot that was created immediately after the snapshot that you want to archive.

   ```
   $ aws ebs list-changed-blocks --first-snapshot-id snapshot_to_archive --second-snapshot-id snapshot_created_after
   ```

   For example, the following command shows the block indexes of the blocks that are different between snapshot `snap-09c9114207084f0d9` (the snapshot that you want to archive) and snapshot `snap-024f49fe8dd853fa8` (the snapshot created after the snapshot that you want to archive).

   ```
   $ aws ebs list-changed-blocks --first-snapshot-id snap-09c9114207084f0d9 --second-snapshot-id snap-024f49fe8dd853fa8
   ```

   The following shows the command output, with some blocks omitted.

   ```
   {
       "BlockSize": 524288, 
       "ChangedBlocks": [
           {
               "FirstBlockToken": "ABgBAVax0bHHBnTERu+9USLxYK/81UT0dbSnkDk0gqwRFSFGWA7HYbkkAy5Y", 
               "SecondBlockToken": "ABgBASEvi9x8Om7Htp37cKG2NT9XUzEbLHpGcayelomSoHpGy8LGyvG0yYfK", 
               "BlockIndex": 4
           }, 
           {
               "FirstBlockToken": "ABgBAeL0mtX6aBAt3EBy+8jFCESMpig7csfMrI4ufnQJT3XBm/pwJZ1n2Uec", 
               "SecondBlockToken": "ABgBAXmUTg6rAI+v0LvekshbxCVpJjWILvxgC0AG0GQBEUNRVHkNABBwXLkO", 
               "BlockIndex": 5
           }, 
           {
               "FirstBlockToken": "ABgBATKwWkHKTcrhZmsfM7GbaHyXD1CtcnjIZv9YzisYsQTMHfTfh4AhS0s2", 
               "SecondBlockToken": "ABgBAcmiPFovWgXQio+VBrxOqGy4PKZ9SAAHaZ2HQBM9fQQU0+EXxQjVGv37", 
               "BlockIndex": 13
           }, 
           {
               "FirstBlockToken": "ABgBAbRlitCVI7c6hGsT4ckkKCw6bMRclnARrMt1hUbIhFnfz8kmUaZOP2ZE", 
               "SecondBlockToken": "ABgBAXe935n544+rxhJ0INB8q7pAeoPZkkD27vkspE/qKyvOwpozYII6UNCT", 
               "BlockIndex": 14
           }, 
           {
               "FirstBlockToken": "ABgBAd+yxCO26I+1Nm2KmuKfrhjCkuaP6LXuol3opCNk6+XRGcct4suBHje1", 
               "SecondBlockToken": "ABgBAcPpnXz821NtTvWBPTz8uUFXnS8jXubvghEjZulIjHgc+7saWys77shb", 
               "BlockIndex": 18
           },
           .....
           {
               "SecondBlockToken": "ABgBATni4sDE5rS8/a9pqV03lU/lKCW+CTxFl3cQ5p2f2h1njpuUiGbqKGUa", 
               "BlockIndex": 13190
           }, 
           {
               "SecondBlockToken": "ABgBARbXo7zFhu7IEQ/9VMYFCTCtCuQ+iSlWVpBIshmeyeS5FD/M0i64U+a9", 
               "BlockIndex": 13191
           }, 
           {
               "SecondBlockToken": "ABgBAZ8DhMk+rROXa4dZlNK45rMYnVIGGSyTeiMli/sp/JXUVZKJ9sMKIsGF", 
               "BlockIndex": 13192
           }, 
           {
               "SecondBlockToken": "ABgBATh6MBVE904l6sqOC27s1nVntFUpDwiMcRWGyJHy8sIgGL5yuYXHAVty", 
               "BlockIndex": 13193
           }, 
           {
               "SecondBlockToken": "ABgBARuZykaFBWpCWrJPXaPCneQMbyVgnITJqj4c1kJWPIj5Gn61OQyy+giN", 
               "BlockIndex": 13194
           }
       ], 
       "ExpiryTime": 1637692677.286, 
       "VolumeSize": 8
   }
   ```

1. Compare the output returned by both commands in the previous step. If the same block index appears in both command outputs, it indicates that the block contains unreferenced data.

   For example, the command output in the previous step indicates that blocks 4, 5, 13, and 14 are unique to snapshot `snap-09c9114207084f0d9` and that they are not referenced by any other snapshots in the snapshot lineage.

   To determine the reduction in standard tier storage, multiply the number of blocks that appear in both command outputs by 512 KiB, which is the snapshot block size.

   For example, if 9,950 block indexes appear in both command outputs, it indicates that you will decrease standard tier storage by around 4.85 GiB (9,950 blocks \$1 512 KiB = 4.85 GiB).

1. Determine the storage costs for storing the unreferenced blocks in the standard tier for 90 days. Compare this value with the cost of storing the full snapshot, described in step 1, in the archive tier. You can determine your costs savings by comparing the values, assuming that you do not restore the full snapshot from the archive tier during the minimum 90-day period. For more information, see [Pricing and billing for archiving Amazon EBS snapshots](snapshot-archive-pricing.md).

# Required IAM permissions for archiving Amazon EBS snapshots
<a name="snapshot-archiving-iam"></a>

By default, users don't have permission to use snapshot archiving. To allow users to use snapshot archiving, you must create IAM policies that grant permission to use specific resources and API actions. For more information, see [Creating IAM policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html) in the IAM User Guide.

To use snapshot archiving, users need the following permissions.
+ `ec2:DescribeSnapshotTierStatus`
+ `ec2:ModifySnapshotTier`
+ `ec2:RestoreSnapshotTier`

Console users might need additional permissions such as `ec2:DescribeSnapshots`.

To archive and restore encrypted snapshots, the following additional AWS KMS permissions are required.
+ `kms:CreateGrant`
+ `kms:Decrypt`
+ `kms:DescribeKey`

The following is an example IAM policy that gives IAM users permission to archive, restore, and view encrypted and unencrypted snapshots. It includes the `ec2:DescribeSnapshots` permission for console users. If some permissions are not needed, you can remove them from the policy.

**Tip**  
To follow the principle of least privilege, do not allow full access to `kms:CreateGrant`. Instead, use the `kms:GrantIsForAWSResource` condition key to allow the user to create grants on the KMS key only when the grant is created on the user's behalf by an AWS service, as shown in the following example.

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [{
        "Effect": "Allow",
        "Action": [
            "ec2:DescribeSnapshotTierStatus",
            "ec2:ModifySnapshotTier",
            "ec2:RestoreSnapshotTier",
            "ec2:DescribeSnapshots",
            "kms:CreateGrant",
            "kms:Decrypt",
            "kms:DescribeKey"
        ],
        "Resource": "*",
        "Condition": {
                "Bool": {
                    "kms:GrantIsForAWSResource": true
                }
            }
    }]
}
```

------

To provide access, add permissions to your users, groups, or roles:
+ Users and groups in AWS IAM Identity Center:

  Create a permission set. Follow the instructions in [Create a permission set](https://docs.aws.amazon.com//singlesignon/latest/userguide/howtocreatepermissionset.html) in the *AWS IAM Identity Center User Guide*.
+ Users managed in IAM through an identity provider:

  Create a role for identity federation. Follow the instructions in [Create a role for a third-party identity provider (federation)](https://docs.aws.amazon.com//IAM/latest/UserGuide/id_roles_create_for-idp.html) in the *IAM User Guide*.
+ IAM users:
  + Create a role that your user can assume. Follow the instructions in [Create a role for an IAM user](https://docs.aws.amazon.com//IAM/latest/UserGuide/id_roles_create_for-user.html) in the *IAM User Guide*.
  + (Not recommended) Attach a policy directly to a user or add a user to a user group. Follow the instructions in [Adding permissions to a user (console)](https://docs.aws.amazon.com//IAM/latest/UserGuide/id_users_change-permissions.html#users_change_permissions-add-console) in the *IAM User Guide*.

# Archive an Amazon EBS snapshot
<a name="archive-snapshot"></a>

You can archive any snapshot that is in the `completed` state and that you own in your account. You can't archive snapshots that are in the `pending` or `error` states, or snapshots that are shared with you. For more information, see [Considerations and limitations for archiving Amazon EBS snapshots](snapshot-archive-considerations.md).

If the snapshot is associated with one or more AMIs, then you must first disable those associated AMIs before you can archive the snapshot. For more information, see [Disable an AMI](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/disable-an-ami.html).

Archived snapshots retain their snapshot ID, encryption status, AWS Identity and Access Management (IAM) permissions, owner information, and resource tags. However, fast snapshot restore and snapshot sharing are automatically disabled after the snapshot is archived.

You can continue to use the snapshot while the archive is in process. As soon as the snapshot tiering status reaches the `archival-complete` state, you can no longer use the snapshot.

------
#### [ Console ]

**To archive a snapshot**

1. Open the Amazon EC2 console at [https://console.aws.amazon.com/ec2/](https://console.aws.amazon.com/ec2/).

1. In the navigation pane, choose **Snapshots**.

1. In the list of snapshots, select the snapshot to archive and then choose **Actions**, **Archive snapshot**.

1. To confirm, choose **Archive snapshot**.

------
#### [ AWS CLI ]

**To archive a snapshot**  
Use the [ modify-snapshot-tier](https://docs.aws.amazon.com/cli/latest/reference/ec2/modify-snapshot-tier.html) AWS CLI command. For `--snapshot-id`, specify the ID of the snapshot to archive. For `--storage-tier`, specify `archive`.

```
aws ec2 modify-snapshot-tier \
    --snapshot-id snap-0abcdef1234567890 \
    --storage-tier archive
```

The following is example output. The `TieringStartTime` response parameter indicates the date and time at which the archive process was started, in UTC time format (YYYY-MM-DDTHH:MM:SSZ).

```
{
    "SnapshotId": "snap-0abcdef1234567890",
    "TieringStartTime": "2021-09-15T16:44:37.574Z"
}
```

------
#### [ PowerShell ]

**To archive a snapshot**  
Use the [Edit-EC2SnapshotTier](https://docs.aws.amazon.com/powershell/latest/reference/items/Edit-EC2SnapshotTier.html) cmdlet. The following example archives the specified snapshot.

```
Edit-EC2SnapshotTier `
    -SnapshotId snap-0abcdef1234567890 `
    -StorageTier "archive"
```

------

# Restore an archived Amazon EBS snapshot
<a name="restore-archived-snapshot"></a>

Before you can use an archived snapshot, you must first restore it to the standard tier. The restored snapshot has the same snapshot ID, encryption status, IAM permissions, owner information, and resource tags that it had before it was archived. After it is restored, you can use it in the same way that you use any other snapshot in your account. The restored snapshot is always a full snapshot.

When you restore a snapshot, you can choose to restore it **permanently** or **temporarily**.

If you restore a snapshot permanently, the snapshot is moved from the archive tier to the standard tier permanently. The snapshot remains restored and ready for use until you manually re-archive it or you manually delete it. When you permanently restore a snapshot, the snapshot is removed from the archive tier.

If you restore a snapshot temporarily, the snapshot is copied from the archive tier to the standard tier for a restore period that you specify. The snapshot remains restored and ready for use for the restore period only. During the restore period, a copy of the snapshot remains in the archive tier. After the period expires, the snapshot is automatically removed from the standard tier. You can increase or decrease the restore period or change the restore type to permanent at any time during the restore period. For more information, see [Modify the restore period for a temporarily restored Amazon EBS snapshot](modify-temp-restore-period.md).

If you are restoring snapshots that are associated with a disabled AMI, and you intend to use that AMI, you must first **permanently restore** all of the associated snapshots and then [ re-enable a disabled AMI](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/disable-an-ami.html#re-enable-a-disabled-ami) before you can use it. You can't enable an AMI if the associated snapshots are temporarily restored. You can use the following command to find all of the snapshots associated with an AMI.

```
aws ec2 describe-images --image-id ami_id \
  --query Images[*].BlockDeviceMappings[*].Ebs[].SnapshotId[]
```

------
#### [ Console ]

**To restore a snapshot from the archive**

Open the Amazon EC2 console at [https://console.aws.amazon.com/ec2/](https://console.aws.amazon.com/ec2/).

1. In the navigation pane, choose **Snapshots**.

1. In the list of snapshots, select the archived snapshot to restore, and then choose **Actions**, **Restore snapshot from archive**.

1. Specify the type of restore to perform. For **Restore type**, do one of the following:
   + To restore the snapshot permanently, select **Permanent**.
   + To restore the snapshot temporarily, select **Temporary**, and then for **Temporary restore period**, enter the number of days for which to restore the snapshot.

1. To confirm, choose **Restore snapshot**.

------
#### [ AWS CLI ]

**To permanently restore an archived snapshot**  
Use the [ restore-snapshot-tier](https://docs.aws.amazon.com/cli/latest/reference/ec2/restore-snapshot-tier.html) AWS CLI command with the `--permanent-restore` option. For `--snapshot-id`, specify the ID of the snapshot to restore.

```
aws ec2 restore-snapshot-tier \
    --snapshot-id snap-0abcdef1234567890 \
    --permanent-restore
```

The following is example output.

```
{
    "SnapshotId": "snap-0abcdef1234567890",
    "IsPermanentRestore": true
}
```

**To temporarily restore an archived snapshot**  
Use the [ restore-snapshot-tier](https://docs.aws.amazon.com/cli/latest/reference/ec2/restore-snapshot-tier.html) AWS CLI command. Omit the `--permanent-restore` option. For `--temporary-restore-days`, specify the number of days for which to restore the snapshot. The allowed range is 1 to 180 days. If you do not specify a value, the default is 1 day.

The following example temporarily restores the specified snapshot for a restore period of 5 days.

```
aws ec2 restore-snapshot-tier \
    --snapshot-id snap-0abcdef1234567890 \
    --temporary-restore-days 5
```

The following is example output.

```
{
    "SnapshotId": "snap-0abcdef1234567890",
    "RestoreDuration": 5,
    "IsPermanentRestore": false
}
```

------
#### [ PowerShell ]

**To permanently restore an archived snapshot**  
Use the [Restore-EC2SnapshotTier](https://docs.aws.amazon.com/powershell/latest/reference/items/Restore-EC2SnapshotTier.html) cmdlet.

```
Restore-EC2SnapshotTier `
    -SnapshotId snap-0abcdef1234567890 `
    -PermanentRestore $true
```

**To temporarily restore an archived snapshot**  
Use the [Restore-EC2SnapshotTier](https://docs.aws.amazon.com/powershell/latest/reference/items/Restore-EC2SnapshotTier.html) cmdlet.

```
Restore-EC2SnapshotTier `
    -SnapshotId snap-0abcdef1234567890 `
    -TemporaryRestoreDays 5
```

------

# Modify the restore period for a temporarily restored Amazon EBS snapshot
<a name="modify-temp-restore-period"></a>

When you restore a snapshot temporarily, you must specify the number of days for which the snapshot is to remain restored in your account. After the restore period expires, the snapshot is automatically removed from the standard tier.

You can change the restore period for a temporarily restored snapshot at any time.

You can choose to either increase or decrease the restore period, or you can change the restore type from temporary to permanent.

If you change the restore period, the new restore period is effective from the current date. For example, if you specify a new restore period of `5` days, the snapshot will remain restored for five days from the current date.

**Note**  
You can end a temporary restore early by setting the restore period to 1 day.

If you change the restore type from temporary to permanent, the snapshot copy is deleted from the archive tier, and the snapshot remains available in your account until you manually re-archive it or delete it.

------
#### [ Console ]

**To modify the restore period or restore type**

1. Open the Amazon EC2 console at [https://console.aws.amazon.com/ec2/](https://console.aws.amazon.com/ec2/).

1. In the navigation pane, choose **Snapshots**.

1. In the list of snapshots, select the snapshot that you previously temporarily restored, and then choose **Actions**, **Restore snapshot from archive**.

1. For **Restore type**, do one of the following:
   + To change the restore type from temporary to permanent, select **Permanent**.
   + To increase or decrease the restore period, keep **Temporary**, and then for **Temporary restore period**, enter the new restore period in days. 

1. To confirm, choose **Restore snapshot**.

------
#### [ AWS CLI ]

**To modify the restore period or change the restore type**  
Use the [ restore-snapshot-tier](https://docs.aws.amazon.com/cli/latest/reference/ec2/restore-snapshot-tier.html) command. For `--snapshot-id`, specify the ID of the snapshot that you previously temporarily restored. To change the restore type from temporary to permanent, specify `--permanent-restore` and omit `--temporary-restore-days`. To increase or decrease the restore period, omit `--permanent-restore` and for `--temporary-restore-days`, specify the new restore period in days.

**Example: Increase or decrease the restore period**  
The following command changes the restore period for the specified snapshot to `10` days.

```
aws ec2 restore-snapshot-tier \
    --snapshot-id snap-0abcdef1234567890 \
    --temporary-restore-days 10
```

The following is example output.

```
{
    "SnapshotId": "snap-0abcdef1234567890",
    "RestoreDuration": 10,
    "IsPermanentRestore": false
}
```

**Example: Change restore type to permanent**  
The following command changes the restore type for the specified snapshot from temporary to permanent.

```
aws ec2 restore-snapshot-tier \
    --snapshot-id snap-0abcdef1234567890 \
    --permanent-restore
```

The following is example output.

```
{
    "SnapshotId": "snap-0abcdef1234567890",
    "IsPermanentRestore": true
}
```

------
#### [ PowerShell ]

**To modify the restore period or change the restore type**  
Use the [Restore-EC2SnapshotTier](https://docs.aws.amazon.com/powershell/latest/reference/items/Restore-EC2SnapshotTier.html) cmdlet. For `-SnapshotId`, specify the ID of the snapshot that you previously temporarily restored. To change the restore type from temporary to permanent, specify `-PermanentRestore` and omit `-TemporaryRestoreDays`. To increase or decrease the restore period, omit `-PermanentRestore` and for `-TemporaryRestoreDays`, specify the new restore period in days.

**Example: Increase or decrease the restore period**  
The following command changes the restore period for the specified snapshot to `10` days.

```
Restore-EC2SnapshotTier `
    -SnapshotId snap-0abcdef1234567890 `
    -TemporaryRestoreDays 10
```

**Example: Change restore type to permanent**  
The following command changes the restore type for the specified snapshot from temporary to permanent.

```
Restore-EC2SnapshotTier `
    -SnapshotId snap-0abcdef1234567890 `
    -PermanentRestore $true
```

------

# View archived Amazon EBS snapshots
<a name="view-archived-snapshot"></a>

------
#### [ Console ]

**To view storage tier information for a snapshot**

1. Open the Amazon EC2 console at [https://console.aws.amazon.com/ec2/](https://console.aws.amazon.com/ec2/).

1. In the navigation pane, choose **Snapshots**.

1. In the list of snapshots, select the snapshot and choose the **Storage tier** tab.

   The tab provides the following information:
   + **Last tier change started on** — The date and time when the last archive or restore was started.
   + **Tier change progress** — The progress of the last archive or restore action, as a percentage.
   + **Storage tier** — The storage tier for the snapshot. Always `archive` for archived snapshots, and `standard` for snapshots stored on the standard tier, including temporarily restored snapshots.
   + **Tiering status** — The status of the last archive or restore action.
   + **Archive completed on** — The date and time when the archive completed.
   + **Temporary restore expires on** — The date and time when a temporarily restored snapshot is set to expire.

------
#### [ AWS CLI ]

**To view archival information about an archived snapshot**  
Use the [ describe-snapshot-tier-status](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-snapshot-tier-status.html) command. Specify the `snapshot-id` filter, and for the filter value, specify the snapshot ID. Alternatively, to view all archived snapshots, omit the filter.

```
--filters "Name=snapshot-id, Values=snapshot_id"
```

The output includes the following response parameters:
+ `Status` — The status of the snapshot. Always `completed` for archived snapshots. Only snapshots that are in the `completed` state can be archived.
+ `LastTieringStartTime` — The date and time that the archival process started, in UTC time format (YYYY-MM-DDTHH:MM:SSZ).
+ `LastTieringOperationState` — The current state of the archival process. Possible states include: `archival-in-progress` \$1 `archival-completed` \$1 `archival-failed` \$1 `permanent-restore-in-progress` \$1 `permanent-restore-completed` \$1 `permanent-restore-failed` \$1 `temporary-restore-in-progress` \$1 `temporary-restore-completed` \$1 `temporary-restore-failed`
+ `LastTieringProgress` — The progress of the snapshot archival process, as a percentage.
+ `StorageTier` — The storage tier for the snapshot. Always `archive` for archived snapshots, and `standard` for snapshots stored on the standard tier, including temporarily restored snapshots.
+ `ArchivalCompleteTime` — The date and time that the archival process completed, in UTC time format (YYYY-MM-DDTHH:MM:SSZ).

**Example: Describe a snapshot**  
The following example displays information about the specified snapshot.

```
aws ec2 describe-snapshot-tier-status \
    --filters "Name=snapshot-id, Values=snap-0abcdef1234567890"
```

The following is example output.

```
{
    "SnapshotTierStatuses": [
        {
            "Status": "completed",
            "ArchivalCompleteTime": "2021-09-15T17:33:16.147Z",
            "LastTieringProgress": 100,
            "Tags": [],
            "VolumeId": "vol-01234567890abcdef",
            "LastTieringOperationState": "archival-completed",
            "StorageTier": "archive",
            "OwnerId": "123456789012",
            "SnapshotId": "snap-0abcdef1234567890",
            "LastTieringStartTime": "2021-09-15T16:44:37.574Z"
        }
    ]
}
```

**To view archived and standard tier snapshots**  
Use the [describe-snapshots](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-snapshots.html) command. For `--snapshot-ids`, specify the ID of the snapshot.

```
aws ec2 describe-snapshots --snapshot-ids snap-0abcdef1234567890
```

The following is example output. The `StorageTier` response parameter indicates whether the snapshot is currently archived. `archive` indicates that the snapshot is currently archived and stored in the archive tier, and `standard` indicates that the snapshot is currently not archived and that it is stored in the standard tier.

In the following example output, only `Snap A` is archived. `Snap B` and `Snap C` are not archived.

Additionally, the `RestoreExpiryTime` response parameter is returned only for snapshots that are temporarily restored from the archive. It indicates when temporarily restored snapshots are to be automatically removed from the standard tier. It is **not** returned for snapshots that are permanently restored.

In the following example output, `Snap C` is temporarily restored, and it will be automatically removed from the standard tier at 2021-09-19T21:00:00.000Z (September 19, 2021 at 21:00 UTC).

```
{
    "Snapshots": [
        {
            "Description": "Snap A",
            "Encrypted": false,
            "VolumeId": "vol-01234567890aaaaaa",
            "State": "completed",
            "VolumeSize": 8,
            "StartTime": "2021-09-07T21:00:00.000Z",
            "Progress": "100%",
            "OwnerId": "123456789012",
            "SnapshotId": "snap-01234567890aaaaaa",
            "StorageTier": "archive",
            "Tags": []
        },
        {
            "Description": "Snap B",
            "Encrypted": false,
            "VolumeId": "vol-09876543210bbbbbb",
            "State": "completed",
            "VolumeSize": 10,
            "StartTime": "2021-09-14T21:00:00.000Z",
            "Progress": "100%",
            "OwnerId": "123456789012",
            "SnapshotId": "snap-09876543210bbbbbb",
            "StorageTier": "standard",           
            "RestoreExpiryTime": "2019-09-19T21:00:00.000Z",
            "Tags": []
        },
        {
            "Description": "Snap C",
            "Encrypted": false,
            "VolumeId": "vol-054321543210cccccc",
            "State": "completed",
            "VolumeSize": 12,
            "StartTime": "2021-08-01T21:00:00.000Z",
            "Progress": "100%",
            "OwnerId": "123456789012",
            "SnapshotId": "snap-054321543210cccccc",
            "StorageTier": "standard",
            "Tags": []
        }
    ]
}
```

**To view only snapshots that are stored in the archive tier or the standard tier**  
Use the [describe-snapshots](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-snapshots.html) command. Include the `--filter` option, with the filter name `storage-tier`. For the filter value specify either `archive` or `standard`. The following example displays only archived snapshots.

```
aws ec2 describe-snapshots --filters "Name=storage-tier,Values=archive"
```

------
#### [ PowerShell ]

**To view archival information about an archived snapshot**  
Use the [Get-EC2SnapshotTierStatus](https://docs.aws.amazon.com/powershell/latest/reference/items/Get-EC2SnapshotTierStatus.html) cmdlet.

```
Get-EC2SnapshotTierStatus `
    -Filter @{Name="snapshot-id"; Values="snap-0abcdef1234567890"}
```

**To view archived and standard tier snapshots**  
Use the [Get-EC2Snapshot](https://docs.aws.amazon.com/powershell/latest/reference/items/Get-EC2Snapshot.html) cmdlet.

```
Get-EC2Snapshot `
    -SnapshotId snap-0abcdef1234567890
```

**To view only snapshots that are stored in the archive tier or the standard tier**  
Use the [Get-EC2Snapshot](https://docs.aws.amazon.com/powershell/latest/reference/items/Get-EC2Snapshot.html) cmdlet. The following example displays only archived snapshots.

```
Get-EC2Snapshot `
    -Filter @{Name="storage-tier"; Values="archive"}
```

------

# Monitor Amazon EBS snapshot archiving using CloudWatch Events
<a name="monitor-snapshot-archiving"></a>

Amazon EBS emits events related to snapshot archiving actions. You can use AWS Lambda and Amazon CloudWatch Events to handle event notifications programmatically. Events are emitted on a best effort basis. For more information, see the [Amazon EventBridge User Guide](https://docs.aws.amazon.com/eventbridge/latest/userguide/).

The following events are available:
+ `archiveSnapshot` — Emitted when a snapshot archive action succeeds or fails.

  The following is an example of an event that is emitted when a snapshot archive action succeeds.

  ```
  {
     "version": "0",
     "id": "01234567-0123-0123-0123-012345678901",
     "detail-type": "EBS Snapshot Notification",
     "source": "aws.ec2",
     "account": "123456789012",
     "time": "2021-05-25T13:12:22Z",
     "region": "us-east-1",
     "resources": [
       "arn:aws:ec2:us-east-1::snapshot/snap-01234567890abcdef"
     ],
     "detail": {
       "event": "archiveSnapshot",
       "result": "succeeded",
       "cause": "",
       "request-id": "123456789",
       "snapshot_id": "arn:aws:ec2:us-east-1::snapshot/snap-01234567890abcdef",
       "startTime": "2021-05-25T13:12:22Z",
       "endTime": "2021-05-45T15:30:00Z",
       "recycleBinExitTime": "2021-10-45T15:30:00Z"
    }
  ```

  The following is an example of an event that is emitted when a snapshot archive action fails.

  ```
  {
     "version": "0",
    "id": "01234567-0123-0123-0123-012345678901",
    "detail-type": "EBS Snapshot Notification",
    "source": "aws.ec2",
    "account": "123456789012",
    "time": "2021-05-25T13:12:22Z",
    "region": "us-east-1",
    "resources": [
      "arn:aws:ec2:us-east-1::snapshot/snap-01234567890abcdef"
    ],
    "detail": {
      "event": "archiveSnapshot",
      "result": "failed",
      "cause": "Source snapshot ID is not valid",
      "request-id": "1234567890",
      "snapshot_id": "arn:aws:ec2:us-east-1::snapshot/snap-01234567890abcdef",
      "startTime": "2021-05-25T13:12:22Z",
      "endTime": "2021-05-45T15:30:00Z",
      "recycleBinExitTime": "2021-10-45T15:30:00Z"
    }
  }
  ```
+ `permanentRestoreSnapshot` — Emitted when a permanent restore action succeeds or fails.

  The following is an example of an event that is emitted when a permanent restore action succeeds.

  ```
  {
     "version": "0",
    "id": "01234567-0123-0123-0123-012345678901",
    "detail-type": "EBS Snapshot Notification",
    "source": "aws.ec2",
    "account": "123456789012",
    "time": "2021-05-25T13:12:22Z",
    "region": "us-east-1",
    "resources": [
      "arn:aws:ec2:us-east-1::snapshot/snap-01234567890abcdef"
    ],
    "detail": {
      "event": "permanentRestoreSnapshot",
      "result": "succeeded",
      "cause": "",
      "request-id": "1234567890",
      "snapshot_id": "arn:aws:ec2:us-east-1::snapshot/snap-01234567890abcdef",
      "startTime": "2021-05-25T13:12:22Z",
      "endTime": "2021-10-45T15:30:00Z"
    }
  }
  ```

  The following is an example of an event that is emitted when a permanent restore action fails.

  ```
  {
     "version": "0",
    "id": "01234567-0123-0123-0123-012345678901",
    "detail-type": "EBS Snapshot Notification",
    "source": "aws.ec2",
    "account": "123456789012",
    "time": "2021-05-25T13:12:22Z",
    "region": "us-east-1",
    "resources": [
      "arn:aws:ec2:us-east-1::snapshot/snap-01234567890abcdef"
    ],
    "detail": {
      "event": "permanentRestoreSnapshot",
      "result": "failed",
      "cause": "Source snapshot ID is not valid",
      "request-id": "1234567890",
      "snapshot_id": "arn:aws:ec2:us-east-1::snapshot/snap-01234567890abcdef",
      "startTime": "2021-05-25T13:12:22Z",
      "endTime": "2021-05-45T15:30:00Z",
      "recycleBinExitTime": "2021-10-45T15:30:00Z"
    }
  }
  ```
+ `temporaryRestoreSnapshot` — Emitted when a temporary restore action succeeds or fails.

  The following is an example of an event that is emitted when a temporary restore action succeeds.

  ```
  {
     "version": "0",
    "id": "01234567-0123-0123-0123-012345678901",
    "detail-type": "EBS Snapshot Notification",
    "source": "aws.ec2",
    "account": "123456789012",
    "time": "2021-05-25T13:12:22Z",
    "region": "us-east-1",
    "resources": [
      "arn:aws:ec2:us-east-1::snapshot/snap-01234567890abcdef"
    ],
    "detail": {
      "event": "temporaryRestoreSnapshot",
      "result": "succeeded",
      "cause": "",
      "request-id": "1234567890",
      "snapshot_id": "arn:aws:ec2:us-us-east-1::snapshot/snap-01234567890abcdef",
      "startTime": "2021-05-25T13:12:22Z",
      "endTime": "2021-05-45T15:30:00Z",    
      "restoreExpiryTime": "2021-06-45T15:30:00Z",
      "recycleBinExitTime": "2021-10-45T15:30:00Z"
    }
  }
  ```

  The following is an example of an event that is emitted when a temporary restore action fails.

  ```
  {
     "version": "0",
    "id": "01234567-0123-0123-0123-012345678901",
    "detail-type": "EBS Snapshot Notification",
    "source": "aws.ec2",
    "account": "123456789012",
    "time": "2021-05-25T13:12:22Z",
    "region": "us-east-1",
    "resources": [
      "arn:aws:ec2:us-east-1::snapshot/snap-01234567890abcdef"
    ],
    "detail": {
      "event": "temporaryRestoreSnapshot",
      "result": "failed",
      "cause": "Source snapshot ID is not valid",
      "request-id": "1234567890",
      "snapshot_id": "arn:aws:ec2:us-east-1::snapshot/snap-01234567890abcdef",
      "startTime": "2021-05-25T13:12:22Z",
      "endTime": "2021-05-45T15:30:00Z",
      "recycleBinExitTime": "2021-10-45T15:30:00Z"
    }
  }
  ```
+ `restoreExpiry` — Emitted when the restore period for a temporarily restored snapshot expires.

  The following is an example.

  ```
  {
     "version": "0",
    "id": "01234567-0123-0123-0123-012345678901",
    "detail-type": "EBS Snapshot Notification",
    "source": "aws.ec2",
    "account": "123456789012",
    "time": "2021-05-25T13:12:22Z",
    "region": "us-east-1",
    "resources": [
      "arn:aws:ec2:us-east-1::snapshot/snap-01234567890abcdef"
    ],
    "detail": {
      "event": "restoryExpiry",
      "result": "succeeded",
      "cause": "",
      "request-id": "1234567890",
      "snapshot_id": "arn:aws:ec2:us-east-1::snapshot/snap-01234567890abcdef",
      "startTime": "2021-05-25T13:12:22Z",
      "endTime": "2021-05-45T15:30:00Z",
      "recycleBinExitTime": "2021-10-45T15:30:00Z"
    }
  }
  ```