Lambda / Client / delete_layer_version

delete_layer_version#

Lambda.Client.delete_layer_version(**kwargs)#

Deletes a version of an Lambda layer. Deleted versions can no longer be viewed or added to functions. To avoid breaking functions, a copy of the version remains in Lambda until no functions refer to it.

See also: AWS API Documentation

Request Syntax

response = client.delete_layer_version(
    LayerName='string',
    VersionNumber=123
)
Parameters:
  • LayerName (string) –

    [REQUIRED]

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

  • VersionNumber (integer) –

    [REQUIRED]

    The version number.

Returns:

None

Exceptions

  • Lambda.Client.exceptions.ServiceException

  • Lambda.Client.exceptions.TooManyRequestsException

Examples

The following example deletes version 2 of a layer named my-layer.

response = client.delete_layer_version(
    LayerName='my-layer',
    VersionNumber=2,
)

print(response)

Expected Output:

{
    'ResponseMetadata': {
        '...': '...',
    },
}