:doc:`Lambda <../../lambda>` / Client / list_layers

***********
list_layers
***********



.. py:method:: Lambda.Client.list_layers(**kwargs)

  

  Lists `Lambda layers <https://docs.aws.amazon.com/lambda/latest/dg/invocation-layers.html>`__ and shows information about the latest version of each. Specify a `runtime identifier <https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html>`__ to list only layers that indicate that they're compatible with that runtime. Specify a compatible architecture to include only layers that are compatible with that `instruction set architecture <https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html>`__.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/ListLayers>`_  


  **Request Syntax**
  ::

    response = client.list_layers(
        CompatibleRuntime='nodejs'|'nodejs4.3'|'nodejs6.10'|'nodejs8.10'|'nodejs10.x'|'nodejs12.x'|'nodejs14.x'|'nodejs16.x'|'java8'|'java8.al2'|'java11'|'python2.7'|'python3.6'|'python3.7'|'python3.8'|'python3.9'|'dotnetcore1.0'|'dotnetcore2.0'|'dotnetcore2.1'|'dotnetcore3.1'|'dotnet6'|'dotnet8'|'nodejs4.3-edge'|'go1.x'|'ruby2.5'|'ruby2.7'|'provided'|'provided.al2'|'nodejs18.x'|'python3.10'|'java17'|'ruby3.2'|'ruby3.3'|'ruby3.4'|'python3.11'|'nodejs20.x'|'provided.al2023'|'python3.12'|'java21'|'python3.13'|'nodejs22.x'|'nodejs24.x'|'python3.14'|'java25'|'dotnet10',
        Marker='string',
        MaxItems=123,
        CompatibleArchitecture='x86_64'|'arm64'
    )
    
  :type CompatibleRuntime: string
  :param CompatibleRuntime: 

    A runtime identifier.

     

    The following list includes deprecated runtimes. For more information, see `Runtime use after deprecation <https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtime-deprecation-levels>`__.

     

    For a list of all currently supported runtimes, see `Supported runtimes <https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtimes-supported>`__.

    

  
  :type Marker: string
  :param Marker: 

    A pagination token returned by a previous call.

    

  
  :type MaxItems: integer
  :param MaxItems: 

    The maximum number of layers to return.

    

  
  :type CompatibleArchitecture: string
  :param CompatibleArchitecture: 

    The compatible `instruction set architecture <https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html>`__.

    

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

    
    ::

      {
          'NextMarker': 'string',
          'Layers': [
              {
                  'LayerName': 'string',
                  'LayerArn': 'string',
                  'LatestMatchingVersion': {
                      'LayerVersionArn': 'string',
                      'Version': 123,
                      'Description': 'string',
                      'CreatedDate': 'string',
                      'CompatibleRuntimes': [
                          'nodejs'|'nodejs4.3'|'nodejs6.10'|'nodejs8.10'|'nodejs10.x'|'nodejs12.x'|'nodejs14.x'|'nodejs16.x'|'java8'|'java8.al2'|'java11'|'python2.7'|'python3.6'|'python3.7'|'python3.8'|'python3.9'|'dotnetcore1.0'|'dotnetcore2.0'|'dotnetcore2.1'|'dotnetcore3.1'|'dotnet6'|'dotnet8'|'nodejs4.3-edge'|'go1.x'|'ruby2.5'|'ruby2.7'|'provided'|'provided.al2'|'nodejs18.x'|'python3.10'|'java17'|'ruby3.2'|'ruby3.3'|'ruby3.4'|'python3.11'|'nodejs20.x'|'provided.al2023'|'python3.12'|'java21'|'python3.13'|'nodejs22.x'|'nodejs24.x'|'python3.14'|'java25'|'dotnet10',
                      ],
                      'LicenseInfo': 'string',
                      'CompatibleArchitectures': [
                          'x86_64'|'arm64',
                      ]
                  }
              },
          ]
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **NextMarker** *(string) --* 

        A pagination token returned when the response doesn't contain all layers.

        
      

      - **Layers** *(list) --* 

        A list of function layers.

        
        

        - *(dict) --* 

          Details about an `Lambda layer <https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html>`__.

          
          

          - **LayerName** *(string) --* 

            The name of the layer.

            
          

          - **LayerArn** *(string) --* 

            The Amazon Resource Name (ARN) of the function layer.

            
          

          - **LatestMatchingVersion** *(dict) --* 

            The newest version of the layer.

            
            

            - **LayerVersionArn** *(string) --* 

              The ARN of the layer version.

              
            

            - **Version** *(integer) --* 

              The version number.

              
            

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

              The description of the version.

              
            

            - **CreatedDate** *(string) --* 

              The date that the version was created, in ISO 8601 format. For example, ``2018-11-27T15:10:45.123+0000``.

              
            

            - **CompatibleRuntimes** *(list) --* 

              The layer's compatible runtimes.

               

              The following list includes deprecated runtimes. For more information, see `Runtime use after deprecation <https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtime-deprecation-levels>`__.

               

              For a list of all currently supported runtimes, see `Supported runtimes <https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtimes-supported>`__.

              
              

              - *(string) --* 
          
            

            - **LicenseInfo** *(string) --* 

              The layer's open-source license.

              
            

            - **CompatibleArchitectures** *(list) --* 

              A list of compatible `instruction set architectures <https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html>`__.

              
              

              - *(string) --* 
          
        
      
    
  
  **Exceptions**
  
  *   :py:class:`Lambda.Client.exceptions.InvalidParameterValueException`

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

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

  

  **Examples**

  The following example returns information about layers that are compatible with the Python 3.7 runtime.
  ::

    response = client.list_layers(
        CompatibleRuntime='python3.7',
    )
    
    print(response)

  
  Expected Output:
  ::

    {
        'Layers': [
            {
                'LatestMatchingVersion': {
                    'CompatibleRuntimes': [
                        'python3.6',
                        'python3.7',
                    ],
                    'CreatedDate': '2018-11-15T00:37:46.592+0000',
                    'Description': 'My layer',
                    'LayerVersionArn': 'arn:aws:lambda:us-east-2:123456789012:layer:my-layer:2',
                    'Version': 2,
                },
                'LayerArn': 'arn:aws:lambda:us-east-2:123456789012:layer:my-layer',
                'LayerName': 'my-layer',
            },
        ],
        'ResponseMetadata': {
            '...': '...',
        },
    }

  