:doc:`EC2 <../../ec2>` / Client / describe_snapshot_attribute

***************************
describe_snapshot_attribute
***************************



.. py:method:: EC2.Client.describe_snapshot_attribute(**kwargs)

  

  Describes the specified attribute of the specified snapshot. You can specify only one attribute at a time.

   

  For more information about EBS snapshots, see `Amazon EBS snapshots <https://docs.aws.amazon.com/ebs/latest/userguide/ebs-snapshots.html>`__ in the *Amazon EBS User Guide*.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSnapshotAttribute>`_  


  **Request Syntax**
  ::

    response = client.describe_snapshot_attribute(
        Attribute='productCodes'|'createVolumePermission',
        SnapshotId='string',
        DryRun=True|False
    )
    
  :type Attribute: string
  :param Attribute: **[REQUIRED]** 

    The snapshot attribute you would like to view.

    

  
  :type SnapshotId: string
  :param SnapshotId: **[REQUIRED]** 

    The ID of the EBS snapshot.

    

  
  :type DryRun: boolean
  :param 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``.

    

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'ProductCodes': [
              {
                  'ProductCodeId': 'string',
                  'ProductCodeType': 'devpay'|'marketplace'
              },
          ],
          'SnapshotId': 'string',
          'CreateVolumePermissions': [
              {
                  'UserId': 'string',
                  'Group': 'all'
              },
          ]
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **ProductCodes** *(list) --* 

        The product codes.

        
        

        - *(dict) --* 

          Describes a product code.

          
          

          - **ProductCodeId** *(string) --* 

            The product code.

            
          

          - **ProductCodeType** *(string) --* 

            The type of product code.

            
      
    
      

      - **SnapshotId** *(string) --* 

        The ID of the EBS snapshot.

        
      

      - **CreateVolumePermissions** *(list) --* 

        The users and groups that have the permissions for creating volumes from the snapshot.

        
        

        - *(dict) --* 

          Describes the user or group to be added or removed from the list of create volume permissions for a volume.

          
          

          - **UserId** *(string) --* 

            The ID of the Amazon Web Services account to be added or removed.

            
          

          - **Group** *(string) --* 

            The group to be added or removed. The possible value is ``all``.

            
      
    
  

  **Examples**

  This example describes the ``createVolumePermission`` attribute on a snapshot with the snapshot ID of ``snap-066877671789bd71b``.
  ::

    response = client.describe_snapshot_attribute(
        Attribute='createVolumePermission',
        SnapshotId='snap-066877671789bd71b',
    )
    
    print(response)

  
  Expected Output:
  ::

    {
        'CreateVolumePermissions': [
        ],
        'SnapshotId': 'snap-066877671789bd71b',
        'ResponseMetadata': {
            '...': '...',
        },
    }

  