publish_layer_version
¶
publish_layer_version(
layer_name: LayerName,
content: LayerVersionContentInput,
*,
config_overrides: Optional[LambdaClientConfig] = 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.
>>> 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/_lambda.py
6503 6504 6505 6506 6507 6508 6509 6510 6511 6512 6513 6514 6515 6516 6517 6518 6519 6520 6521 6522 6523 6524 6525 6526 6527 6528 6529 6530 6531 6532 6533 6534 6535 6536 6537 6538 6539 6540 6541 6542 6543 6544 6545 6546 6547 6548 6549 6550 6551 6552 6553 6554 6555 6556 6557 6558 6559 6560 6561 6562 6563 6564 6565 6566 6567 6568 6569 6570 6571 6572 6573 6574 6575 6576 6577 6578 6579 6580 6581 6582 6583 6584 6585 6586 6587 6588 6589 | |