id
stringlengths 14
16
| text
stringlengths 1
2.43k
| source
stringlengths 99
229
|
---|---|---|
3e40b4ef279c-2 | 1. On the **Review** page, choose **Create**\. After the load balancer is created, choose **Close**\.
1. On the navigation pane, under **AUTO SCALING**, choose **Launch Configurations**\.
+ If you are new to Amazon EC2 Auto Scaling, you see a welcome page\. Choose **Create Auto Scaling group** to start the Create Auto Scaling Group wizard, and then choose **Create launch configuration**\.
+ Otherwise, choose **Create launch configuration**\.
1. On the **Choose AMI** page, select the **My AMIs** tab, and then select the AMI that you created in [Prerequisites](#scale-and-load-balance-prerequisites)\.
1. On the **Choose Instance Type** page, select an instance type, and then choose **Next: Configure details**\.
1. On the **Configure details** page, do the following:
1. For **Name**, type a name for your launch configuration \(for example, **my\-launch\-config**\)\.
1. For **IAM role**, select the IAM role that you created in [Prerequisites](#scale-and-load-balance-prerequisites)\.
1. \(Optional\) If you need to run a startup script, expand **Advanced Details** and type the script in **User data**\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-increase-availability.md |
3e40b4ef279c-3 | 1. \(Optional\) If you need to run a startup script, expand **Advanced Details** and type the script in **User data**\.
1. Choose **Skip to review**\.
1. On the **Review** page, choose **Edit security groups**\. You can select an existing security group or create a new one\. This security group must allow HTTP traffic and health checks from the load balancer\. If your instances will have public IP addresses, you can optionally allow SSH traffic if you need to connect to the instances\. When you are finished, choose **Review**\.
1. On the **Review** page, choose **Create launch configuration**\.
1. When prompted, select an existing key pair, create a new key pair, or proceed without a key pair\. Select the acknowledgment check box, and then choose **Create launch configuration**\.
1. After the launch configuration is created, you must create an Auto Scaling group\.
+ If you are new to Amazon EC2 Auto Scaling and you are using the Create Auto Scaling group wizard, you are taken to the next step automatically\.
+ Otherwise, choose **Create an Auto Scaling group using this launch configuration**\.
1. On the **Configure Auto Scaling group details** page, do the following:
1. For **Group name**, type a name for the Auto Scaling group\. For example, **my\-asg**\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-increase-availability.md |
3e40b4ef279c-4 | 1. For **Group name**, type a name for the Auto Scaling group\. For example, **my\-asg**\.
1. For **Group size**, type the number of instances \(for example, **2**\)\. Note that we recommend that you maintain approximately the same number of instances in each Availability Zone\.
1. Select your VPC from **Network** and your two public subnets from **Subnet**\.
1. Under **Advanced Details**, select **Receive traffic from one or more load balancers**\. Select your target group from **Target Groups**\.
1. Choose **Next: Configure scaling policies**\.
1. On the **Configure scaling policies** page, choose **Review**, as we will let Amazon EC2 Auto Scaling maintain the group at the specified size\. Note that later on, you can manually scale this Auto Scaling group, configure the group to scale on a schedule, or configure the group to scale based on demand\.
1. On the **Review** page, choose **Create Auto Scaling group**\.
1. After the group is created, choose **Close**\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-increase-availability.md |
b7265178d16b-0 | When a client sends a request to your load balancer, the load balancer routes the request to one of its registered instances\.
**To test your load balancer**
1. Verify that your instances are ready\. From the **Auto Scaling Groups** page, select your Auto Scaling group, and then choose the **Instances** tab\. Initially, your instances are in the `Pending` state\. When their states are `InService`, they are ready for use\.
1. Verify that your instances are registered with the load balancer\. From the **Target Groups** page, select your target group, and then choose the **Targets** tab\. If the state of your instances is `initial`, it's possible that they are still registering\. When the state of your instances is `healthy`, they are ready for use\. After your instances are ready, you can test your load balancer as follows\.
1. From the **Load Balancers** page, select your load balancer\.
1. On the **Description** tab, locate the DNS name\. This name has the following form:
```
my-lb-xxxxxxxxxx.us-west-2.elb.amazonaws.com
```
1. In a web browser, paste the DNS name for the load balancer into the address bar and press Enter\. You'll see your website displayed\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ec2-increase-availability.md |
350639e4e01a-0 | You can use Amazon Data Lifecycle Manager to automate the creation, retention, and deletion of snapshots taken to back up your Amazon EBS volumes\. Automating snapshot management helps you to:
+ Protect valuable data by enforcing a regular backup schedule\.
+ Retain backups as required by auditors or internal compliance\.
+ Reduce storage costs by deleting outdated backups\.
Combined with the monitoring features of Amazon CloudWatch Events and AWS CloudTrail, Amazon Data Lifecycle Manager provides a complete backup solution for EBS volumes at no additional cost\.
**Topics**
+ [How Amazon Data Lifecycle Manager works](#dlm-elements)
+ [Considerations for Amazon Data Lifecycle Manager](#dlm-considerations)
+ [Prerequisites](#dlm-prerequisites)
+ [Manage backups using the console](#snapshot-lifecycle-console)
+ [Manage backups using the AWS CLI](#snaphot-lifecycle-cli)
+ [Manage backups using the API](#snaphot-lifecycle-api)
+ [Monitor the snapshot lifecycle](#dlm-monitor-lifecycle) | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/snapshot-lifecycle.md |
49409c16c6a1-0 | The following are the key elements of Amazon Data Lifecycle Manager\.
**Topics**
+ [Snapshots](#dlm-ebs-snapshots)
+ [Target resource tags](#dlm-tagging-volumes)
+ [Snapshot tags](#dlm-tagging-snapshots)
+ [Lifecycle policies](#dlm-lifecycle-policies) | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/snapshot-lifecycle.md |
1a5834968445-0 | Snapshots are the primary means to back up data from your EBS volumes\. To save storage costs, successive snapshots are incremental, containing only the volume data that changed since the previous snapshot\. When you delete one snapshot in a series of snapshots for a volume, only the data unique to that snapshot is removed\. The rest of the captured history of the volume is preserved\.
For more information, see [Amazon EBS snapshots](EBSSnapshots.md)\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/snapshot-lifecycle.md |
352f4cbfc315-0 | Amazon Data Lifecycle Manager uses resource tags to identify the EBS volumes to back up\. Tags are customizable metadata that you can assign to your AWS resources \(including EBS volumes and snapshots\)\. An Amazon Data Lifecycle Manager policy \(described below\) targets a volume for backup using a single tag\. Multiple tags can be assigned to a volume if you want to run multiple policies on it\.
You can't use a '\\' or '=' character in a tag key\.
For more information, see [Tagging your Amazon EC2 resources](Using_Tags.md)\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/snapshot-lifecycle.md |
f99defadc843-0 | Amazon Data Lifecycle Manager applies the following tags to all snapshots created by a policy, to distinguish them from snapshots created by any other means:
+ `aws:dlm:lifecycle-policy-id`
+ `aws:dlm:lifecycle-schedule-name`
You can also specify custom tags to be applied to snapshots on creation\.
You can't use a '\\' or '=' character in a tag key\.
The target tags that Amazon Data Lifecycle Manager uses to associate volumes with a policy can optionally be applied to snapshots created by the policy\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/snapshot-lifecycle.md |
e2c8597b4bcb-0 | A lifecycle policy consists of these core settings:
+ Resource type—The type of AWS resource managed by the policy\. Use `VOLUME` to create snapshots of individual volumes or use `INSTANCE` to create multi\-volume snapshots from the volumes for an instance\. For more information, see [Multi\-volume snapshots](ebs-creating-snapshot.md#ebs-create-snapshot-multi-volume)\.
+ Target tags—The tags that must be associated with an EBS volume or an EC2 instance for it to be managed by the policy\.
+ Schedule—The start time and interval for creating snapshots\. The first snapshot is created by a policy within one hour after the specified start time\. Subsequent snapshots are created within one hour of their scheduled time\.
+ Retention—You can retain snapshots based on either the total count of snapshots or the age of each snapshot\.
For example, you could create a policy that manages all EBS volumes with the tag `account=Finance`, creates snapshots every 24 hours at 0900, and retains the five most recent snapshots\. Snapshot creation would start by 0959 each day\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/snapshot-lifecycle.md |
459465449337-0 | Your AWS account has the following quotas related to Amazon Data Lifecycle Manager:
+ You can create up to 100 lifecycle policies per Region\.
+ You can add up to 45 tags per resource\.
+ You can create one schedule per lifecycle policy\.
The following considerations apply to lifecycle policies:
+ A policy does not begin creating snapshots until you set its activation status to *enabled*\. You can configure a policy to be enabled upon creation\.
+ The first snapshot is created by a policy within one hour after the specified start time\. Subsequent snapshots are created within one hour of their scheduled time\.
+ If you modify a policy by removing or changing its target tag, the EBS volumes with that tag are no longer affected by the policy\.
+ If you modify the schedule name for a policy, the snapshots created under the old schedule name are no longer affected by the policy\.
+ If you modify a retention schedule based on time to use a new time interval, the new interval is used only for new snapshots\. The new schedule does not affect the retention schedule of existing snapshots created by this policy\.
+ You cannot change the retention schedule of a policy from the count of snapshots to the age of each snapshot\. To make this change, you must create a new policy\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/snapshot-lifecycle.md |
459465449337-1 | + If you disable a policy with a retention schedule based on the age of each snapshot, the snapshots whose retention periods expire while the policy is disabled are retained indefinitely\. You must delete these snapshots manually\. When you enable the policy again, Amazon Data Lifecycle Manager resumes deleting snapshots as their retention periods expire\.
+ If you delete the resource to which a policy with count\-based retention applies, the policy no longer manages the previously created snapshots\. You must manually delete the snapshots if they are no longer needed\.
+ If you delete the resource to which a policy with age\-based retention applies, the policy continues to delete snapshots on the defined schedule, up to the last snapshot\. You must manually delete the last snapshot if it is no longer needed\.
+ You can create multiple policies to back up an EBS volume or an EC2 instance\. For example, if an EBS volume has two tags, where tag A is the target for policy A to create a snapshot every 12 hours, and tag B is the target for policy B to create a snapshot every 24 hours, Amazon Data Lifecycle Manager creates snapshots according to the schedules for both policies\.
The following considerations apply to lifecycle policies and [fast snapshot restore](ebs-fast-snapshot-restore.md):
+ A snapshot that is enabled for fast snapshot restore remains enabled even if you delete or disable the lifecycle policy, disable fast snapshot restore for the lifecycle policy, or disable fast snapshot restore for the Availability Zone\. You can disable fast snapshot restore for these snapshots manually\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/snapshot-lifecycle.md |
459465449337-2 | + If you enable fast snapshot restore and you exceed the maximum number of snapshots that can be enabled for fast snapshot restore, Amazon Data Lifecycle Manager creates snapshots as scheduled but does not enable them for fast snapshot restore\. After a snapshot that is enabled for fast snapshot restore is deleted, the next snapshot Amazon Data Lifecycle Manager creates is enabled for fast snapshot restore\.
+ When you enable fast snapshot restore for a snapshot, it takes 60 minutes per TiB to optimize the snapshot\. We recommend that you create a schedule that ensures that each snapshot is fully optimized before Amazon Data Lifecycle Manager creates the next snapshot\.
+ You are billed for each minute that fast snapshot restore is enabled for a snapshot in a particular Availability Zone\. Charges are pro\-rated with a minimum of one hour\. For more information, see [Pricing and Billing](ebs-fast-snapshot-restore.md#fsr-pricing)\.
**Note**
Depending on the configuration of your lifecycle policies, you could have multiple snapshots enabled for fast snapshot restore simultaneously\.
The following considerations apply to lifecycle policies and [Multi\-Attach](ebs-volumes-multi.md) enabled volumes:
+ When creating a lifecycle policy based on instance tags for Multi\-Volume snapshots, Amazon Data Lifecycle Manager initiates a snapshot of the volume for each attached instance\. Use the *timestamp* tag to identify the set of time\-consistent snapshots created from the attached instances\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/snapshot-lifecycle.md |
bb3b53d7c5fa-0 | The following prerequisites are required by Amazon Data Lifecycle Manager\.
**Topics**
+ [Permissions for Amazon Data Lifecycle Manager](#dlm-permissions)
+ [Permissions for IAM users](#dlm-access-control)
+ [Permissions for encrypted snapshots](#dlm-access-cmk) | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/snapshot-lifecycle.md |
727efdf7f50d-0 | Amazon Data Lifecycle Manager uses an IAM role to get the permissions that are required to manage snapshots on your behalf\. Amazon Data Lifecycle Manager creates the **AWSDataLifecycleManagerDefaultRole** role the first time that you create a lifecycle policy using the AWS Management Console\. You can also create this role using the following [create\-default\-role](https://docs.aws.amazon.com/cli/latest/reference/dlm/create-default-role.html) command\.
```
aws dlm create-default-role
```
Alternatively, you can create a custom IAM role with the required permissions and select it when you create a lifecycle policy\.
**To create a custom IAM role**
1. Create a role with the following permissions\.
```
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ec2:CreateSnapshot",
"ec2:CreateSnapshots",
"ec2:DeleteSnapshot",
"ec2:DescribeVolumes",
"ec2:DescribeInstances",
"ec2:DescribeSnapshots"
],
"Resource": "*"
},
{ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/snapshot-lifecycle.md |
727efdf7f50d-1 | "ec2:DescribeSnapshots"
],
"Resource": "*"
},
{
"Effect": "Allow",
"Action": [
"ec2:CreateTags"
],
"Resource": "arn:aws:ec2:*::snapshot/*"
}
]
}
```
For more information, see [Creating a Role](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user.html) in the *IAM User Guide*\.
1. Add a trust relationship to the role\.
1. In the IAM console, choose **Roles**\.
1. Select the role you created and then choose **Trust relationships**\.
1. Choose **Edit Trust Relationship**, add the following policy, and then choose **Update Trust Policy**\.
```
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "dlm.amazonaws.com"
},
"Action": "sts:AssumeRole"
}
]
}
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/snapshot-lifecycle.md |
0966c8e3434e-0 | An IAM user must have the following permissions to use Amazon Data Lifecycle Manager\.
```
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": ["iam:PassRole", "iam:ListRoles"],
"Resource": "arn:aws:iam::123456789012:role/AWSDataLifecycleManagerDefaultRole"
},
{
"Effect": "Allow",
"Action": "dlm:*",
"Resource": "*"
}
]
}
```
For more information, see [Changing Permissions for an IAM User](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_users_change-permissions.html) in the *IAM User Guide*\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/snapshot-lifecycle.md |
9b63f27d8b2b-0 | To copy an encrypted snapshot between Regions, you must have access to both the source and destination customer master key \(CMK\) from AWS Key Management Service \(AWS KMS\)\.
If the source volume is encrypted, ensure that the **AWSDataLifecycleManagerDefaultRole** role has permission to use the CMK used to encrypt the volume\. If you enable **Cross Region copy** and choose to encrypt the copied snapshot, ensure that the **AWSDataLifecycleManagerDefaultRole** role has permission to use the CMK needed to encrypt the snapshot in the destination Region\. For more information, see [ Managing access to AWS KMS CMKs](https://docs.aws.amazon.com/kms/latest/developerguide/control-access-overview.html#managing-access) in the *AWS Key Management Service Developer Guide*\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/snapshot-lifecycle.md |
e75352179bb8-0 | The following examples show how to use Amazon Data Lifecycle Manager to manage the backups of your EBS volumes using the AWS Management Console\.
**Topics**
+ [Create a lifecycle policy](#console-create-policy)
+ [View a lifecycle policy](#console-view-policy)
+ [Modify a lifecycle policy](#console-modify-policy)
+ [Delete a lifecycle policy](#console-delete-policy) | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/snapshot-lifecycle.md |
3bdc94d8812d-0 | Use the following procedure to create a lifecycle policy\.
**To create a lifecycle policy**
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 **Elastic Block Store**, **Lifecycle Manager**, then choose **Create snapshot lifecycle policy**\.
1. Provide the following information for your policy as needed:
+ **Description**–A description of the policy\.
+ **Resource type**–The type of resource to back up\. Use `Volume` to create snapshots of individual volumes or use `Instance` to create multi\-volume snapshots from the volumes for an instance\.
+ **Target with these tags**–The resource tags that identify the volumes or instances to back up\.
+ **Lifecycle policy tags**–The tags for the lifecycle policy\.
+ **Schedule name**–A name for the schedule\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/snapshot-lifecycle.md |
3bdc94d8812d-1 | + **Lifecycle policy tags**–The tags for the lifecycle policy\.
+ **Schedule name**–A name for the schedule\.
+ **Frequency**–The interval between policy runs\. You can configure policy runs on a daily, weekly, monthly, or yearly schedule\. Alternatively, choose **Custom cron expression** to specify an interval of up to 1 year\. For more information, see [Cron expressions](https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html#CronExpressions) in the *Amazon CloudWatch Events User Guide*\.
+ **Starting at ***hh*:*mm* **UTC**–The time at which the policy runs are scheduled to start\. The first policy run starts within an hour after the scheduled time\.
+ **Retention type**–You can retain snapshots based on either the total count of snapshots or the age of each snapshot\. For retention based on the count, the range is 1 to 1000\. After the maximum count is reached, the oldest snapshot is deleted when a new one is created\. For age\-based retention, the range is 1 day to 100 years\. After the retention period of each snapshot expires, it is deleted\. The retention period should be greater than or equal to the creation interval\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/snapshot-lifecycle.md |
3bdc94d8812d-2 | + **Tagging information**–Choose whether to copy all user\-defined tags on a source volume to the snapshots created by this policy\. You can also specify additional tags for the snapshots in addition to the tags applied by Amazon Data Lifecycle Manager\. If the resource type is `INSTANCE`, you can choose to automatically tag your snapshots with the following variable tags: `instance-id` and `timestamp`\. The values of the variable tags are determined when the tags are added\.
+ **Fast snapshot restore**–Choose whether to enable fast snapshot restore for all snapshots created by this policy\. If you enable fast snapshot restore, you must choose the Availability Zones in which to enable it\. You are billed for each minute that fast snapshot restore is enabled for a snapshot in a particular Availability Zone\. Charges are pro\-rated with a minimum of one hour\. You can also specify the maximum number of snapshots that can be enabled for fast snapshot restore\.
+ **Enable cross Region copy**–You can copy each snapshot to up at three additional Regions\. You must ensure that you do not exceed the number of concurrent snapshot copies per Region\. For each Region, you can choose different retention policies and whether to copy all tags or no tags\. If the source snapshot is encrypted or if encryption by default is enabled, the snapshots copies are encrypted\. If the source snapshot is unencrypted, you can enable encryption\. If you do not specify a CMK, the snapshots are encrypted using the default key for EBS encryption in each destination Region\. If you specify a CMK for the destination Region, you must have access to the CMK\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/snapshot-lifecycle.md |
3bdc94d8812d-3 | + **IAM role**–An IAM role that has permissions to create, delete, and describe snapshots, and to describe volumes\. AWS provides a default role, **AWSDataLifecycleManagerDefaultRole**, or you can create a custom IAM role\.
+ **Policy status after creation**–Choose **Enable policy** to start the policy runs at the next scheduled time or **Disable policy** to prevent the policy from running\.
1. Choose **Create Policy**\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/snapshot-lifecycle.md |
d58174afde79-0 | Use the following procedure to view a lifecycle policy\.
**To view a lifecycle policy**
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 **Elastic Block Store**, **Lifecycle Manager**\.
1. Select a lifecycle policy from the list\. The **Details** tab displays information about the policy\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/snapshot-lifecycle.md |
15dbf835caab-0 | Use the following procedure to modify a lifecycle policy\.
**To modify a lifecycle policy**
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 **Elastic Block Store**, **Lifecycle Manager**\.
1. Select a lifecycle policy from the list\.
1. Choose **Actions**, **Modify Snapshot Lifecycle Policy**\.
1. Modify the policy settings as needed\. For example, you can modify the schedule, add or remove tags, or enable or disable the policy\.
1. Choose **Update policy**\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/snapshot-lifecycle.md |
1ffec40fce50-0 | Use the following procedure to delete a lifecycle policy\.
**To delete a lifecycle policy**
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 **Elastic Block Store**, **Lifecycle Manager**\.
1. Select a lifecycle policy from the list\.
1. Choose **Actions**, **Delete Snapshot Lifecycle Policy**\.
1. When prompted for confirmation, choose **Delete Snapshot Lifecycle Policy**\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/snapshot-lifecycle.md |
bc0ee40cd5ae-0 | The following examples show how to use Amazon Data Lifecycle Manager to manage the backups of your EBS volumes using the AWS CLI\.
**Topics**
+ [Create a lifecycle policy](#create-policy-cli)
+ [Display a lifecycle policy](#display-policy-cli)
+ [Modify a lifecycle policy](#modify-policy-cli)
+ [Delete a lifecycle policy](#delete-policy-cli) | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/snapshot-lifecycle.md |
5f1b32de3cde-0 | Use the [create\-lifecycle\-policy](https://docs.aws.amazon.com/cli/latest/reference/dlm/create-lifecycle-policy.html) command to create a lifecycle policy\. To simplify the syntax, the example uses a JSON file, `policyDetails.json`, that includes the policy details\.
This example uses a resource type of `VOLUME` to create snapshots of all volumes with the specified target tags\. To create snapshots of all volumes for all instances with the specified target tags, use a resource type of `INSTANCE` instead\.
```
aws dlm create-lifecycle-policy --description "My volume policy" --state ENABLED --execution-role-arn arn:aws:iam::12345678910:role/AWSDataLifecycleManagerDefaultRole --policy-details file://policyDetails.json
```
The following is an example of the `policyDetails.json` file\.
```
{
"ResourceTypes": [
"VOLUME"
],
"TargetTags": [
{
"Key": "costcenter",
"Value": "115"
}
],
"Schedules":[
{
"Name": "DailySnapshots",
"TagsToAdd": [
{ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/snapshot-lifecycle.md |
5f1b32de3cde-1 | {
"Name": "DailySnapshots",
"TagsToAdd": [
{
"Key": "type",
"Value": "myDailySnapshot"
}
],
"CreateRule": {
"Interval": 24,
"IntervalUnit": "HOURS",
"Times": [
"03:00"
]
},
"RetainRule": {
"Count": 5
},
"CopyTags": false
}
]
}
```
Upon success, the command returns the ID of the newly created policy\. The following is example output\.
```
{
"PolicyId": "policy-0123456789abcdef0"
}
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/snapshot-lifecycle.md |
a453f96f69d9-0 | Use the [get\-lifecycle\-policy](https://docs.aws.amazon.com/cli/latest/reference/dlm/get-lifecycle-policy.html) command to display information about a lifecycle policy\.
```
aws dlm get-lifecycle-policy --policy-id policy-0123456789abcdef0
```
The following is example output\. It includes the information that you specified, plus metadata inserted by AWS\.
```
{
"Policy":{
"Description": "My first policy",
"DateCreated": "2018-05-15T00:16:21+0000",
"State": "ENABLED",
"ExecutionRoleArn": "arn:aws:iam::210774411744:role/AWSDataLifecycleManagerDefaultRole",
"PolicyId": "policy-0123456789abcdef0",
"DateModified": "2018-05-15T00:16:22+0000",
"PolicyDetails": {
"PolicyType":"EBS_SNAPSHOT_MANAGEMENT",
"ResourceTypes": [
"VOLUME"
],
"TargetTags": [
{
"Value": "115",
"Key": "costcenter" | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/snapshot-lifecycle.md |
a453f96f69d9-1 | "TargetTags": [
{
"Value": "115",
"Key": "costcenter"
}
],
"Schedules": [
{
"TagsToAdd": [
{
"Value": "myDailySnapshot",
"Key": "type"
}
],
"RetainRule": {
"Count": 5
},
"CopyTags": false,
"CreateRule": {
"Interval": 24,
"IntervalUnit": "HOURS",
"Times": [
"03:00"
]
},
"Name": "DailySnapshots"
}
]
}
}
}
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/snapshot-lifecycle.md |
b49401b40f39-0 | Use the [update\-lifecycle\-policy](https://docs.aws.amazon.com/cli/latest/reference/dlm/update-lifecycle-policy.html) command to modify the information in a lifecycle policy\. To simplify the syntax, this example references a JSON file, `policyDetailsUpdated.json`, that includes the policy details\.
```
aws dlm update-lifecycle-policy --state DISABLED --execution-role-arn arn:aws:iam::12345678910:role/AWSDataLifecycleManagerDefaultRole" --policy-details file://policyDetailsUpdated.json
```
The following is an example of the `policyDetailsUpdated.json` file\.
```
{
"ResourceTypes":[
"VOLUME"
],
"TargetTags":[
{
"Key": "costcenter",
"Value": "120"
}
],
"Schedules":[
{
"Name": "DailySnapshots",
"TagsToAdd": [
{
"Key": "type",
"Value": "myDailySnapshot"
}
],
"CreateRule": { | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/snapshot-lifecycle.md |
b49401b40f39-1 | "Value": "myDailySnapshot"
}
],
"CreateRule": {
"Interval": 12,
"IntervalUnit": "HOURS",
"Times": [
"15:00"
]
},
"RetainRule": {
"Count" :5
},
"CopyTags": false
}
]
}
```
To view the updated policy, use the `get-lifecycle-policy` command\. You can see that the state, the value of the tag, the snapshot interval, and the snapshot start time were changed\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/snapshot-lifecycle.md |
087f6309a96f-0 | Use the [delete\-lifecycle\-policy](https://docs.aws.amazon.com/cli/latest/reference/dlm/delete-lifecycle-policy.html) command to delete a lifecycle policy and free up the target tags specified in the policy for reuse\.
```
aws dlm delete-lifecycle-policy --policy-id policy-0123456789abcdef0
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/snapshot-lifecycle.md |
5ac1c6e223f8-0 | The [Amazon Data Lifecycle Manager API Reference](https://docs.aws.amazon.com/dlm/latest/APIReference/) provides descriptions and syntax for each of the actions and data types for the Amazon Data Lifecycle Manager Query API\.
Alternatively, you can use one of the AWS SDKs to access the API in a way that's tailored to the programming language or platform that you're using\. For more information, see [AWS SDKs](http://aws.amazon.com/tools/#SDKs)\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/snapshot-lifecycle.md |
bee45e069c7f-0 | You can use the following features to monitor the lifecycle of your snapshots\.
**Topics**
+ [Console and AWS CLI](#monitor-console-cli)
+ [CloudWatch Events](#monitor-cloudwatch-events)
+ [AWS CloudTrail](#monitor-lifecycle-cloudtrail) | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/snapshot-lifecycle.md |
ca592de998ca-0 | You can view your lifecycle policies using the Amazon EC2 console or the AWS CLI\. Each snapshot created by a policy has a timestamp and policy\-related tags\. You can filter snapshots using tags to verify that your backups are being created as you intend\. For information about viewing lifecycle policies using the console, see [View a lifecycle policy](#console-view-policy)\. For information about displaying information about lifecycle policies using the CLI, see [Display a | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/snapshot-lifecycle.md |
ca592de998ca-1 | policies using the CLI, see [Display a lifecycle policy](#display-policy-cli)\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/snapshot-lifecycle.md |
cdc2dde7bf0f-0 | Amazon EBS and Amazon Data Lifecycle Manager emit events related to lifecycle policy actions\. You can use AWS Lambda and Amazon CloudWatch Events to handle event notifications programmatically\. For more information, see the [Amazon CloudWatch Events User Guide](https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/)\.
The following events are available:
+ `createSnapshot`—An Amazon EBS event emitted when a `CreateSnapshot` action succeeds or fails\. For more information, see [Amazon CloudWatch Events for Amazon EBS](ebs-cloud-watch-events.md)\.
+ `DLM Policy State Change`—A Amazon Data Lifecycle Manager event emitted when a lifecycle policy enters an error state\. The event contains a description of what caused the error\. The following is an example of an event when the permissions granted by the IAM role are insufficient:
```
{
"version": "0",
"id": "01234567-0123-0123-0123-0123456789ab",
"detail-type": "DLM Policy State Change",
"source": "aws.dlm",
"account": "123456789012",
"time": "2018-05-25T13:12:22Z",
"region": "us-east-1",
"resources": [ | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/snapshot-lifecycle.md |
cdc2dde7bf0f-1 | "region": "us-east-1",
"resources": [
"arn:aws:dlm:us-east-1:123456789012:policy/policy-0123456789abcdef"
],
"detail": {
"state": "ERROR",
"cause": "Role provided does not have sufficient permissions",
"policy_id": "arn:aws:dlm:us-east-1:123456789012:policy/policy-0123456789abcdef"
}
}
```
The following is an example of an event when a limit is exceeded:
```
{
"version": "0",
"id": "01234567-0123-0123-0123-0123456789ab",
"detail-type": "DLM Policy State Change",
"source": "aws.dlm",
"account": "123456789012",
"time": "2018-05-25T13:12:22Z",
"region": "us-east-1",
"resources": [
"arn:aws:dlm:us-east-1:123456789012:policy/policy-0123456789abcdef" | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/snapshot-lifecycle.md |
cdc2dde7bf0f-2 | ],
"detail":{
"state": "ERROR",
"cause": "Maximum allowed active snapshot limit exceeded",
"policy_id": "arn:aws:dlm:us-east-1:123456789012:policy/policy-0123456789abcdef"
}
}
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/snapshot-lifecycle.md |
df3cff815f67-0 | With AWS CloudTrail, you can track user activity and API usage to demonstrate compliance with internal policies and regulatory standards\. For more information, see the [AWS CloudTrail User Guide](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/)\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/snapshot-lifecycle.md |
9f1cf550c073-0 | An instance is a virtual server in the AWS Cloud\. You launch an instance from an Amazon Machine Image \(AMI\)\. The AMI provides the operating system, application server, and applications for your instance\.
When you sign up for AWS, you can get started with Amazon EC2 for free using the [AWS Free Tier](https://aws.amazon.com/)\. You can use the free tier to launch and use a `t2.micro` instance for free for 12 months \(in Regions where `t2.micro` is unavailable, you can use a `t3.micro` instance under the free tier\)\. If you launch an instance that is not within the free tier, you incur the standard Amazon EC2 usage fees for the instance\. For more information, see the [Amazon EC2 Pricing](https://aws.amazon.com/ec2/pricing)\.
You can launch an instance using the following methods\.
| Method | Documentation |
| --- | --- |
| \[Amazon EC2 console\] Use the launch instance wizard to specify the launch parameters\. | [Launching an instance using the Launch Instance Wizard](launching-instance.md) |
| \[Amazon EC2 console\] Create a launch template and launch the instance from the launch template\. | [Launching an instance from a launch template](ec2-launch-templates.md) |
| \[Amazon EC2 console\] Use an existing instance as the base\. | [Launching an instance using parameters from an existing instance](launch-more-like-this.md) | | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/LaunchingAndUsingInstances.md |
9f1cf550c073-1 | | \[Amazon EC2 console\] Use an AMI that you purchased from the AWS Marketplace\. | [Launching an AWS Marketplace instance](launch-marketplace-console.md) |
| \[AWS CLI\] Use an AMI that you select\. | [Using Amazon EC2 through the AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-services-ec2-instances.html) |
| \[AWS Tools for Windows PowerShell\] Use an AMI that you select\. | [Amazon EC2 from the AWS Tools for Windows PowerShell](https://docs.aws.amazon.com/powershell/latest/userguide/pstools-ec2.html) |
| \[AWS CLI\] Use EC2 Fleet to provision capacity across different EC2 instance types and Availability Zones, and across On\-Demand Instance, Reserved Instance, and Spot Instance purchase models\. | [Launching instances using an EC2 Fleet](ec2-fleet.md) |
When you launch your instance, you can launch your instance in a subnet that is associated with one of the following resources:
+ An Availability Zone \- This option is the default\.
+ A Local Zone \- To launch an instance in a Local Zone, you must opt in to the Local Zone, and then create a subnet in the zone\. For more information, see [Local Zones](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html#concepts-local-zones) | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/LaunchingAndUsingInstances.md |
9f1cf550c073-2 | + A Wavelength Zone \- To launch an instance in a Wavelength Zone, you must opt in to the Wavelength Zone, and then create a subnet in the zone\. For information about how to launch an instance in a Wavelength Zone, see [Get started with AWS Wavelength](https://docs.aws.amazon.com/wavelength/latest/developerguide/get-started-wavelength.html) in the *AWS Wavelength Developer Guide*\.
+ An Outpost \- To launch an instance in an Outpost, you must create an Outpost\. For information about how to create an Outpost, see [Get Started with AWS Outposts](https://docs.aws.amazon.com/outposts/latest/userguide/get-started-outposts.html) in the *AWS Outposts User Guide*\.
After you launch your instance, you can connect to it and use it\. To begin, the instance state is `pending`\. When the instance state is `running`, the instance has started booting\. There might be a short time before you can connect to the instance\. Note that bare metal instance types might take longer to launch\. For more information about bare metal instances, see [Instances built on the Nitro System](instance-types.md#ec2-nitro-instances)\.
The instance receives a public DNS name that you can use to contact the instance from the internet\. The instance also receives a private DNS name that other instances within the same VPC can use to contact the instance\. For more information about connecting to your instance, see [Connect to your Linux instance](AccessingInstances.md)\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/LaunchingAndUsingInstances.md |
9f1cf550c073-3 | When you are finished with an instance, be sure to terminate it\. For more information, see [Terminate your instance](terminating-instances.md)\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/LaunchingAndUsingInstances.md |
b815eb7aab2e-0 | You can use the Amazon Elastic Block Store \(Amazon EBS\) direct APIs to create EBS snapshots, write data directly to your snapshots, read data on your snapshots, and identify the differences or changes between two snapshots\. If you’re an independent software vendor \(ISV\) who offers backup services for Amazon EBS, the EBS direct APIs make it more efficient and cost\-effective to track incremental changes on your EBS volumes through snapshots\. This can be done without having to create new volumes from snapshots, and then use Amazon Elastic Compute Cloud \(Amazon EC2\) instances to compare the differences\.
You can create incremental snapshots directly from data on\-premises into EBS volumes and the cloud to use for quick disaster recovery\. With the ability to write and read snapshots, you can write your on\-premises data to an EBS snapshot during a disaster\. Then after recovery, you can restore it back to AWS or on\-premises from the snapshot\. You no longer need to build and maintain complex mechanisms to copy data to and from Amazon EBS\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-accessing-snapshot.md |
b815eb7aab2e-1 | This user guide provides an overview of the elements that make up the EBS direct APIs, and examples of how to use them effectively\. For more information about the actions, data types, parameters, and errors of the APIs, see the [EBS direct APIs reference](https://docs.aws.amazon.com/ebs/latest/APIReference/)\. For more information about the supported AWS Regions, endpoints, and service quotas for the EBS direct APIs, see [Amazon EBS Endpoints and Quotas](https://docs.aws.amazon.com/general/latest/gr/ebs-service.html) in the *AWS General Reference*\.
**Topics**
+ [Understanding the EBS direct APIs](#ebsapi-elements)
+ [Permissions for IAM users](#ebsapi-permissions)
+ [Using encryption](#ebsapis-using-encryption)
+ [Using Signature Version 4 signing](#ebsapis-using-sigv4)
+ [Using checksums](#ebsapis-using-checksums)
+ [Working with the EBS direct APIs using the API or AWS SDKs](#ebsapi-sdk-examples)
+ [Working with the EBS direct APIs using the command line](#ebsapi-cli-examples)
+ [Optimizing performance](#ebsapi-performance)
+ [Frequently asked questions](#ebsapi-faq) | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-accessing-snapshot.md |
b815eb7aab2e-2 | + [Optimizing performance](#ebsapi-performance)
+ [Frequently asked questions](#ebsapi-faq)
+ [Logging API Calls for the EBS direct APIs with AWS CloudTrail](logging-ebs-apis-using-cloudtrail.md)
+ [Idempotency for StartSnapshot API](ebs-direct-api-idempotency.md) | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-accessing-snapshot.md |
4549a7a32d76-0 | The following are the key elements that you should understand before getting started with the EBS direct APIs\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-accessing-snapshot.md |
362e2b487887-0 | The price that you pay to use the EBS direct APIs depends on the requests you make\. For more information, see [Amazon EBS pricing](http://aws.amazon.com/ebs/pricing/)\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-accessing-snapshot.md |
47e23c8db018-0 | Snapshots are the primary means to back up data from your EBS volumes\. With the EBS direct APIs, you can also back up data from your on\-premises disks to snapshots\. To save storage costs, successive snapshots are incremental, containing only the volume data that changed since the previous snapshot\. For more information, see [Amazon EBS snapshots](EBSSnapshots.md)\.
**Note**
Public snapshots are not supported by the EBS direct APIs\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-accessing-snapshot.md |
13a0ee18fff8-0 | A block is a fragment of data within a snapshot\. Each snapshot can contain thousands of blocks\. All blocks in a snapshot are of a fixed size\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-accessing-snapshot.md |
b6f77b8c44d0-0 | A block index is the offset position of a block within a snapshot, and it is used to identify the block\. Multiply the BlockIndex value with the BlockSize value \(BlockIndex \* BlockSize\) to identify the logical offset of the data in the logical volume\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-accessing-snapshot.md |
b2ec91d58e72-0 | A block token is the identifying hash of a block within a snapshot, and it is used to locate the block data\. Block tokens returned by EBS direct APIs are temporary\. They change on the expiry timestamp specified for them, or if you run another ListSnapshotBlocks or ListChangedBlocks request for the same snapshot\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-accessing-snapshot.md |
412a1b47f67d-0 | A checksum is a small\-sized datum derived from a block of data for the purpose of detecting errors that were introduced during its transmission or storage\. The EBS direct APIs use checksums to validate data integrity\. When you read data from an EBS snapshot, the service provides Base64\-encoded SHA256 checksums for each block of data transmitted, which you can use for validation\. When you write data to an EBS snapshot, you must provide a | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-accessing-snapshot.md |
412a1b47f67d-1 | an EBS snapshot, you must provide a Base64 encoded SHA256 checksum for each block of data transmitted\. The service validates the data received using the checksum provided\. For more information, see [Using checksums](#ebsapis-using-checksums) later in this guide\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-accessing-snapshot.md |
f35cd4e89d46-0 | Encryption protects your data by converting it into unreadable code that can be deciphered only by people who have access to the key used to encrypt it\. You can use the EBS direct APIs to read and write encrypted snapshots, but there are some limitations\. For more information, see [Using encryption](#ebsapis-using-encryption) later in this guide\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-accessing-snapshot.md |
00b0ef0f628b-0 | The EBS direct APIs consists of six actions\. There are three read actions and three write actions\. The read actions are ListSnapshotBlocks, ListChangedBlocks, and GetSnapshotBlock\. The write actions are StartSnapshot, PutSnapshotBlock, and CompleteSnapshot\. These actions are described in the following sections\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-accessing-snapshot.md |
ab7cb5042fa3-0 | The ListSnapshotBlocks action returns the block indexes and block tokens of blocks in the specified snapshot\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-accessing-snapshot.md |
ab3d46cc46e8-0 | The ListChangedBlocks action returns the block indexes and block tokens of blocks that are different between two specified snapshots of the same volume and snapshot lineage\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-accessing-snapshot.md |
a35df000ddf4-0 | The GetSnapshotBlock action returns the data in a block for the specified snapshot ID, block index, and block token\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-accessing-snapshot.md |
11ee610f2d4d-0 | The StartSnapshot action starts a snapshot, either as an incremental snapshot of an existing one or as a new snapshot\. The started snapshot remains in a pending state until it is completed using the CompleteSnapshot action\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-accessing-snapshot.md |
349ff7026909-0 | The PutSnapshotBlock action adds data to a started snapshot in the form of individual blocks\. You must specify a Base64\-encoded SHA256 checksum for the block of data transmitted\. The service validates the checksum after the transmission is completed\. The request fails if the checksum computed by the service doesn’t match what you specified\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-accessing-snapshot.md |
11eec26b6a0b-0 | The CompleteSnapshot action completes a started snapshot that is in a pending state\. The snapshot is then changed to a completed state\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-accessing-snapshot.md |
3559705e75a8-0 | The following steps describe how to use the EBS direct APIs to read snapshots:
1. Use the ListSnapshotBlocks action to view all block indexes and block tokens of blocks in a snapshot\. Or use the ListChangedBlocks action to view only the block indexes and block tokens of blocks that are different between two snapshots of the same volume and snapshot lineage\. These actions help you identify the block tokens and block indexes of blocks for which you might want to get data\.
1. Use the GetSnapshotBlock action, and specify the block index and block token of the block for which you want to get data\.
For examples of how to run these actions, see the [Working with the EBS direct APIs using the API or AWS SDKs](#ebsapi-sdk-examples) and [Working with the EBS direct APIs using the command line](#ebsapi-cli-examples) sections later in this guide\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-accessing-snapshot.md |
02ec24a246ac-0 | The following steps describe how to use the EBS direct APIs to write incremental snapshots:
1. Use the StartSnapshot action and specify a parent snapshot ID to start a snapshot as an incremental snapshot of an existing one, or omit the parent snapshot ID to start a new snapshot\. This action returns the new snapshot ID, which is in a pending state\.
1. Use the PutSnapshotBlock action and specify the ID of the pending snapshot to add data to it in the form of individual blocks\. You must specify a Base64\-encoded SHA256 checksum for the block of data transmitted\. The service computes the checksum of the data received and validates it with the checksum that you specified\. The action fails if the checksums don't match\.
1. When you're done adding data to the pending snapshot, use the CompleteSnapshot action to start an asynchronous workflow that seals the snapshot and moves it to a completed state\.
Repeat these steps to create a new, incremental snapshot using the previously created snapshot as the parent\.
For example, in the following diagram, snapshot A is the first new snapshot started\. Snapshot A is used as the parent snapshot to start snapshot B\. Snapshot B is used as the parent snapshot to start and create snapshot C\. Snapshots A, B, and C are incremental snapshots\. Snapshot A is used to create EBS volume 1\. Snapshot D is created from EBS volume 1\. Snapshot D is an incremental snapshot of A; it is not an incremental snapshot of B or C\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-accessing-snapshot.md |
02ec24a246ac-1 | ![\[EBS direct APIs used to create incremental snapshots.\]](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/images/ebs-apis-write.png)
For examples of how to run these actions, see the [Working with the EBS direct APIs using the API or AWS SDKs](#ebsapi-sdk-examples) and [Working with the EBS direct APIs using the command line](#ebsapi-cli-examples) sections later in this guide\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-accessing-snapshot.md |
d1abb9c98074-0 | An AWS Identity and Access Management \(IAM\) user must have the following policies to use the EBS direct APIs\. For more information, see [Changing Permissions for an IAM User](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_users_change-permissions.html)\.
Be cautious when assigning the following policies to IAM users\. By assigning these policies, you might give access to a user who is denied access to the same resource through the Amazon EC2 APIs, such as the CopySnapshot or CreateVolume actions\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-accessing-snapshot.md |
4f7865f40f38-0 | The following policy allows the *read* EBS direct APIs to be used on all snapshots in a specific AWS Region\. In the policy, replace *<Region>* with the Region of the snapshot\.
```
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ebs:ListSnapshotBlocks",
"ebs:ListChangedBlocks",
"ebs:GetSnapshotBlock"
],
"Resource": "arn:aws:ec2:<Region>::snapshot/*"
}
]
}
```
The following policy allows the *read* EBS direct APIs to be used on snapshots with a specific key\-value tag\. In the policy, replace *<Key>* with the key value of the tag, and *<Value>* with the value of the tag\.
```
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ebs:ListSnapshotBlocks",
"ebs:ListChangedBlocks",
"ebs:GetSnapshotBlock"
], | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-accessing-snapshot.md |
4f7865f40f38-1 | "ebs:ListChangedBlocks",
"ebs:GetSnapshotBlock"
],
"Resource": "arn:aws:ec2:*::snapshot/*",
"Condition": {
"StringEqualsIgnoreCase": {
"aws:ResourceTag/<Key>": "<Value>"
}
}
}
]
}
```
The following policy allows all of the *read* EBS direct APIs to be used on all snapshots in the account only within a specific time range\. This policy authorizes use of the EBS direct APIs based on the `aws:CurrentTime` global condition key\. In the policy, be sure to replace the date and time range shown with the date and time range for your policy\.
```
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ebs:ListSnapshotBlocks",
"ebs:ListChangedBlocks",
"ebs:GetSnapshotBlock"
],
"Resource": "arn:aws:ec2:*::snapshot/*",
"Condition": {
"DateGreaterThan": { | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-accessing-snapshot.md |
4f7865f40f38-2 | "Condition": {
"DateGreaterThan": {
"aws:CurrentTime": "2018-05-29T00:00:00Z"
},
"DateLessThan": {
"aws:CurrentTime": "2020-05-29T23:59:59Z"
}
}
}
]
}
```
The following policy grants access to decrypt an encrypted snapshot using a specific key ID from the AWS Key Management Service \(AWS KMS\)\. It grants access to encrypt new snapshots using the default AWS KMS key ID for EBS snapshots\. It also provides the ability to determine if encrypt by default is enabled on the account\. In the policy, replace *<Region>* with the Region of the AWS KMS key, *<AccountId>* with the ID of the AWS account of the key, and *<KeyId>* with the ID of the key used to encrypt the snapshot that you want to read with the EBS direct APIs\.
```
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"kms:Encrypt",
"kms:Decrypt", | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-accessing-snapshot.md |
4f7865f40f38-3 | "Action": [
"kms:Encrypt",
"kms:Decrypt",
"kms:GenerateDataKey",
"kms:GenerateDataKeyWithoutPlaintext",
"kms:ReEncrypt*",
"kms:CreateGrant",
"ec2:CreateTags",
"kms:DescribeKey",
"ec2:GetEbsDefaultKmsKeyId",
"ec2:GetEbsEncryptionByDefault"
],
"Resource": "arn:aws:kms:<Region>:<AccountId>:key/<KeyId>"
}
]
}
```
For more information, see [Changing Permissions for an IAM User](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_users_change-permissions.html) in the *IAM User Guide*\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-accessing-snapshot.md |
c1a9768c6d99-0 | The following policy allows the *write* EBS direct APIs to be used on all snapshots in a specific AWS Region\. In the policy, replace *<Region>* with the Region of the snapshot\.
```
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ebs:StartSnapshot",
"ebs:PutSnapshotBlock",
"ebs:CompleteSnapshot"
],
"Resource": "arn:aws:ec2:<Region>::snapshot/*"
}
]
}
```
The following policy allows the *write* EBS direct APIs to be used on snapshots with a specific key\-value tag\. In the policy, replace *<Key>* with the key value of the tag, and *<Value>* with the value of the tag\.
```
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ebs:StartSnapshot",
"ebs:PutSnapshotBlock",
"ebs:CompleteSnapshot"
], | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-accessing-snapshot.md |
c1a9768c6d99-1 | "ebs:PutSnapshotBlock",
"ebs:CompleteSnapshot"
],
"Resource": "arn:aws:ec2:*::snapshot/*",
"Condition": {
"StringEqualsIgnoreCase": {
"aws:ResourceTag/<Key>": "<Value>"
}
}
}
]
}
```
The following policy allows all of the EBS direct APIs to be used\. It also allows the `StartSnapshot` action only if a parent snapshot ID is specified\. Therefore, this policy blocks the ability to start new snapshots without using a parent snapshot\.
```
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "ebs:*",
"Resource": "*",
"Condition": {
"StringEquals": {
"ebs:ParentSnapshot": "arn:aws:ec2:*::snapshot/*"
}
}
}
]
}
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-accessing-snapshot.md |
c1a9768c6d99-2 | }
}
}
]
}
```
The following policy allows all of the EBS direct APIs to be used\. It also allows only the `user` tag key to be created for a new snapshot\. This policy also ensures that the user has access to create tags\. The `StartSnapshot` action is the only action that can specify tags\.
```
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "ebs:*",
"Resource": "*",
"Condition": {
"ForAllValues:StringEquals": {
"aws:TagKeys": "user"
}
}
},
{
"Effect": "Allow",
"Action": "ec2:CreateTags",
"Resource": "*"
}
]
}
```
The following policy allows all of the *write* EBS direct APIs to be used on all snapshots in the account only within a specific time range\. This policy authorizes use of the EBS direct APIs based on the `aws:CurrentTime` global condition key\. In the policy, be sure to replace the date and time range shown with the date and time range for your policy\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-accessing-snapshot.md |
c1a9768c6d99-3 | ```
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ebs:StartSnapshot",
"ebs:PutSnapshotBlock",
"ebs:CompleteSnapshot"
],
"Resource": "arn:aws:ec2:*::snapshot/*",
"Condition": {
"DateGreaterThan": {
"aws:CurrentTime": "2018-05-29T00:00:00Z"
},
"DateLessThan": {
"aws:CurrentTime": "2020-05-29T23:59:59Z"
}
}
}
]
}
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-accessing-snapshot.md |
c1a9768c6d99-4 | }
}
}
]
}
```
The following policy grants access to decrypt an encrypted snapshot using a specific key ID from the AWS Key Management Service \(AWS KMS\)\. It grants access to encrypt new snapshots using the default AWS KMS key ID for EBS snapshots\. It also provides the ability to determine if encrypt by default is enabled on the account\. In the policy, replace *<Region>* with the Region of the AWS KMS key, *<AccountId>* with the ID of the AWS account of the key, and *<KeyId>* with the ID of the key used to encrypt the snapshot that you want to read with the EBS direct APIs\.
```
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"kms:Encrypt",
"kms:Decrypt",
"kms:GenerateDataKey",
"kms:GenerateDataKeyWithoutPlaintext",
"kms:ReEncrypt*",
"kms:CreateGrant",
"ec2:CreateTags",
"kms:DescribeKey", | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-accessing-snapshot.md |
c1a9768c6d99-5 | "kms:CreateGrant",
"ec2:CreateTags",
"kms:DescribeKey",
"ec2:GetEbsDefaultKmsKeyId",
"ec2:GetEbsEncryptionByDefault"
],
"Resource": "arn:aws:kms:<Region>:<AccountId>:key/<KeyId>"
}
]
}
```
For more information, see [Changing Permissions for an IAM User](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_users_change-permissions.html) in the *IAM User Guide*\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-accessing-snapshot.md |
aa5c45209619-0 | If Amazon EBS encryption by default is enabled on your AWS account, you cannot start a new snapshot using an un\-encrypted parent snapshot\. You must first encrypt the parent snapshot by copying it\. For more information, see [Copying an Amazon EBS snapshot](ebs-copy-snapshot.md) and [Encryption by default](EBSEncryption.md#encryption-by-default)\.
To start an encrypted snapshot, specify the Amazon Resource Name \(ARN\) of an AWS KMS key, or specify an encrypted parent snapshot in your StartSnapshot request\. If neither are specified, and Amazon EBS encryption by default is enabled on the account, then the default CMK for the account is used\. If no default CMK has been specified for the account, then the AWS managed CMK is used\.
**Important**
By default, all principals in the account have access to the default AWS managed CMK, and they can use it for EBS encryption and decryption operations\. For more information, see [Default key for EBS encryption](EBSEncryption.md#EBSEncryption_key_mgmt)\.
You might need additional IAM permissions to use the EBS direct APIs with encryption\. For more information, see the [Permissions for IAM users](#ebsapi-permissions) section earlier in this guide\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-accessing-snapshot.md |
3b38dfb2443a-0 | Signature Version 4 is the process to add authentication information to AWS requests sent by HTTP\. For security, most requests to AWS must be signed with an access key, which consists of an access key ID and secret access key\. These two keys are commonly referred to as your security credentials\. For information about how to obtain credentials for your account, see [Understanding and getting your credentials](https://docs.aws.amazon.com/general/latest/gr/aws-sec-cred-types.html)\.
If you intend to manually create HTTP requests, you must learn how to sign them\. When you use the AWS Command Line Interface \(AWS CLI\) or one of the AWS SDKs to make requests to AWS, these tools automatically sign the requests for you with the access key that you specify when you configure the tools\. When you use these tools, you don't need to learn how to sign requests yourself\.
For more information, see [Signing AWS requests with Signature Version 4](https://docs.aws.amazon.com/general/latest/gr/sigv4_signing.html) in the *AWS General Reference*\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-accessing-snapshot.md |
46795b5614a8-0 | The GetSnapshotBlock action returns data that is in a block of a snapshot, and the PutSnapshotBlock action adds data to a block in a snapshot\. The block data that is transmitted is not signed as part of the Signature Version 4 signing process\. As a result, checksums are used to validate the integrity of the data as follows:
+ When you use the GetSnapshotBlock action, the response provides a Base64\-encoded SHA256 checksum for the block data using the **x\-amz\-Checksum** header, and the checksum algorithm using the **x\-amz\-Checksum\-Algorithm** header\. Use the returned checksum to validate the integrity of the data\. If the checksum that you generate doesn't match what Amazon EBS provided, you should consider the data not valid and retry your request\.
+ When you use the PutSnapshotBlock action, your request must provide a Base64\-encoded SHA256 checksum for the block data using the **x\-amz\-Checksum** header, and the checksum algorithm using the **x\-amz\-Checksum\-Algorithm** header\. The checksum that you provide is validated against a checksum generated by Amazon EBS to validate the integrity of the data\. If the checksums do not correspond, the request fails\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-accessing-snapshot.md |
46795b5614a8-1 | + When you use the CompleteSnapshot action, your request can optionally provide an aggregate Base64\-encoded SHA256 checksum for the complete set of data added to the snapshot\. Provide the checksum using the **x\-amz\-Checksum** header, the checksum algorithm using the **x\-amz\-Checksum\-Algorithm** header, and the checksum aggregation method using the **x\-amz\-Checksum\-Aggregation\-Method** header\. To generate the aggregated checksum using the linear aggregation method, arrange the checksums for each written block in ascending order of their block index, concatenate them to form a single string, and then generate the checksum on the entire string using the SHA256 algorithm\.
The checksums in these actions are part of the Signature Version 4 signing process\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-accessing-snapshot.md |
c9662bf681a9-0 | The [EBS direct APIs Reference](https://docs.aws.amazon.com/ebs/latest/APIReference/) provides descriptions and syntax for each of the service’s actions and data types\. You can also use one of the AWS SDKs to access an API that's tailored to the programming language or platform that you're using\. For more information, see [AWS SDKs](http://aws.amazon.com/tools/#SDKs)\.
The EBS direct APIs require an AWS Signature Version 4 signature\. For more information, see [Using Signature Version 4 signing](#ebsapis-using-sigv4)\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-accessing-snapshot.md |
183c40b6a5eb-0 | The following [ListChangedBlocks](https://docs.aws.amazon.com/ebs/latest/APIReference/API_ListSnapshotBlocks.html) example request returns the block indexes and block tokens of blocks that are in snapshot `snap-0acEXAMPLEcf41648`\. The `startingBlockIndex` parameter limits the results to block indexes greater than `1000`, and the `maxResults` parameter limits the results to the first `100` blocks\.
```
GET /snapshots/snap-0acEXAMPLEcf41648/blocks?maxResults=100&startingBlockIndex=0 HTTP/1.1
Host: ebs.us-east-2.amazonaws.com
Accept-Encoding: identity
User-Agent: <User agent paramater>
X-Amz-Date: 20200617T231953Z
Authorization: <Authentication parameter>
```
The following example response for the previous request lists the block indexes and block tokens in the snapshot\. Use the GetSnapshotBlock action and specify the block index and block token of the block for which you want to get data\. The block tokens are valid until the expiry time listed\.
```
HTTP/1.1 200 OK
x-amzn-RequestId: d6e5017c-70a8-4539-8830-57f5557f3f27
Content-Type: application/json
Content-Length: 2472 | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-accessing-snapshot.md |
183c40b6a5eb-1 | Content-Type: application/json
Content-Length: 2472
Date: Wed, 17 Jun 2020 23:19:56 GMT
Connection: keep-alive
{
"BlockSize": 524288,
"Blocks": [
{
"BlockIndex": 0,
"BlockToken": "AAUBAcuWqOCnDNuKle11s7IIX6jp6FYcC/q8oT93913HhvLvA+3JRrSybp/0"
},
{
"BlockIndex": 1536,
"BlockToken": "AAUBAWudwfmofcrQhGVlLwuRKm2b8ZXPiyrgoykTRC6IU1NbxKWDY1pPjvnV"
},
{
"BlockIndex": 3072,
"BlockToken": "AAUBAV7p6pC5fKAC7TokoNCtAnZhqq27u6YEXZ3MwRevBkDjmMx6iuA6tsBt"
},
{
"BlockIndex": 3073,
"BlockToken": "AAUBAbqt9zpqBUEvtO2HINAfFaWToOwlPjbIsQOlx6JUN/0+iMQl0NtNbnX4"
},
…
], | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-accessing-snapshot.md |
183c40b6a5eb-2 | },
…
],
"ExpiryTime": 1.59298379649E9,
"VolumeSize": 3
}
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-accessing-snapshot.md |
32684cf1e969-0 | The following [ListChangedBlocks](https://docs.aws.amazon.com/ebs/latest/APIReference/API_ListChangedBlocks.html) example request returns the block indexes and block tokens of blocks that are different between snapshots `snap-0acEXAMPLEcf41648` and `snap-0c9EXAMPLE1b30e2f`\. The `startingBlockIndex` parameter limits the results to block indexes greater than `0`, and the `maxResults` parameter limits the results to the first `500` blocks\.
```
GET /snapshots/snap-0c9EXAMPLE1b30e2f/changedblocks?firstSnapshotId=snap-0acEXAMPLEcf41648&maxResults=500&startingBlockIndex=0 HTTP/1.1
Host: ebs.us-east-2.amazonaws.com
Accept-Encoding: identity
User-Agent: <User agent paramater>
X-Amz-Date: 20200617T232546Z
Authorization: <Authentication parameter>
```
The following example response for the previous request shows that block indexes `0`, `3072`, `6002`, and `6003` are different between the two snapshots\. Additionally, block indexes `6002`, and `6003` exist only in the first snapshot ID specified, and not in the second snapshot ID because there is no second block token listed in the response\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-accessing-snapshot.md |
32684cf1e969-1 | Use the `GetSnapshotBlock` action and specify the block index and block token of the block for which you want to get data\. The block tokens are valid until the expiry time listed\.
```
HTTP/1.1 200 OK
x-amzn-RequestId: fb0f6743-6d81-4be8-afbe-db11a5bb8a1f
Content-Type: application/json
Content-Length: 1456
Date: Wed, 17 Jun 2020 23:25:47 GMT
Connection: keep-alive
{
"BlockSize": 524288,
"ChangedBlocks": [
{
"BlockIndex": 0,
"FirstBlockToken": "AAUBAVaWqOCnDNuKle11s7IIX6jp6FYcC/tJuVT1GgP23AuLntwiMdJ+OJkL",
"SecondBlockToken": "AAUBASxzy0Y0b33JVRLoYm3NOresCxn5RO+HVFzXW3Y/RwfFaPX2Edx8QHCh"
},
{
"BlockIndex": 3072,
"FirstBlockToken": "AAUBAcHp6pC5fKAC7TokoNCtAnZhqq27u6fxRfZOLEmeXLmHBf2R/Yb24MaS", | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-accessing-snapshot.md |
32684cf1e969-2 | "SecondBlockToken": "AAUBARGCaufCqBRZC8tEkPYGGkSv3vqvOjJ2xKDi3ljDFiytUxBLXYgTmkid"
},
{
"BlockIndex": 6002,
"FirstBlockToken": "AAABASqX4/NWjvNceoyMUljcRd0DnwbSwNnes1UkoP62CrQXvn47BY5435aw"
},
{
"BlockIndex": 6003,
"FirstBlockToken": "AAABASmJ0O5JxAOce25rF4P1sdRtyIDsX12tFEDunnePYUKOf4PBROuICb2A"
},
...
],
"ExpiryTime": 1.592976647009E9,
"VolumeSize": 3
}
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-accessing-snapshot.md |
1d8be6f68952-0 | The following [GetSnapshotBlock](https://docs.aws.amazon.com/ebs/latest/APIReference/API_GetSnapshotBlock.html) example request returns the data in the block index `3072` with block token `AAUBARGCaufCqBRZC8tEkPYGGkSv3vqvOjJ2xKDi3ljDFiytUxBLXYgTmkid`, in snapshot `snap-0c9EXAMPLE1b30e2f`\.
```
GET /snapshots/snap-0c9EXAMPLE1b30e2f/blocks/3072?blockToken=AAUBARGCaufCqBRZC8tEkPYGGkSv3vqvOjJ2xKDi3ljDFiytUxBLXYgTmkid HTTP/1.1
Host: ebs.us-east-2.amazonaws.com
Accept-Encoding: identity
User-Agent: <User agent paramater>
X-Amz-Date: 20200617T232838Z
Authorization: <Authentication parameter>
```
The following example response for the previous request shows the size of the data returned, the checksum to validate the data, and the algorithm used to generate the checksum\. The binary data is transmitted in the body of the response and is represented as *BlockData* in the following example\.
```
HTTP/1.1 200 OK | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-accessing-snapshot.md |
1d8be6f68952-1 | ```
HTTP/1.1 200 OK
x-amzn-RequestId: 2d0db2fb-bd88-474d-a137-81c4e57d7b9f
x-amz-Data-Length: 524288
x-amz-Checksum: Vc0yY2j3qg8bUL9I6GQuI2orTudrQRBDMIhcy7bdEsw=
x-amz-Checksum-Algorithm: SHA256
Content-Type: application/octet-stream
Content-Length: 524288
Date: Wed, 17 Jun 2020 23:28:38 GMT
Connection: keep-alive
BlockData
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-accessing-snapshot.md |
5d52a8ea93cb-0 | The following [StartSnapshot](https://docs.aws.amazon.com/ebs/latest/APIReference/API_StartSnapshot.html) example request starts an `8` GiB snapshot, using snapshot `snap-123EXAMPLE1234567` as the parent snapshot\. The new snapshot will be an incremental snapshot of the parent snapshot\. The snapshot moves to an error state if there are no put or complete requests made for the snapshot within the specified `60` minute timeout period\. The `550e8400-e29b-41d4-a716-446655440000` client token ensures idempotency for the request\. If the client token is omitted, the AWS SDK automatically generates one for you\. For more information about idempotency, see [Idempotency for StartSnapshot API](ebs-direct-api-idempotency.md)\.
```
POST /snapshots HTTP/1.1
Host: ebs.us-east-2.amazonaws.com
Accept-Encoding: identity
User-Agent: <User agent paramater>
X-Amz-Date: 20200618T040724Z
Authorization: <Authentication parameter>
{
"VolumeSize": 8,
"ParentSnapshot": snap-123EXAMPLE1234567,
"ClientToken": "550e8400-e29b-41d4-a716-446655440000", | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-accessing-snapshot.md |
5d52a8ea93cb-1 | "ClientToken": "550e8400-e29b-41d4-a716-446655440000",
"Timeout": 60
}
```
The following example response for the previous request shows the snapshot ID, AWS account ID, status, volume size in GiB, and size of the blocks in the snapshot\. The snapshot is started in a pending state\. Specify the snapshot ID in a subsequent `PutSnapshotBlocks` request to write data to the snapshot\.
```
HTTP/1.1 201 Created
x-amzn-RequestId: 929e6eb9-7183-405a-9502-5b7da37c1b18
Content-Type: application/json
Content-Length: 181
Date: Thu, 18 Jun 2020 04:07:29 GMT
Connection: keep-alive
{
"BlockSize": 524288,
"Description": null,
"OwnerId": "138695307491",
"Progress": null,
"SnapshotId": "snap-052EXAMPLEc85d8dd",
"StartTime": null,
"Status": "pending",
"Tags": null,
"VolumeSize": 8
}
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-accessing-snapshot.md |
47c62a13b0de-0 | The following [PutSnapshot](https://docs.aws.amazon.com/ebs/latest/APIReference/API_PutSnapshotBlock.html) example request writes `524288` Bytes of data to block index `1000` on snapshot `snap-052EXAMPLEc85d8dd`\. The Base64 encoded `QOD3gmEQOXATfJx2Aa34W4FU2nZGyXfqtsUuktOw8DM=` checksum was generated using the `SHA256` algorithm\. The data is transmitted in the body of the request and is represented as *BlockData* in the following example\.
```
PUT /snapshots/snap-052EXAMPLEc85d8dd/blocks/1000 HTTP/1.1
Host: ebs.us-east-2.amazonaws.com
Accept-Encoding: identity
x-amz-Data-Length: 524288
x-amz-Checksum: QOD3gmEQOXATfJx2Aa34W4FU2nZGyXfqtsUuktOw8DM=
x-amz-Checksum-Algorithm: SHA256
User-Agent: <User agent paramater>
X-Amz-Date: 20200618T042215Z
X-Amz-Content-SHA256: UNSIGNED-PAYLOAD
Authorization: <Authentication parameter>
BlockData
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-accessing-snapshot.md |
47c62a13b0de-1 | X-Amz-Content-SHA256: UNSIGNED-PAYLOAD
Authorization: <Authentication parameter>
BlockData
```
The following is example response for the previous request confirms the data length, checksum, and checksum algorithm for the data received by the service\.
```
HTTP/1.1 201 Created
x-amzn-RequestId: 643ac797-7e0c-4ad0-8417-97b77b43c57b
x-amz-Checksum: QOD3gmEQOXATfJx2Aa34W4FU2nZGyXfqtsUuktOw8DM=
x-amz-Checksum-Algorithm: SHA256
Content-Type: application/json
Content-Length: 2
Date: Thu, 18 Jun 2020 04:22:12 GMT
Connection: keep-alive
{}
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-accessing-snapshot.md |
4606e1733836-0 | The following [CompleteSnapshot](https://docs.aws.amazon.com/ebs/latest/APIReference/API_CompleteSnapshot.html) example request completes snapshot `snap-052EXAMPLEc85d8dd`\. The command specifies that `5` blocks were written to the snapshot\. The `6D3nmwi5f2F0wlh7xX8QprrJBFzDX8aacdOcA3KCM3c=` checksum represents the checksum for the complete set of data written to a snapshot\.
```
POST /snapshots/completion/snap-052EXAMPLEc85d8dd HTTP/1.1
Host: ebs.us-east-2.amazonaws.com
Accept-Encoding: identity
x-amz-ChangedBlocksCount: 5
x-amz-Checksum: 6D3nmwi5f2F0wlh7xX8QprrJBFzDX8aacdOcA3KCM3c=
x-amz-Checksum-Algorithm: SHA256
x-amz-Checksum-Aggregation-Method: LINEAR
User-Agent: <User agent paramater>
X-Amz-Date: 20200618T043158Z
Authorization: <Authentication parameter>
```
The following is an example response for the previous request\.
```
HTTP/1.1 202 Accepted | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-accessing-snapshot.md |
4606e1733836-1 | ```
The following is an example response for the previous request\.
```
HTTP/1.1 202 Accepted
x-amzn-RequestId: 06cba5b5-b731-49de-af40-80333ac3a117
Content-Type: application/json
Content-Length: 20
Date: Thu, 18 Jun 2020 04:31:50 GMT
Connection: keep-alive
{"Status":"pending"}
``` | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-accessing-snapshot.md |
1b2596d9d245-0 | The following examples show how to use the EBS direct APIs using the AWS Command Line Interface \(AWS CLI\)\. For more information about installing and configuring the AWS CLI, see [Installing the AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) and [Quickly Configuring the AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html#cli-quick-configuration)\. | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-accessing-snapshot.md |
24fdbf2f4809-0 | The following [list\-snapshot\-blocks](https://docs.aws.amazon.com/cli/latest/reference/ebs/list-snapshot-blocks.html) example command returns the block indexes and block tokens of blocks that are in snapshot `snap-0987654321`\. The `--starting-block-index` parameter limits the results to block indexes greater than `1000`, and the `--max-results` parameter limits the results to the first `100` blocks\.
```
aws ebs list-snapshot-blocks --snapshot-id snap-0987654321 --starting-block-index 1000 --max-results 100
```
The following example response for the previous command lists the block indexes and block tokens in the snapshot\. Use the `get-snapshot-block` command and specify the block index and block token of the block for which you want to get data\. The block tokens are valid until the expiry time listed\.
```
{
"Blocks": [
{
"BlockIndex": 1001,
"BlockToken": "AAABAV3/PNhXOynVdMYHUpPsetaSvjLB1dtIGfbJv5OJ0sX855EzGTWos4a4"
},
{
"BlockIndex": 1002, | https://github.com/siagholami/aws-documentation/tree/main/documents/amazon-ec2-user-guide/doc_source/ebs-accessing-snapshot.md |
Subsets and Splits