:doc:`ElastiCache <../../elasticache>` / Client / describe_cache_security_groups

******************************
describe_cache_security_groups
******************************



.. py:method:: ElastiCache.Client.describe_cache_security_groups(**kwargs)

  

  Returns a list of cache security group descriptions. If a cache security group name is specified, the list contains only the description of that group. This applicable only when you have ElastiCache in Classic setup

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DescribeCacheSecurityGroups>`_  


  **Request Syntax**
  ::

    response = client.describe_cache_security_groups(
        CacheSecurityGroupName='string',
        MaxRecords=123,
        Marker='string'
    )
    
  :type CacheSecurityGroupName: string
  :param CacheSecurityGroupName: 

    The name of the cache security group to return details for.

    

  
  :type MaxRecords: integer
  :param MaxRecords: 

    The maximum number of records to include in the response. If more records exist than the specified ``MaxRecords`` value, a marker is included in the response so that the remaining results can be retrieved.

     

    Default: 100

     

    Constraints: minimum 20; maximum 100.

    

  
  :type Marker: string
  :param Marker: 

    An optional marker returned from a prior request. Use this marker for pagination of results from this operation. If this parameter is specified, the response includes only records beyond the marker, up to the value specified by ``MaxRecords``.

    

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

    
    ::

      {
          'Marker': 'string',
          'CacheSecurityGroups': [
              {
                  'OwnerId': 'string',
                  'CacheSecurityGroupName': 'string',
                  'Description': 'string',
                  'EC2SecurityGroups': [
                      {
                          'Status': 'string',
                          'EC2SecurityGroupName': 'string',
                          'EC2SecurityGroupOwnerId': 'string'
                      },
                  ],
                  'ARN': 'string'
              },
          ]
      }
      
    **Response Structure**

    

    - *(dict) --* 

      Represents the output of a ``DescribeCacheSecurityGroups`` operation.

      
      

      - **Marker** *(string) --* 

        Provides an identifier to allow retrieval of paginated results.

        
      

      - **CacheSecurityGroups** *(list) --* 

        A list of cache security groups. Each element in the list contains detailed information about one group.

        
        

        - *(dict) --* 

          Represents the output of one of the following operations:

           

          
          * ``AuthorizeCacheSecurityGroupIngress``
           
          * ``CreateCacheSecurityGroup``
           
          * ``RevokeCacheSecurityGroupIngress``
          

          
          

          - **OwnerId** *(string) --* 

            The Amazon account ID of the cache security group owner.

            
          

          - **CacheSecurityGroupName** *(string) --* 

            The name of the cache security group.

            
          

          - **Description** *(string) --* 

            The description of the cache security group.

            
          

          - **EC2SecurityGroups** *(list) --* 

            A list of Amazon EC2 security groups that are associated with this cache security group.

            
            

            - *(dict) --* 

              Provides ownership and status information for an Amazon EC2 security group.

              
              

              - **Status** *(string) --* 

                The status of the Amazon EC2 security group.

                
              

              - **EC2SecurityGroupName** *(string) --* 

                The name of the Amazon EC2 security group.

                
              

              - **EC2SecurityGroupOwnerId** *(string) --* 

                The Amazon account ID of the Amazon EC2 security group owner.

                
          
        
          

          - **ARN** *(string) --* 

            The ARN of the cache security group,

            
      
    
  
  **Exceptions**
  
  *   :py:class:`ElastiCache.Client.exceptions.CacheSecurityGroupNotFoundFault`

  
  *   :py:class:`ElastiCache.Client.exceptions.InvalidParameterValueException`

  
  *   :py:class:`ElastiCache.Client.exceptions.InvalidParameterCombinationException`

  

  **Examples**

  Returns a list of cache security group descriptions. If a cache security group name is specified, the list contains only the description of that group.
  ::

    response = client.describe_cache_security_groups(
        CacheSecurityGroupName='my-sec-group',
    )
    
    print(response)

  
  Expected Output:
  ::

    {
        'ResponseMetadata': {
            '...': '...',
        },
    }

  