update_function_configuration¶
Operation¶
update_function_configuration
¶
update_function_configuration(request: UpdateFunctionConfigurationInput | UpdateFunctionConfigurationInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[UpdateFunctionConfigurationInputDict]) -> UpdateFunctionConfigurationOutput
Modifies the version-specific settings of a Lambda Event Function.
When you update a function, Lambda provisions an instance of the
function and its supporting resources. If your function connects to a
VPC, this process can take a minute. During this time, you can't modify
the function, but you can still invoke it. The LastUpdateStatus,
LastUpdateStatusReason, and LastUpdateStatusReasonCode fields in the
response from GetFunctionConfiguration indicate when the update is
complete and the function is processing events with the new
configuration. For more information, see Lambda function
states.
These settings can vary between versions of a function and are locked when you publish a version. You can't modify the configuration of a published version, only the unpublished version.
To configure function concurrency, use PutFunctionConcurrency. To grant invoke permissions to an Amazon Web Services account or Amazon Web Services service, use AddPermission.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
UpdateFunctionConfigurationInput | UpdateFunctionConfigurationInputDict | None
|
The input as a model or dictionary. Pass this or keyword arguments, not both. |
None
|
plugins
|
list[Plugin] | None
|
A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations. |
None
|
**kwargs
|
Unpack[UpdateFunctionConfigurationInputDict]
|
The input fields as keyword arguments. |
{}
|
Returns:
| Type | Description |
|---|---|
UpdateFunctionConfigurationOutput
|
An instance of |
update_function_configuration
async
¶
update_function_configuration(request: UpdateFunctionConfigurationInput | UpdateFunctionConfigurationInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[UpdateFunctionConfigurationInputDict]) -> UpdateFunctionConfigurationOutput
Modifies the version-specific settings of a Lambda Event Function.
When you update a function, Lambda provisions an instance of the
function and its supporting resources. If your function connects to a
VPC, this process can take a minute. During this time, you can't modify
the function, but you can still invoke it. The LastUpdateStatus,
LastUpdateStatusReason, and LastUpdateStatusReasonCode fields in the
response from GetFunctionConfiguration indicate when the update is
complete and the function is processing events with the new
configuration. For more information, see Lambda function
states.
These settings can vary between versions of a function and are locked when you publish a version. You can't modify the configuration of a published version, only the unpublished version.
To configure function concurrency, use PutFunctionConcurrency. To grant invoke permissions to an Amazon Web Services account or Amazon Web Services service, use AddPermission.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
UpdateFunctionConfigurationInput | UpdateFunctionConfigurationInputDict | None
|
The input as a model or dictionary. Pass this or keyword arguments, not both. |
None
|
plugins
|
list[Plugin] | None
|
A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations. |
None
|
**kwargs
|
Unpack[UpdateFunctionConfigurationInputDict]
|
The input fields as keyword arguments. |
{}
|
Returns:
| Type | Description |
|---|---|
UpdateFunctionConfigurationOutput
|
An instance of |
Input¶
Pass the input as keyword arguments, a positional dictionary, or a positional model object. Pass plugins separately as a keyword argument.
UpdateFunctionConfigurationInputDict
¶
Bases: TypedDict
Dictionary form of UpdateFunctionConfigurationInput.
Attributes¶
capacity_provider_config
instance-attribute
¶
capacity_provider_config: CapacityProviderConfig | CapacityProviderConfigDict | None
Configuration for the capacity provider that manages compute resources for Lambda functions.
dead_letter_config
instance-attribute
¶
dead_letter_config: DeadLetterConfig | DeadLetterConfigDict | None
A dead-letter queue configuration that specifies the queue or topic where Lambda sends asynchronous events when they fail processing. For more information, see Dead-letter queues.
durable_config
instance-attribute
¶
durable_config: DurableConfig | DurableConfigDict | None
Configuration settings for durable functions, including execution timeout, retention period for execution history, and an optional ARN of the Key Management Service (KMS) customer managed key that is used to encrypt your durable execution's payload data, including input, output, and error payloads.
environment
instance-attribute
¶
environment: Environment | EnvironmentDict | None
Environment variables that are accessible from function code during execution.
ephemeral_storage
instance-attribute
¶
ephemeral_storage: EphemeralStorage | EphemeralStorageDict | None
The size of the function's /tmp directory in MB. The default value is
512, but can be any whole number between 512 and 10,240 MB. For more
information, see Configuring ephemeral storage
(console).
file_system_configs
instance-attribute
¶
file_system_configs: Sequence[FileSystemConfig | FileSystemConfigDict] | None
Connection settings for an Amazon EFS file system or an Amazon S3 Files file system.
function_name
instance-attribute
¶
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.
handler
instance-attribute
¶
handler: str | None
The name of the method within your code that Lambda calls to run your function. Handler is required if the deployment package is a .zip file archive. The format includes the file name. It can also include namespaces and other qualifiers, depending on the runtime. For more information, see Lambda programming model.
image_config
instance-attribute
¶
image_config: ImageConfig | ImageConfigDict | None
Container image configuration values that override the values in the container image Docker file.
kms_key_arn
instance-attribute
¶
kms_key_arn: str | None
The ARN of the Key Management Service (KMS) customer managed key that's used to encrypt the following resources:
-
The function's environment variables.
-
The function's Lambda SnapStart snapshots.
-
When used with
SourceKMSKeyArn, the unzipped version of the .zip deployment package that's used for function invocations. For more information, see Specifying a customer managed key for Lambda. -
The optimized version of the container image that's used for function invocations. Note that this is not the same key that's used to protect your container image in the Amazon Elastic Container Registry (Amazon ECR). For more information, see Function lifecycle.
If you don't provide a customer managed key, Lambda uses an Amazon Web Services owned key or an Amazon Web Services managed key.
layers
instance-attribute
¶
A list of function layers to add to the function's execution environment. Specify each layer by its ARN, including the version.
logging_config
instance-attribute
¶
logging_config: LoggingConfig | LoggingConfigDict | None
The function's Amazon CloudWatch Logs configuration settings.
memory_size
instance-attribute
¶
memory_size: int | None
The amount of memory available to the function at runtime. Increasing the function memory also increases its CPU allocation. The default value is 128 MB. The value can be any multiple of 1 MB.
revision_id
instance-attribute
¶
revision_id: str | None
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.
role
instance-attribute
¶
role: str | None
The Amazon Resource Name (ARN) of the function's execution role.
runtime
instance-attribute
¶
runtime: str | None
The identifier of the function's runtime. Runtime is required if the deployment package is a .zip file archive. Specifying a runtime results in an error if you're deploying a function using a container image.
The following list includes deprecated runtimes. Lambda blocks creating new functions and updating existing functions shortly after each runtime is deprecated. For more information, see Runtime use after deprecation.
For a list of all currently supported runtimes, see Supported runtimes.
runtime_config
instance-attribute
¶
runtime_config: FunctionRuntimeConfig | FunctionRuntimeConfigDict | None
The customer-managed runtime configuration for your function. Specifies the customer-managed runtime and the runtime alias that your function uses.
snap_start
instance-attribute
¶
snap_start: SnapStart | SnapStartDict | None
The function's SnapStart setting.
timeout
instance-attribute
¶
timeout: int | None
The amount of time (in seconds) that Lambda allows a function to run before stopping it. The default is 3 seconds, and the maximum allowed value is 900 seconds. For functions using Lambda Managed Instances, asynchronous invocations and event source mapping invocations (except Amazon MQ and Amazon DocumentDB) support a maximum allowed value of 5,400 seconds (90 minutes). For more information, see Lambda execution environment.
tracing_config
instance-attribute
¶
tracing_config: TracingConfig | TracingConfigDict | None
Set Mode to Active to sample and trace a subset of incoming requests
with
X-Ray.
vpc_config
instance-attribute
¶
vpc_config: VpcConfig | VpcConfigDict | None
For network connectivity to Amazon Web Services resources in a VPC, specify a list of security groups and subnets in the VPC. When you connect a function to a VPC, it can access resources and the internet only through that VPC. For more information, see Configuring a Lambda function to access resources in a VPC.
UpdateFunctionConfigurationInput
dataclass
¶
Bases: _SerdeShape
Dataclass for UpdateFunctionConfigurationInput structure.
Attributes¶
capacity_provider_config
class-attribute
instance-attribute
¶
capacity_provider_config: CapacityProviderConfig | None = ...
Configuration for the capacity provider that manages compute resources for Lambda functions.
dead_letter_config
class-attribute
instance-attribute
¶
dead_letter_config: DeadLetterConfig | None = ...
A dead-letter queue configuration that specifies the queue or topic where Lambda sends asynchronous events when they fail processing. For more information, see Dead-letter queues.
description
class-attribute
instance-attribute
¶
description: str | None = ...
A description of the function.
durable_config
class-attribute
instance-attribute
¶
durable_config: DurableConfig | None = ...
Configuration settings for durable functions, including execution timeout, retention period for execution history, and an optional ARN of the Key Management Service (KMS) customer managed key that is used to encrypt your durable execution's payload data, including input, output, and error payloads.
environment
class-attribute
instance-attribute
¶
environment: Environment | None = ...
Environment variables that are accessible from function code during execution.
ephemeral_storage
class-attribute
instance-attribute
¶
ephemeral_storage: EphemeralStorage | None = ...
The size of the function's /tmp directory in MB. The default value is
512, but can be any whole number between 512 and 10,240 MB. For more
information, see Configuring ephemeral storage
(console).
file_system_configs
class-attribute
instance-attribute
¶
file_system_configs: list[FileSystemConfig] | None = ...
Connection settings for an Amazon EFS file system or an Amazon S3 Files file system.
function_name
class-attribute
instance-attribute
¶
function_name: str | None = ...
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.
handler
class-attribute
instance-attribute
¶
handler: str | None = ...
The name of the method within your code that Lambda calls to run your function. Handler is required if the deployment package is a .zip file archive. The format includes the file name. It can also include namespaces and other qualifiers, depending on the runtime. For more information, see Lambda programming model.
image_config
class-attribute
instance-attribute
¶
image_config: ImageConfig | None = ...
Container image configuration values that override the values in the container image Docker file.
kms_key_arn
class-attribute
instance-attribute
¶
kms_key_arn: str | None = ...
The ARN of the Key Management Service (KMS) customer managed key that's used to encrypt the following resources:
-
The function's environment variables.
-
The function's Lambda SnapStart snapshots.
-
When used with
SourceKMSKeyArn, the unzipped version of the .zip deployment package that's used for function invocations. For more information, see Specifying a customer managed key for Lambda. -
The optimized version of the container image that's used for function invocations. Note that this is not the same key that's used to protect your container image in the Amazon Elastic Container Registry (Amazon ECR). For more information, see Function lifecycle.
If you don't provide a customer managed key, Lambda uses an Amazon Web Services owned key or an Amazon Web Services managed key.
layers
class-attribute
instance-attribute
¶
A list of function layers to add to the function's execution environment. Specify each layer by its ARN, including the version.
logging_config
class-attribute
instance-attribute
¶
logging_config: LoggingConfig | None = ...
The function's Amazon CloudWatch Logs configuration settings.
memory_size
class-attribute
instance-attribute
¶
memory_size: int | None = ...
The amount of memory available to the function at runtime. Increasing the function memory also increases its CPU allocation. The default value is 128 MB. The value can be any multiple of 1 MB.
revision_id
class-attribute
instance-attribute
¶
revision_id: str | None = ...
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.
role
class-attribute
instance-attribute
¶
role: str | None = ...
The Amazon Resource Name (ARN) of the function's execution role.
runtime
class-attribute
instance-attribute
¶
runtime: str | None = ...
The identifier of the function's runtime. Runtime is required if the deployment package is a .zip file archive. Specifying a runtime results in an error if you're deploying a function using a container image.
The following list includes deprecated runtimes. Lambda blocks creating new functions and updating existing functions shortly after each runtime is deprecated. For more information, see Runtime use after deprecation.
For a list of all currently supported runtimes, see Supported runtimes.
runtime_config
class-attribute
instance-attribute
¶
runtime_config: FunctionRuntimeConfig | None = ...
The customer-managed runtime configuration for your function. Specifies the customer-managed runtime and the runtime alias that your function uses.
snap_start
class-attribute
instance-attribute
¶
snap_start: SnapStart | None = ...
The function's SnapStart setting.
timeout
class-attribute
instance-attribute
¶
timeout: int | None = ...
The amount of time (in seconds) that Lambda allows a function to run before stopping it. The default is 3 seconds, and the maximum allowed value is 900 seconds. For functions using Lambda Managed Instances, asynchronous invocations and event source mapping invocations (except Amazon MQ and Amazon DocumentDB) support a maximum allowed value of 5,400 seconds (90 minutes). For more information, see Lambda execution environment.
tracing_config
class-attribute
instance-attribute
¶
tracing_config: TracingConfig | None = ...
Set Mode to Active to sample and trace a subset of incoming requests
with
X-Ray.
vpc_config
class-attribute
instance-attribute
¶
vpc_config: VpcConfig | None = ...
For network connectivity to Amazon Web Services resources in a VPC, specify a list of security groups and subnets in the VPC. When you connect a function to a VPC, it can access resources and the internet only through that VPC. For more information, see Configuring a Lambda function to access resources in a VPC.
Output¶
UpdateFunctionConfigurationOutput
dataclass
¶
Bases: _SerdeShape
Details about a function's configuration.
Attributes¶
architectures
class-attribute
instance-attribute
¶
The instruction set architecture that the function supports.
Architecture is a string array with one of the valid values. The default
architecture value is x86_64.
capacity_provider_config
class-attribute
instance-attribute
¶
capacity_provider_config: CapacityProviderConfig | None = ...
Configuration for the capacity provider that manages compute resources for Lambda functions.
code_sha256
class-attribute
instance-attribute
¶
code_sha256: str | None = ...
The SHA256 hash of the function's deployment package.
code_size
class-attribute
instance-attribute
¶
code_size: int = ...
The size of the function's deployment package, in bytes.
config_sha256
class-attribute
instance-attribute
¶
config_sha256: str | None = ...
The SHA256 hash of the function configuration.
dead_letter_config
class-attribute
instance-attribute
¶
dead_letter_config: DeadLetterConfig | None = ...
The function's dead letter queue.
description
class-attribute
instance-attribute
¶
description: str | None = ...
The function's description.
durable_config
class-attribute
instance-attribute
¶
durable_config: DurableConfig | None = ...
The function's durable execution configuration settings, if the function is configured for durability.
environment
class-attribute
instance-attribute
¶
environment: EnvironmentResponse | None = ...
The function's environment variables. Omitted from CloudTrail logs.
ephemeral_storage
class-attribute
instance-attribute
¶
ephemeral_storage: EphemeralStorage | None = ...
The size of the function's /tmp directory in MB. The default value is
512, but can be any whole number between 512 and 10,240 MB. For more
information, see Configuring ephemeral storage
(console).
file_system_configs
class-attribute
instance-attribute
¶
file_system_configs: list[FileSystemConfig] | None = ...
Connection settings for an Amazon EFS file system or an Amazon S3 file system.
function_arn
class-attribute
instance-attribute
¶
function_arn: str | None = ...
The function's Amazon Resource Name (ARN).
function_name
class-attribute
instance-attribute
¶
function_name: str | None = ...
The name of the function.
handler
class-attribute
instance-attribute
¶
handler: str | None = ...
The function that Lambda calls to begin running your function.
image_config_response
class-attribute
instance-attribute
¶
image_config_response: ImageConfigResponse | None = ...
The function's image configuration values.
kms_key_arn
class-attribute
instance-attribute
¶
kms_key_arn: str | None = ...
The ARN of the Key Management Service (KMS) customer managed key that's used to encrypt the following resources:
-
The function's environment variables.
-
The function's Lambda SnapStart snapshots.
-
When used with
SourceKMSKeyArn, the unzipped version of the .zip deployment package that's used for function invocations. For more information, see Specifying a customer managed key for Lambda. -
The optimized version of the container image that's used for function invocations. Note that this is not the same key that's used to protect your container image in the Amazon Elastic Container Registry (Amazon ECR). For more information, see Function lifecycle.
If you don't provide a customer managed key, Lambda uses an Amazon Web Services owned key or an Amazon Web Services managed key.
last_modified
class-attribute
instance-attribute
¶
last_modified: str | None = ...
The date and time that the function was last updated, in ISO-8601
format (YYYY-MM-DDThhss.sTZD).
last_update_status
class-attribute
instance-attribute
¶
last_update_status: str | None = ...
The status of the last update that was performed on the function. This
is first set to Successful after function creation completes.
last_update_status_reason
class-attribute
instance-attribute
¶
last_update_status_reason: str | None = ...
The reason for the last update that was performed on the function.
last_update_status_reason_code
class-attribute
instance-attribute
¶
last_update_status_reason_code: str | None = ...
The reason code for the last update that was performed on the function.
logging_config
class-attribute
instance-attribute
¶
logging_config: LoggingConfig | None = ...
The function's Amazon CloudWatch Logs configuration settings.
master_arn
class-attribute
instance-attribute
¶
master_arn: str | None = ...
For Lambda@Edge functions, the ARN of the main function.
memory_size
class-attribute
instance-attribute
¶
memory_size: int | None = ...
The amount of memory available to the function at runtime.
package_type
class-attribute
instance-attribute
¶
package_type: str | None = ...
The type of deployment package. Set to Image for container image and
set Zip for .zip file archive.
response_metadata
class-attribute
instance-attribute
¶
Metadata about the response that produced this output. Use this to recover the request identifiers a service's support team needs in order to investigate a call. Members of the metadata are individually optional.
revision_id
class-attribute
instance-attribute
¶
revision_id: str | None = ...
The latest updated revision of the function or alias.
runtime
class-attribute
instance-attribute
¶
runtime: str | None = ...
The identifier of the function's runtime. Runtime is required if the deployment package is a .zip file archive. Specifying a runtime results in an error if you're deploying a function using a container image.
The following list includes deprecated runtimes. Lambda blocks creating new functions and updating existing functions shortly after each runtime is deprecated. For more information, see Runtime use after deprecation.
For a list of all currently supported runtimes, see Supported runtimes.
runtime_config
class-attribute
instance-attribute
¶
runtime_config: FunctionRuntimeConfig | None = ...
The customer-managed runtime configuration for your function. Specifies the customer-managed runtime and the runtime alias that your function uses.
runtime_version_config
class-attribute
instance-attribute
¶
runtime_version_config: RuntimeVersionConfig | None = ...
The ARN of the runtime and any errors that occured.
signing_job_arn
class-attribute
instance-attribute
¶
signing_job_arn: str | None = ...
The ARN of the signing job.
signing_profile_version_arn
class-attribute
instance-attribute
¶
signing_profile_version_arn: str | None = ...
The ARN of the signing profile version.
snap_start
class-attribute
instance-attribute
¶
snap_start: SnapStartResponse | None = ...
Set ApplyOn to PublishedVersions to create a snapshot of the
initialized execution environment when you publish a function version.
For more information, see Improving startup performance with Lambda
SnapStart.
state
class-attribute
instance-attribute
¶
state: str | None = ...
The current state of the function. When the state is Inactive, you can
reactivate the function by invoking it.
state_reason
class-attribute
instance-attribute
¶
state_reason: str | None = ...
The reason for the function's current state.
state_reason_code
class-attribute
instance-attribute
¶
state_reason_code: str | None = ...
The reason code for the function's current state. When the code is
Creating, you can't invoke or modify the function.
tenancy_config
class-attribute
instance-attribute
¶
tenancy_config: TenancyConfig | None = ...
The function's tenant isolation configuration settings. Determines whether the Lambda function runs on a shared or dedicated infrastructure per unique tenant.
timeout
class-attribute
instance-attribute
¶
timeout: int | None = ...
The amount of time in seconds that Lambda allows a function to run before stopping it.
tracing_config
class-attribute
instance-attribute
¶
tracing_config: TracingConfigResponse | None = ...
The function's X-Ray tracing configuration.
version
class-attribute
instance-attribute
¶
version: str | None = ...
The version of the Lambda function.
vpc_config
class-attribute
instance-attribute
¶
vpc_config: VpcConfigResponse | None = ...
The function's networking configuration.