:doc:`IoT <../../iot>` / Client / list_attached_policies

**********************
list_attached_policies
**********************



.. py:method:: IoT.Client.list_attached_policies(**kwargs)

  

  Lists the policies attached to the specified thing group.

   

  Requires permission to access the `ListAttachedPolicies <https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions>`__ action.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListAttachedPolicies>`_  


  **Request Syntax**
  ::

    response = client.list_attached_policies(
        target='string',
        recursive=True|False,
        marker='string',
        pageSize=123
    )
    
  :type target: string
  :param target: **[REQUIRED]** 

    The group or principal for which the policies will be listed. Valid principals are CertificateArn (arn:aws:iot:*region*:*accountId*:cert/*certificateId*), thingGroupArn (arn:aws:iot:*region*:*accountId*:thinggroup/*groupName*) and CognitoId (*region*:*id*).

    

  
  :type recursive: boolean
  :param recursive: 

    When true, recursively list attached policies.

    

  
  :type marker: string
  :param marker: 

    The token to retrieve the next set of results.

    

  
  :type pageSize: integer
  :param pageSize: 

    The maximum number of results to be returned per request.

    

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

    
    ::

      {
          'policies': [
              {
                  'policyName': 'string',
                  'policyArn': 'string'
              },
          ],
          'nextMarker': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **policies** *(list) --* 

        The policies.

        
        

        - *(dict) --* 

          Describes an IoT policy.

          
          

          - **policyName** *(string) --* 

            The policy name.

            
          

          - **policyArn** *(string) --* 

            The policy ARN.

            
      
    
      

      - **nextMarker** *(string) --* 

        The token to retrieve the next set of results, or ``null`` if there are no more results.

        
  
  **Exceptions**
  
  *   :py:class:`IoT.Client.exceptions.ResourceNotFoundException`

  
  *   :py:class:`IoT.Client.exceptions.InvalidRequestException`

  
  *   :py:class:`IoT.Client.exceptions.ThrottlingException`

  
  *   :py:class:`IoT.Client.exceptions.UnauthorizedException`

  
  *   :py:class:`IoT.Client.exceptions.ServiceUnavailableException`

  
  *   :py:class:`IoT.Client.exceptions.InternalFailureException`

  
  *   :py:class:`IoT.Client.exceptions.LimitExceededException`

  