Table Of Contents


User Guide

First time using the AWS CLI? See the User Guide for help getting started.

[ aws . ec2 ]



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 operation. If you need to both add and remove account IDs for a snapshot, you must use multiple operations.

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 about modifying snapshot permissions, see Sharing Snapshots in the Amazon Elastic Compute Cloud User Guide .

See also: AWS API Documentation

See 'aws help' for descriptions of global parameters.


[--attribute <value>]
[--create-volume-permission <value>]
[--group-names <value>]
[--operation-type <value>]
--snapshot-id <value>
[--user-ids <value>]
[--dry-run | --no-dry-run]
[--cli-input-json <value>]
[--generate-cli-skeleton <value>]


--attribute (string)

The snapshot attribute to modify. Only volume creation permissions can be modified.

Possible values:

  • productCodes
  • createVolumePermission

--create-volume-permission (structure)

A JSON representation of the snapshot attribute modification.

Shorthand Syntax:


JSON Syntax:

  "Add": [
      "Group": "all",
      "UserId": "string"
  "Remove": [
      "Group": "all",
      "UserId": "string"

--group-names (list)

The group to modify for the snapshot.


"string" "string" ...

--operation-type (string)

The type of operation to perform to the attribute.

Possible values:

  • add
  • remove

--snapshot-id (string)

The ID of the snapshot.

--user-ids (list)

The account ID to modify for the snapshot.


"string" "string" ...

--dry-run | --no-dry-run (boolean)

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 .

--cli-input-json (string) Performs service operation based on the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton. If other arguments are provided on the command line, the CLI values will override the JSON-provided values. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally.

--generate-cli-skeleton (string) Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value input, prints a sample input JSON that can be used as an argument for --cli-input-json. If provided with the value output, it validates the command inputs and returns a sample output JSON for that command.

See 'aws help' for descriptions of global parameters.


To modify a snapshot attribute

This example modifies snapshot snap-1234567890abcdef0 to remove the create volume permission for a user with the account ID 123456789012. If the command succeeds, no output is returned.


aws ec2 modify-snapshot-attribute --snapshot-id snap-1234567890abcdef0 --attribute createVolumePermission --operation-type remove --user-ids 123456789012

To make a snapshot public

This example makes the snapshot snap-1234567890abcdef0 public.


aws ec2 modify-snapshot-attribute --snapshot-id snap-1234567890abcdef0 --attribute createVolumePermission --operation-type add --group-names all