AWS SDK Version 3 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Container for the parameters to the ModifySnapshotAttribute operation. 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.

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.

Inheritance Hierarchy

System.Object
  Amazon.Runtime.AmazonWebServiceRequest
    Amazon.EC2.AmazonEC2Request
      Amazon.EC2.Model.ModifySnapshotAttributeRequest

Namespace: Amazon.EC2.Model
Assembly: AWSSDK.EC2.dll
Version: 3.x.y.z

Syntax

C#
public class ModifySnapshotAttributeRequest : AmazonEC2Request
         IAmazonWebServiceRequest

The ModifySnapshotAttributeRequest type exposes the following members

Constructors

NameDescription
Public Method ModifySnapshotAttributeRequest()

Empty constructor used to set properties independently even when a simple constructor is available

Public Method ModifySnapshotAttributeRequest(string, SnapshotAttributeName, OperationType)

Instantiates ModifySnapshotAttributeRequest with the parameterized properties

Properties

NameTypeDescription
Public Property Attribute Amazon.EC2.SnapshotAttributeName

Gets and sets the property Attribute.

The snapshot attribute to modify.

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

Public Property CreateVolumePermission Amazon.EC2.Model.CreateVolumePermissionModifications

Gets and sets the property CreateVolumePermission.

A JSON representation of the snapshot attribute modification.

Public Property GroupNames System.Collections.Generic.List<System.String>

Gets and sets the property GroupNames.

The group to modify for the snapshot.

Public Property OperationType Amazon.EC2.OperationType

Gets and sets the property OperationType.

The type of operation to perform to the attribute.

Public Property SnapshotId System.String

Gets and sets the property SnapshotId.

The ID of the snapshot.

Public Property UserIds System.Collections.Generic.List<System.String>

Gets and sets the property UserIds.

The account ID to modify for the snapshot.

Examples

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.

To modify a snapshot attribute


var response = client.ModifySnapshotAttribute(new ModifySnapshotAttributeRequest 
{
    Attribute = "createVolumePermission",
    OperationType = "remove",
    SnapshotId = "snap-1234567890abcdef0",
    UserIds = new List {
        "123456789012"
    }
});


            

This example makes the snapshot ``snap-1234567890abcdef0`` public.

To make a snapshot public


var response = client.ModifySnapshotAttribute(new ModifySnapshotAttributeRequest 
{
    Attribute = "createVolumePermission",
    GroupNames = new List {
        "all"
    },
    OperationType = "add",
    SnapshotId = "snap-1234567890abcdef0"
});


            

Version Information

.NET Standard:
Supported in: 1.3

.NET Framework:
Supported in: 4.5, 4.0, 3.5

Portable Class Library:
Supported in: Windows Store Apps
Supported in: Windows Phone 8.1
Supported in: Xamarin Android
Supported in: Xamarin iOS (Unified)
Supported in: Xamarin.Forms