Menu
Amazon Elastic Compute Cloud
API Reference (API Version 2016-11-15)

ModifySnapshotAttribute

Adds or removes permission settings for the specified snapshot. You may add or remove specified AWS account IDs from a snapshot's list of create volume permissions, but you cannot do both in a single API call. If you need to both add and remove account IDs for a snapshot, you must use multiple API calls.

Note

Encrypted snapshots and snapshots with AWS Marketplace product codes cannot be made public. Snapshots encrypted with your default CMK cannot be shared with other accounts.

For more information on modifying snapshot permissions, see Sharing Snapshots in the Amazon Elastic Compute Cloud User Guide.

Request Parameters

The following parameters are for this specific action. For more information about required and optional parameters that are common to all actions, see Common Query Parameters.

Attribute

The snapshot attribute to modify.

Note

Only volume creation permissions may be modified at the customer level.

Type: String

Valid Values: productCodes | createVolumePermission

Required: No

CreateVolumePermission

A JSON representation of the snapshot attribute modification.

Type: CreateVolumePermissionModifications object

Required: No

DryRun

Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Type: Boolean

Required: No

OperationType

The type of operation to perform to the attribute.

Type: String

Valid Values: add | remove

Required: No

SnapshotId

The ID of the snapshot.

Type: String

Required: Yes

UserGroup.N

The group to modify for the snapshot.

Type: Array of strings

Required: No

UserId.N

The account ID to modify for the snapshot.

Type: Array of strings

Required: No

Response Elements

The following elements are returned by the service.

requestId

The ID of the request.

Type: String

return

Is true if the request succeeds, and an error otherwise.

Type: Boolean

Errors

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

Examples

Example

This example makes the snap-1234567890abcdef0 snapshot public, and gives the account with ID 111122223333 permission to create volumes from the snapshot.

Sample Request

https://ec2.amazonaws.com/?Action=ModifySnapshotAttribute
&SnapshotId=snap-1234567890abcdef0
&CreateVolumePermission.Add.1.UserId=111122223333
&CreateVolumePermission.Add.1.Group=all
&AUTHPARAMS

Sample Response

<ModifySnapshotAttributeResponse xmlns="http://ec2.amazonaws.com/doc/2016-11-15/">
   <requestId>59dbff89-35bd-4eac-99ed-be587EXAMPLE</requestId> 
   <return>true</return>
</ModifySnapshotAttributeResponse>

Example

This example makes the snap-1234567890abcdef0 snapshot public, and removes the account with ID 111122223333 from the list of users with permission to create volumes from the snapshot.

Sample Request

https://ec2.amazonaws.com/?Action=ModifySnapshotAttribute
&SnapshotId=snap-1234567890abcdef0
&CreateVolumePermission.Remove.1.UserId=111122223333
&CreateVolumePermission.Add.1.Group=all
&AUTHPARAMS

Sample Response

<ModifySnapshotAttributeResponse xmlns="http://ec2.amazonaws.com/doc/2016-11-15/">
   <requestId>59dbff89-35bd-4eac-99ed-be587EXAMPLE</requestId> 
   <return>true</return>
</ModifySnapshotAttributeResponse>

See Also

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