publish_layer_version
async
¶
publish_layer_version(
layer_name: LayerName,
content: LayerVersionContentInput,
*,
config_overrides: Optional[AsyncLambdaClientConfig] = None,
description: Optional[Description] = None,
compatible_architectures: Optional[CompatibleArchitectures] = None,
compatible_runtimes: Optional[CompatibleRuntimes] = None,
license_info: Optional[LicenseInfo] = None,
) -> PublishLayerVersionResponse
Creates an Lambda layer from a ZIP archive. Each time you call PublishLayerVersion with the same layer name, a new version is created.
Add layers to your function with CreateFunction or UpdateFunctionConfiguration.
Parameters:
-
layer_name(LayerName) –The name or Amazon Resource Name (ARN) of the layer.
-
description(Optional[Description], default:None) –The description of the version.
-
content(LayerVersionContentInput) –The function layer archive.
-
compatible_architectures(Optional[CompatibleArchitectures], default:None) –A list of compatible instruction set architectures.
-
compatible_runtimes(Optional[CompatibleRuntimes], default:None) –A list of compatible function runtimes. Used for filtering with ListLayers and ListLayerVersions.
The following list includes deprecated runtimes. For more information, see Runtime deprecation policy.
-
license_info(Optional[LicenseInfo], default:None) –The layer's software license. It can be any of the following:
-
An SPDX license identifier. For example,
MIT. -
The URL of a license hosted on the internet. For example,
https://opensource.org/licenses/MIT. -
The full text of the license.
-
Raises:
-
CodeStorageExceededException–Your Amazon Web Services account has exceeded its maximum total code size. For more information, see Lambda quotas.
-
InvalidParameterValueException–One of the parameters in the request is not valid.
-
ResourceNotFoundException–The resource specified in the request does not exist.
-
ServiceException–The Lambda service encountered an internal error.
-
TooManyRequestsException–The request throughput limit was exceeded. For more information, see Lambda quotas.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
To create a Lambda layer version The following example creates a new Python library layer version. The command retrieves the layer content a file named layer.zip in the specified S3 bucket.
>>> await client.publish_layer_version(compatible_runtimes=['python3.6', 'python3.7'], content={'S3Bucket': 'lambda-layers-us-west-2-123456789012', 'S3Key': 'layer.zip'}, description='My Python layer', layer_name='my-layer', license_info='MIT')
Source code in docs_src/capo_lambda/_services/async__lambda.py
6589 6590 6591 6592 6593 6594 6595 6596 6597 6598 6599 6600 6601 6602 6603 6604 6605 6606 6607 6608 6609 6610 6611 6612 6613 6614 6615 6616 6617 6618 6619 6620 6621 6622 6623 6624 6625 6626 6627 6628 6629 6630 6631 6632 6633 6634 6635 6636 6637 6638 6639 6640 6641 6642 6643 6644 6645 6646 6647 6648 6649 6650 6651 6652 6653 6654 6655 6656 6657 6658 6659 6660 6661 6662 6663 6664 6665 6666 6667 6668 6669 6670 6671 6672 6673 6674 6675 6676 | |