:doc:`CloudFront <../../cloudfront>` / Client / get_key_group

*************
get_key_group
*************



.. py:method:: CloudFront.Client.get_key_group(**kwargs)

  

  Gets a key group, including the date and time when the key group was last modified.

   

  To get a key group, you must provide the key group's identifier. If the key group is referenced in a distribution's cache behavior, you can get the key group's identifier using ``ListDistributions`` or ``GetDistribution``. If the key group is not referenced in a cache behavior, you can get the identifier using ``ListKeyGroups``.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2020-05-31/GetKeyGroup>`_  


  **Request Syntax**
  ::

    response = client.get_key_group(
        Id='string'
    )
    
  :type Id: string
  :param Id: **[REQUIRED]** 

    The identifier of the key group that you are getting. To get the identifier, use ``ListKeyGroups``.

    

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

    
    ::

      {
          'KeyGroup': {
              'Id': 'string',
              'LastModifiedTime': datetime(2015, 1, 1),
              'KeyGroupConfig': {
                  'Name': 'string',
                  'Items': [
                      'string',
                  ],
                  'Comment': 'string'
              }
          },
          'ETag': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **KeyGroup** *(dict) --* 

        The key group.

        
        

        - **Id** *(string) --* 

          The identifier for the key group.

          
        

        - **LastModifiedTime** *(datetime) --* 

          The date and time when the key group was last modified.

          
        

        - **KeyGroupConfig** *(dict) --* 

          The key group configuration.

          
          

          - **Name** *(string) --* 

            A name to identify the key group.

            
          

          - **Items** *(list) --* 

            A list of the identifiers of the public keys in the key group.

            
            

            - *(string) --* 
        
          

          - **Comment** *(string) --* 

            A comment to describe the key group. The comment cannot be longer than 128 characters.

            
      
    
      

      - **ETag** *(string) --* 

        The identifier for this version of the key group.

        
  
  **Exceptions**
  
  *   :py:class:`CloudFront.Client.exceptions.NoSuchResource`

  