StartSnapshot - Amazon Elastic Block Store
AWS services or capabilities described in AWS documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with AWS services in China.

StartSnapshot

Creates a new Amazon EBS snapshot. The new snapshot enters the pending state after the request completes.

After creating the snapshot, use PutSnapshotBlock to write blocks of data to the snapshot.

Request Syntax

POST /snapshots HTTP/1.1 Content-type: application/json { "ClientToken": "string", "Description": "string", "Encrypted": boolean, "KmsKeyArn": "string", "ParentSnapshotId": "string", "Tags": [ { "Key": "string", "Value": "string" } ], "Timeout": number, "VolumeSize": number }

URI Request Parameters

The request does not use any URI parameters.

Request Body

The request accepts the following data in JSON format.

ClientToken

A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully. The subsequent retries with the same client token return the result from the original successful request and they have no additional effect.

If you do not specify a client token, one is automatically generated by the AWS SDK.

For more information, see Idempotency for StartSnapshot API in the Amazon Elastic Compute Cloud User Guide.

Type: String

Length Constraints: Maximum length of 255.

Pattern: ^[\S]+$

Required: No

Description

A description for the snapshot.

Type: String

Length Constraints: Maximum length of 255.

Pattern: ^[\S\s]+$

Required: No

Encrypted

Indicates whether to encrypt the snapshot. To create an encrypted snapshot, specify true. To create an unencrypted snapshot, omit this parameter.

If you specify a value for ParentSnapshotId, omit this parameter.

If you specify true, the snapshot is encrypted using the CMK specified using the KmsKeyArn parameter. If no value is specified for KmsKeyArn, the default CMK for your account is used. If no default CMK has been specified for your account, the AWS managed CMK is used. To set a default CMK for your account, use ModifyEbsDefaultKmsKeyId.

If your account is enabled for encryption by default, you cannot set this parameter to false. In this case, you can omit this parameter.

For more information, see Using encryption in the Amazon Elastic Compute Cloud User Guide.

Type: Boolean

Required: No

KmsKeyArn

The Amazon Resource Name (ARN) of the AWS Key Management Service (AWS KMS) customer master key (CMK) to be used to encrypt the snapshot. If you do not specify a CMK, the default AWS managed CMK is used.

If you specify a ParentSnapshotId, omit this parameter; the snapshot will be encrypted using the same CMK that was used to encrypt the parent snapshot.

If Encrypted is set to true, you must specify a CMK ARN.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 2048.

Pattern: arn:aws[a-z\-]*:kms:.*:[0-9]{12}:key/.*

Required: No

ParentSnapshotId

The ID of the parent snapshot. If there is no parent snapshot, or if you are creating the first snapshot for an on-premises volume, omit this parameter.

If your account is enabled for encryption by default, you cannot use an unencrypted snapshot as a parent snapshot. You must first create an encrypted copy of the parent snapshot using CopySnapshot.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 64.

Pattern: ^snap-[0-9a-f]+$

Required: No

Tags

The tags to apply to the snapshot.

Type: Array of Tag objects

Required: No

Timeout

The amount of time (in minutes) after which the snapshot is automatically cancelled if:

  • No blocks are written to the snapshot.

  • The snapshot is not completed after writing the last block of data.

If no value is specified, the timeout defaults to 60 minutes.

Type: Integer

Valid Range: Minimum value of 10. Maximum value of 60.

Required: No

VolumeSize

The size of the volume, in GiB. The maximum size is 16384 GiB (16 TiB).

Type: Long

Valid Range: Minimum value of 1.

Required: Yes

Response Syntax

HTTP/1.1 201 Content-type: application/json { "BlockSize": number, "Description": "string", "KmsKeyArn": "string", "OwnerId": "string", "ParentSnapshotId": "string", "SnapshotId": "string", "StartTime": number, "Status": "string", "Tags": [ { "Key": "string", "Value": "string" } ], "VolumeSize": number }

Response Elements

If the action is successful, the service sends back an HTTP 201 response.

The following data is returned in JSON format by the service.

BlockSize

The size of the blocks in the snapshot, in bytes.

Type: Integer

Description

The description of the snapshot.

Type: String

Length Constraints: Maximum length of 255.

Pattern: ^[\S\s]+$

KmsKeyArn

The Amazon Resource Name (ARN) of the AWS Key Management Service (AWS KMS) customer master key (CMK) used to encrypt the snapshot.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 2048.

Pattern: arn:aws[a-z\-]*:kms:.*:[0-9]{12}:key/.*

OwnerId

The AWS account ID of the snapshot owner.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 24.

Pattern: \S+

ParentSnapshotId

The ID of the parent snapshot.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 64.

Pattern: ^snap-[0-9a-f]+$

SnapshotId

The ID of the snapshot.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 64.

Pattern: ^snap-[0-9a-f]+$

StartTime

The timestamp when the snapshot was created.

Type: Timestamp

Status

The status of the snapshot.

Type: String

Length Constraints: Maximum length of 32.

Valid Values: completed | pending | error

Tags

The tags applied to the snapshot. You can specify up to 50 tags per snapshot. For more information, see Tagging your Amazon EC2 resources in the Amazon Elastic Compute Cloud User Guide.

Type: Array of Tag objects

VolumeSize

The size of the volume, in GiB.

Type: Long

Valid Range: Minimum value of 1.

Errors

For information about the errors that are common to all actions, see Common Errors.

AccessDeniedException

You do not have sufficient access to perform this action.

HTTP Status Code: 403

ConcurrentLimitExceededException

You have reached the limit for concurrent API requests. For more information, see Optimizing performance of the EBS direct APIs in the Amazon Elastic Compute Cloud User Guide.

HTTP Status Code: 400

ConflictException

The request uses the same client token as a previous, but non-identical request.

HTTP Status Code: 503

InternalServerException

An internal error has occurred.

HTTP Status Code: 500

RequestThrottledException

The number of API requests has exceed the maximum allowed API request throttling limit.

HTTP Status Code: 400

ResourceNotFoundException

The specified resource does not exist.

HTTP Status Code: 404

ServiceQuotaExceededException

Your current service quotas do not allow you to perform this action.

HTTP Status Code: 402

ValidationException

The input fails to satisfy the constraints of the EBS direct APIs.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: