:doc:`Organizations <../../organizations>` / Client / describe_policy

***************
describe_policy
***************



.. py:method:: Organizations.Client.describe_policy(**kwargs)

  

  Retrieves information about a policy.

   

  You can only call this operation from the management account or a member account that is a delegated administrator.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/DescribePolicy>`_  


  **Request Syntax**
  ::

    response = client.describe_policy(
        PolicyId='string'
    )
    
  :type PolicyId: string
  :param PolicyId: **[REQUIRED]** 

    ID for the policy that you want details about. You can get the ID from the  ListPolicies or  ListPoliciesForTarget operations.

     

    The `regex pattern <http://wikipedia.org/wiki/regex>`__ for a policy ID string requires "p-" followed by from 8 to 128 lowercase or uppercase letters, digits, or the underscore character (_).

    

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

    
    ::

      {
          'Policy': {
              'PolicySummary': {
                  'Id': 'string',
                  'Arn': 'string',
                  'Name': 'string',
                  'Description': 'string',
                  'Type': 'SERVICE_CONTROL_POLICY'|'RESOURCE_CONTROL_POLICY'|'TAG_POLICY'|'BACKUP_POLICY'|'AISERVICES_OPT_OUT_POLICY'|'CHATBOT_POLICY'|'DECLARATIVE_POLICY_EC2'|'SECURITYHUB_POLICY'|'INSPECTOR_POLICY'|'UPGRADE_ROLLOUT_POLICY'|'BEDROCK_POLICY'|'S3_POLICY'|'NETWORK_SECURITY_DIRECTOR_POLICY',
                  'AwsManaged': True|False
              },
              'Content': 'string'
          }
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **Policy** *(dict) --* 

        A structure that contains details about the specified policy.

        
        

        - **PolicySummary** *(dict) --* 

          A structure that contains additional details about the policy.

          
          

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

            The unique identifier (ID) of the policy.

             

            The `regex pattern <http://wikipedia.org/wiki/regex>`__ for a policy ID string requires "p-" followed by from 8 to 128 lowercase or uppercase letters, digits, or the underscore character (_).

            
          

          - **Arn** *(string) --* 

            The Amazon Resource Name (ARN) of the policy.

             

            For more information about ARNs in Organizations, see `ARN Formats Supported by Organizations <https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsorganizations.html#awsorganizations-resources-for-iam-policies>`__ in the *Amazon Web Services Service Authorization Reference*.

            
          

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

            The friendly name of the policy.

             

            The `regex pattern <http://wikipedia.org/wiki/regex>`__ that is used to validate this parameter is a string of any of the characters in the ASCII character range.

            
          

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

            The description of the policy.

            
          

          - **Type** *(string) --* 

            The type of policy.

            
          

          - **AwsManaged** *(boolean) --* 

            A boolean value that indicates whether the specified policy is an Amazon Web Services managed policy. If true, then you can attach the policy to roots, OUs, or accounts, but you cannot edit it.

            
      
        

        - **Content** *(string) --* 

          The text content of the policy.

          
    
  
  **Exceptions**
  
  *   :py:class:`Organizations.Client.exceptions.AccessDeniedException`

  
  *   :py:class:`Organizations.Client.exceptions.AWSOrganizationsNotInUseException`

  
  *   :py:class:`Organizations.Client.exceptions.InvalidInputException`

  
  *   :py:class:`Organizations.Client.exceptions.PolicyNotFoundException`

  
  *   :py:class:`Organizations.Client.exceptions.ServiceException`

  
  *   :py:class:`Organizations.Client.exceptions.TooManyRequestsException`

  
  *   :py:class:`Organizations.Client.exceptions.UnsupportedAPIEndpointException`

  

  **Examples**

  The following example shows how to request information about a policy:/n/n
  ::

    response = client.describe_policy(
        PolicyId='p-examplepolicyid111',
    )
    
    print(response)

  
  Expected Output:
  ::

    {
        'Policy': {
            'Content': '{\n  \"Version\": \"2012-10-17\",\n  \"Statement\": [\n    {\n      \"Effect\": \"Allow\",\n      \"Action\": \"*\",\n      \"Resource\": \"*\"\n    }\n  ]\n}',
            'PolicySummary': {
                'Arn': 'arn:aws:organizations::111111111111:policy/o-exampleorgid/service_control_policy/p-examplepolicyid111',
                'AwsManaged': False,
                'Description': 'Enables admins to delegate S3 permissions',
                'Id': 'p-examplepolicyid111',
                'Name': 'AllowAllS3Actions',
                'Type': 'SERVICE_CONTROL_POLICY',
            },
        },
        'ResponseMetadata': {
            '...': '...',
        },
    }

  