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

****************
describe_regions
****************



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

  

  Describes the Regions that are enabled for your account, or all Regions.

   

  For a list of the Regions supported by Amazon EC2, see `Amazon EC2 service endpoints <https://docs.aws.amazon.com/ec2/latest/devguide/ec2-endpoints.html>`__.

   

  For information about enabling and disabling Regions for your account, see `Specify which Amazon Web Services Regions your account can use <https://docs.aws.amazon.com/accounts/latest/reference/manage-acct-regions.html>`__ in the *Amazon Web Services Account Management Reference Guide*.

   

  .. note::

    

    The order of the elements in the response, including those within nested structures, might vary. Applications should not assume the elements appear in a particular order.

    

  

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


  **Request Syntax**
  ::

    response = client.describe_regions(
        RegionNames=[
            'string',
        ],
        AllRegions=True|False,
        DryRun=True|False,
        Filters=[
            {
                'Name': 'string',
                'Values': [
                    'string',
                ]
            },
        ]
    )
    
  :type RegionNames: list
  :param RegionNames: 

    The names of the Regions. You can specify any Regions, whether they are enabled and disabled for your account.

    

  
    - *(string) --* 

    

  :type AllRegions: boolean
  :param AllRegions: 

    Indicates whether to display all Regions, including Regions that are disabled for your account.

    

  
  :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``.

    

  
  :type Filters: list
  :param Filters: 

    The filters.

     

    
    * ``endpoint`` - The endpoint of the Region (for example, ``ec2.us-east-1.amazonaws.com``).
     
    * ``opt-in-status`` - The opt-in status of the Region ( ``opt-in-not-required`` | ``opted-in`` | ``not-opted-in``).
     
    * ``region-name`` - The name of the Region (for example, ``us-east-1``).
    

    

  
    - *(dict) --* 

      A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs.

       

      If you specify multiple filters, the filters are joined with an ``AND``, and the request returns only results that match all of the specified filters.

       

      For more information, see `List and filter using the CLI and API <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Filtering.html#Filtering_Resources_CLI>`__ in the *Amazon EC2 User Guide*.

      

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

        The name of the filter. Filter names are case-sensitive.

        

      
      - **Values** *(list) --* 

        The filter values. Filter values are case-sensitive. If you specify multiple values for a filter, the values are joined with an ``OR``, and the request returns all results that match any of the specified values.

        

      
        - *(string) --* 

        
    
    

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

    
    ::

      {
          'Regions': [
              {
                  'OptInStatus': 'string',
                  'Geography': [
                      {
                          'Name': 'string'
                      },
                  ],
                  'RegionName': 'string',
                  'Endpoint': 'string'
              },
          ]
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **Regions** *(list) --* 

        Information about the Regions.

        
        

        - *(dict) --* 

          Describes a Region.

          
          

          - **OptInStatus** *(string) --* 

            The Region opt-in status. The possible values are ``opt-in-not-required``, ``opted-in``, and ``not-opted-in``.

            
          

          - **Geography** *(list) --* 

            The geography information for the Region. The geography is returned as a list.

            
            

            - *(dict) --* 

              Describes the geography information for a Region.

              
              

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

                The name of the geography, for example, ``United States of America``.

                
          
        
          

          - **RegionName** *(string) --* 

            The name of the Region.

            
          

          - **Endpoint** *(string) --* 

            The Region service endpoint.

            
      
    
  

  **Examples**

  This example describes all the regions that are available to you.
  ::

    response = client.describe_regions(
    )
    
    print(response)

  
  Expected Output:
  ::

    {
        'Regions': [
            {
                'Endpoint': 'ec2.ap-south-1.amazonaws.com',
                'RegionName': 'ap-south-1',
            },
            {
                'Endpoint': 'ec2.eu-west-1.amazonaws.com',
                'RegionName': 'eu-west-1',
            },
            {
                'Endpoint': 'ec2.ap-southeast-1.amazonaws.com',
                'RegionName': 'ap-southeast-1',
            },
            {
                'Endpoint': 'ec2.ap-southeast-2.amazonaws.com',
                'RegionName': 'ap-southeast-2',
            },
            {
                'Endpoint': 'ec2.eu-central-1.amazonaws.com',
                'RegionName': 'eu-central-1',
            },
            {
                'Endpoint': 'ec2.ap-northeast-2.amazonaws.com',
                'RegionName': 'ap-northeast-2',
            },
            {
                'Endpoint': 'ec2.ap-northeast-1.amazonaws.com',
                'RegionName': 'ap-northeast-1',
            },
            {
                'Endpoint': 'ec2.us-east-1.amazonaws.com',
                'RegionName': 'us-east-1',
            },
            {
                'Endpoint': 'ec2.sa-east-1.amazonaws.com',
                'RegionName': 'sa-east-1',
            },
            {
                'Endpoint': 'ec2.us-west-1.amazonaws.com',
                'RegionName': 'us-west-1',
            },
            {
                'Endpoint': 'ec2.us-west-2.amazonaws.com',
                'RegionName': 'us-west-2',
            },
        ],
        'ResponseMetadata': {
            '...': '...',
        },
    }

  