Skip to content

EC2  >  Operations  >  modify_snapshot_attribute

modify_snapshot_attribute

Operation

modify_snapshot_attribute async

modify_snapshot_attribute(input: ModifySnapshotAttributeInput, plugins: list[Plugin] | None = None) -> ModifySnapshotAttributeOutput

Adds or removes permission settings for the specified snapshot. You may add or remove specified Amazon Web Services 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. You can make up to 500 modifications to a snapshot in a single operation.

Encrypted snapshots and snapshots with Amazon Web Services Marketplace product codes cannot be made public. Snapshots encrypted with your default KMS key cannot be shared with other accounts.

For more information about modifying snapshot permissions, see Share a snapshot in the Amazon EBS User Guide.

Parameters:

Name Type Description Default
input ModifySnapshotAttributeInput

An instance of ModifySnapshotAttributeInput.

required
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None

Returns:

Type Description
ModifySnapshotAttributeOutput

An instance of ModifySnapshotAttributeOutput.

Input

ModifySnapshotAttributeInput dataclass

Bases: _SerdeShape

Dataclass for ModifySnapshotAttributeInput structure.

Attributes

attribute class-attribute instance-attribute
attribute: str | None = ...

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

create_volume_permission class-attribute instance-attribute
create_volume_permission: CreateVolumePermissionModifications | None = ...

A JSON representation of the snapshot attribute modification.

dry_run class-attribute instance-attribute
dry_run: bool | None = ...

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.

group_names class-attribute instance-attribute
group_names: list[str] | None = ...

The group to modify for the snapshot.

operation_type class-attribute instance-attribute
operation_type: str | None = ...

The type of operation to perform to the attribute.

snapshot_id class-attribute instance-attribute
snapshot_id: str | None = ...

The ID of the snapshot.

user_ids class-attribute instance-attribute
user_ids: list[str] | None = ...

The account ID to modify for the snapshot.

Output

ModifySnapshotAttributeOutput dataclass

Bases: _SerdeShape

Dataclass for ModifySnapshotAttributeOutput structure.

Attributes

response_metadata class-attribute instance-attribute
response_metadata: ResponseMetadata = ...

Metadata about the response that produced this output. Use this to recover the request identifiers a service's support team needs in order to investigate a call. Members of the metadata are individually optional.