StartSnapshot - EBS direct APIs

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.

Note

You should always retry requests that receive server (5xx) error responses, and ThrottlingException and RequestThrottledException client error responses. For more information see Error retries in the Amazon Elastic Compute Cloud User Guide.

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.

You can't specify Encrypted and ParentSnapshotId in the same request. If you specify both parameters, the request fails with ValidationException.

The encryption status of the snapshot depends on the values that you specify for Encrypted, KmsKeyArn, and ParentSnapshotId, and whether your AWS account is enabled for encryption by default. For more information, see Using encryption in the Amazon Elastic Compute Cloud User Guide.

Important

To create an encrypted snapshot, you must have permission to use the KMS key. For more information, see Permissions to use AWS Key Management Service keys 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) key to be used to encrypt the snapshot.

The encryption status of the snapshot depends on the values that you specify for Encrypted, KmsKeyArn, and ParentSnapshotId, and whether your AWS account is enabled for encryption by default. For more information, see Using encryption in the Amazon Elastic Compute Cloud User Guide.

Important

To create an encrypted snapshot, you must have permission to use the KMS key. For more information, see Permissions to use AWS Key Management Service keys in the Amazon Elastic Compute Cloud User Guide.

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.

You can't specify ParentSnapshotId and Encrypted in the same request. If you specify both parameters, the request fails with ValidationException.

The encryption status of the snapshot depends on the values that you specify for Encrypted, KmsKeyArn, and ParentSnapshotId, and whether your AWS account is enabled for encryption by default. For more information, see Using encryption in the Amazon Elastic Compute Cloud User Guide.

Important

If you specify an encrypted parent snapshot, you must have permission to use the KMS key that was used to encrypt the parent snapshot. For more information, see Permissions to use AWS Key Management Service keys in the Amazon Elastic Compute Cloud User Guide.

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 4320.

Required: No

VolumeSize

The size of the volume, in GiB. The maximum size is 65536 GiB (64 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", "SseType": "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) key 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]+$

SseType

Reserved for future use.

Type: String

Valid Values: sse-ebs | sse-kms | none

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: 409

InternalServerException

An internal error has occurred. For more information see Error retries.

HTTP Status Code: 500

RequestThrottledException

The number of API requests has exceeded the maximum allowed API request throttling limit for the snapshot. For more information see Error retries.

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: