list_layer_versions

Lambda.Client.list_layer_versions(**kwargs)

Lists the versions of an Lambda layer. Versions that have been deleted aren't listed. Specify a runtime identifier to list only versions that indicate that they're compatible with that runtime. Specify a compatible architecture to include only layer versions that are compatible with that architecture.

See also: AWS API Documentation

Request Syntax

response = client.list_layer_versions(
    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'|'nodejs4.3-edge'|'go1.x'|'ruby2.5'|'ruby2.7'|'provided'|'provided.al2'|'nodejs18.x',
    LayerName='string',
    Marker='string',
    MaxItems=123,
    CompatibleArchitecture='x86_64'|'arm64'
)
Parameters
  • CompatibleRuntime (string) -- A runtime identifier. For example, go1.x .
  • LayerName (string) --

    [REQUIRED]

    The name or Amazon Resource Name (ARN) of the layer.

  • Marker (string) -- A pagination token returned by a previous call.
  • MaxItems (integer) -- The maximum number of versions to return.
  • CompatibleArchitecture (string) -- The compatible instruction set architecture.
Return type

dict

Returns

Response Syntax

{
    'NextMarker': 'string',
    'LayerVersions': [
        {
            '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'|'nodejs4.3-edge'|'go1.x'|'ruby2.5'|'ruby2.7'|'provided'|'provided.al2'|'nodejs18.x',
            ],
            'LicenseInfo': 'string',
            'CompatibleArchitectures': [
                'x86_64'|'arm64',
            ]
        },
    ]
}

Response Structure

  • (dict) --

    • NextMarker (string) --

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

    • LayerVersions (list) --

      A list of versions.

      • (dict) --

        Details about a version of an Lambda 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.

          • (string) --
        • LicenseInfo (string) --

          The layer's open-source license.

        • CompatibleArchitectures (list) --

          A list of compatible instruction set architectures.

          • (string) --

Exceptions

  • Lambda.Client.exceptions.ServiceException
  • Lambda.Client.exceptions.InvalidParameterValueException
  • Lambda.Client.exceptions.ResourceNotFoundException
  • Lambda.Client.exceptions.TooManyRequestsException

Examples

The following example displays information about the versions for the layer named blank-java-lib

response = client.list_layer_versions(
    LayerName='blank-java-lib',
)

print(response)

Expected Output:

{
    'LayerVersions': [
        {
            'CompatibleRuntimes': [
                'java8',
            ],
            'CreatedDate': '2020-03-18T23:38:42.284+0000',
            'Description': 'Dependencies for the blank-java sample app.',
            'LayerVersionArn': 'arn:aws:lambda:us-east-2:123456789012:layer:blank-java-lib:7',
            'Version': 7,
        },
        {
            'CompatibleRuntimes': [
                'java8',
            ],
            'CreatedDate': '2020-03-17T07:24:21.960+0000',
            'Description': 'Dependencies for the blank-java sample app.',
            'LayerVersionArn': 'arn:aws:lambda:us-east-2:123456789012:layer:blank-java-lib:6',
            'Version': 6,
        },
    ],
    'ResponseMetadata': {
        '...': '...',
    },
}