aws ec2 create-snapshot
Creates a snapshot of an EBS volume and stores it in Amazon S3. AWS CLI reference
2 examples 6 options Its page in the AWS CLI reference
Examples
Example 1: To create a snapshot
The following create-snapshot example creates a snapshot of the volume with a volume ID of vol-1234567890abcdef0 and a short description to identify the snapshot.
aws ec2 create-snapshot --volume-id vol-1234567890abcdef0 --description "This is my root volume snapshot"Identify--volume-idThe ID of the Amazon EBS volume.--descriptionA description for the snapshot.Its output
{
"Description": "This is my root volume snapshot",
"Tags": [],
"Encrypted": false,
"VolumeId": "vol-1234567890abcdef0",
"State": "pending",
"VolumeSize": 8,
"StartTime": "2018-02-28T21:06:01.000Z",
"Progress": "",
"OwnerId": "123456789012",
"SnapshotId": "snap-0abcdef1234567890"
}For more information, see Create Amazon EBS snapshots in the Amazon EBS User Guide.
Example 2: To create a snapshot with tags
The following create-snapshot example creates a snapshot and applies two tags: purpose=prod and costcenter=123.
aws ec2 create-snapshot --volume-id vol-1234567890abcdef0 --description 'Prod backup' --tag-specifications 'ResourceType=snapshot,Tags=[{Key=purpose,Value=prod},{Key=costcenter,Value=123}]'Identify--volume-idThe ID of the Amazon EBS volume.--descriptionA description for the snapshot.--tag-specificationsThe tags to apply to the snapshot during creation.Its output
{
"Description": "Prod backup",
"Tags": [
{
"Value": "prod",
"Key": "purpose"
},
{
"Value": "123",
"Key": "costcenter"
}
],
"Encrypted": false,
"VolumeId": "vol-1234567890abcdef0",
"State": "pending",
"VolumeSize": 8,
"StartTime": "2018-02-28T21:06:06.000Z",
"Progress": "",
"OwnerId": "123456789012",
"SnapshotId": "snap-09ed24a70bc19bbe4"
}For more information, see Create Amazon EBS snapshots in the Amazon EBS User Guide.
Options
--descriptionA description for the snapshot.--dry-runChecks whether you have the required permissions for the action, without actually making the request, and provides an error response.--locationOnly supported for volumes in Local Zones.--outpost-arnOnly supported for volumes on Outposts.--tag-specificationsThe tags to apply to the snapshot during creation.--volume-idThe ID of the Amazon EBS volume.