Skip to content

LambdaClient.publish_version

rboto-lambda==0.4.0 · Service index · Types

Model summary (excerpt): Creates a version from the current code and configuration of a Lambda Event Function. Use versions to create a snapshot of your function code and configuration that doesn't change. Lambda doesn't publish a version if the function's configuration and code haven't changed since the last version. Use UpdateFunctionCode or UpdateFunctionConfiguration to update the function before publishing a...

Install and imports

python -m pip install "rboto[lambda]==0.4.0"
from rboto import LambdaClient
from rboto_lambda.types import (
    FunctionVersionLatestPublished,
    PublishVersionOutput,
)

Signature

async def publish_version(
    *,
    function_name: str,
    code_sha256: str | None = None,
    description: str | None = None,
    revision_id: str | None = None,
    publish_to: FunctionVersionLatestPublished | None = None,
) -> PublishVersionOutput: ...

Arguments without defaults are required. None omits an optional request argument. Static types do not validate resource existence, permissions, lengths, ranges, or conditional service requirements.

Arguments

Argument Required Model notes (excerpt)
function_name Yes The name or ARN of the Lambda function. Name formats Function name - MyFunction . Function ARN - arn:aws:lambda:us-west-2:123456789012:function:MyFunction . Partial ARN - 123456789012:function:MyFunction . The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.
code_sha256 No Only publish a version if the hash value matches the value that's specified. Use this option to avoid publishing a version if the function code has changed since you last updated it. You can get the hash for the version that you uploaded from the output of UpdateFunctionCode .
description No A description for the version to override the description in the function configuration.
revision_id No Only update the function if the revision ID matches the ID that's specified. Use this option to avoid publishing a version if the function configuration has changed since you last updated it.
publish_to No Specifies where to publish the function version or configuration.

Output

PublishVersionOutput.

Read-only native attributes, accessed as response.field. Collection getters materialize Python values; to_dict() recursively materializes a mapping. Streams are consumed once.

Field Type Presence References
function_name str | None Always present —
function_arn str | None Always present —
runtime RuntimeOutput | None Always present RuntimeOutput
role str | None Always present —
handler str | None Always present —
code_size int Always present —
description str | None Always present —
timeout int | None Always present —
memory_size int | None Always present —
last_modified str | None Always present —
code_sha256 str | None Always present —
version str | None Always present —
vpc_config VpcConfigResponseOutput | None Always present VpcConfigResponseOutput
dead_letter_config DeadLetterConfigOutput | None Always present DeadLetterConfigOutput
environment EnvironmentResponseOutput | None Always present EnvironmentResponseOutput
kms_key_arn str | None Always present —
tracing_config TracingConfigResponseOutput | None Always present TracingConfigResponseOutput
master_arn str | None Always present —
revision_id str | None Always present —
layers list[LayerOutput] | None Always present LayerOutput
state StateOutput | None Always present StateOutput
state_reason str | None Always present —
state_reason_code StateReasonCodeOutput | None Always present StateReasonCodeOutput
last_update_status LastUpdateStatusOutput | None Always present LastUpdateStatusOutput
last_update_status_reason str | None Always present —
last_update_status_reason_code LastUpdateStatusReasonCodeOutput | None Always present LastUpdateStatusReasonCodeOutput
file_system_configs list[FileSystemConfigOutput] | None Always present FileSystemConfigOutput
signing_profile_version_arn str | None Always present —
signing_job_arn str | None Always present —
package_type PackageTypeOutput | None Always present PackageTypeOutput
image_config_response ImageConfigResponseOutput | None Always present ImageConfigResponseOutput
architectures list[ArchitectureOutput] | None Always present ArchitectureOutput
ephemeral_storage EphemeralStorageOutput | None Always present EphemeralStorageOutput
snap_start SnapStartResponseOutput | None Always present SnapStartResponseOutput
runtime_version_config RuntimeVersionConfigOutput | None Always present RuntimeVersionConfigOutput
logging_config LoggingConfigOutput | None Always present LoggingConfigOutput
tenancy_config TenancyConfigOutput | None Always present TenancyConfigOutput
capacity_provider_config CapacityProviderConfigOutput | None Always present CapacityProviderConfigOutput
config_sha256 str | None Always present —
durable_config DurableConfigOutput | None Always present DurableConfigOutput
runtime_config FunctionRuntimeConfigOutput | None Always present FunctionRuntimeConfigOutput
accelerator_config AcceleratorConfigOutput | None Always present AcceleratorConfigOutput

| None means a value can be absent. Output mappings include every declared key; optional input keys may be omitted. Unknown output enum/union variants are not automatically valid inputs.

FunctionVersionLatestPublished, PublishVersionOutput

Follow these links for nested inputs and outputs; recursive types link back to the same type page.

Pagination and streaming

No generated paginator for this operation.

No output stream.

Errors

Import from rboto_lambda.exceptions:

CodeStorageExceededError, FunctionVersionsPerCapacityProviderLimitExceededError, InvalidParameterValueError, PreconditionFailedError, ResourceConflictError, ResourceNotFoundError, ServiceError, TooManyRequestsError.

Other service failures use the service base error; credential, transport and timeout failures use shared errors.

Service guide · Pinned model