LambdaClient.update_function_code
rboto-lambda==0.4.0 · Service index · Types
Model summary (excerpt): Updates a Lambda Event Function's code. If code signing is enabled for the function, the code package must be signed by a trusted publisher. For more information, see Configuring code signing for Lambda . If the function's package type is Image , then you must specify the code package in ImageUri as the URI of a container image in the Amazon ECR registry. If the function's package type is Zip...
Install and imports
from rboto import LambdaClient
from collections.abc import Sequence
from rboto_lambda.types import (
Architecture,
FunctionVersionLatestPublished,
S3ObjectStorageMode,
UpdateFunctionCodeOutput,
)
Signature
async def update_function_code(
*,
function_name: str,
zip_file: bytes | None = None,
s3_bucket: str | None = None,
s3_key: str | None = None,
s3_object_version: str | None = None,
s3_object_storage_mode: S3ObjectStorageMode | None = None,
image_uri: str | None = None,
architectures: Sequence[Architecture] | None = None,
publish: bool | None = None,
publish_to: FunctionVersionLatestPublished | None = None,
dry_run: bool | None = None,
revision_id: str | None = None,
source_kms_key_arn: str | None = None,
) -> UpdateFunctionCodeOutput: ...
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 – my-function . Function ARN – arn:aws:lambda:us-west-2:123456789012:function:my-function . Partial ARN – 123456789012:function:my-function . The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length. |
zip_file |
No | The base64-encoded contents of the deployment package. Amazon Web Services SDK and CLI clients handle the encoding for you. Use only with a function defined with a .zip file archive deployment package. |
s3_bucket |
No | An Amazon S3 bucket in the same Amazon Web Services Region as your function. The bucket can be in a different Amazon Web Services account. Use only with a function defined with a .zip file archive deployment package. |
s3_key |
No | The Amazon S3 key of the deployment package. Use only with a function defined with a .zip file archive deployment package. |
s3_object_version |
No | For versioned objects, the version of the deployment package object to use. |
s3_object_storage_mode |
No | Specifies how the deployment package is stored. Valid values: COPY (default) – Uploads a copy of your deployment package to Lambda. REFERENCE – Lambda references the deployment package from the specified Amazon S3 bucket. |
image_uri |
No | URI of a container image in the Amazon ECR registry. Do not use for a function defined with a .zip file archive. |
architectures |
No | The instruction set architecture that the function supports. Enter a string array with one of the valid values (arm64 or x86_64). The default value is x86_64 . |
publish |
No | Set to true to publish a new version of the function after updating the code. This has the same effect as calling PublishVersion separately. |
publish_to |
No | Specifies where to publish the function version or configuration. |
dry_run |
No | Set to true to validate the request parameters and access permissions without modifying the function code. |
revision_id |
No | Update the function only if the revision ID matches the ID that's specified. Use this option to avoid modifying a function that has changed since you last read it. |
source_kms_key_arn |
No | The ARN of the Key Management Service (KMS) customer managed key that's used to encrypt your function's .zip deployment package. If you don't provide a customer managed key, Lambda uses an Amazon Web Services managed key. |
Output
UpdateFunctionCodeOutput.
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.
Related types
Architecture, FunctionVersionLatestPublished, S3ObjectStorageMode, UpdateFunctionCodeOutput
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:
CodeSigningConfigNotFoundError, CodeStorageExceededError, CodeVerificationFailedError, InvalidCodeSignatureError, InvalidParameterValueError, PreconditionFailedError, ResourceConflictError, ResourceNotFoundError, ServiceError, TooManyRequestsError.
Other service failures use the service base error; credential, transport and timeout failures use shared errors.