All Products
Search
Document Center

Function Compute:UpdateFunctionInput

Last Updated:Jan 12, 2026

Parameter

Type

Description

Example

object

The request parameters for updating a function.

code InputCodeLocation

The ZIP package of the function code. You must specify either code or customContainerConfig.

cpu

number

The CPU specification of the function. Unit: vCPU. The value must be a multiple of 0.05 vCPU.

1

customContainerConfig CustomContainerConfig

The configuration for the custom container runtime. After you configure this parameter, the function can use a custom container image to run. You must specify either code or customContainerConfig.

customDNS CustomDNS

The custom DNS configuration.

customRuntimeConfig CustomRuntimeConfig

The custom runtime configuration.

description

string

The description of the function.

my function

diskSize

integer

The disk size of the function. Unit: MB. Valid values: 512 MB and 10240 MB.

512

environmentVariables

object

The environment variables of the function. You can access these environment variables in the runtime environment.

string

value1

gpuConfig GPUConfig

The GPU configuration of the function.

handler

string

The entry point for the function execution. The format varies based on the runtime.

index.handler

instanceConcurrency

integer

The maximum concurrency of the instance.

1

instanceLifecycleConfig InstanceLifecycleConfig

The configuration of the instance lifecycle hook.

internetAccess

boolean

Specifies whether to allow the function to access the public network.

true

layers

array

The list of layers. Multiple layers are merged in descending order of their array index. The content of a layer with a smaller index overwrites files with the same name in layers with a larger index.

string

The ARN of the layer.

acs:fc:cn-beijing:186824xxxxxx:layers/fc_layer/versions/1

logConfig LogConfig

The log configuration. The logs generated by the function are written to the specified Logstore.

memorySize

integer

The memory size of the function. Unit: MB. The value must be a multiple of 64 MB. The memory size varies for different function instance types.

512

nasConfig NASConfig

The NAS configuration. After you configure this parameter, the function can access the specified NAS resources.

ossMountConfig OSSMountConfig

The OSS mount configuration.

role

string

The RAM role that grants Function Compute the required permissions. Scenarios include the following: 1. Sending logs generated by the function to your Logstore. 2. Generating temporary access tokens for the function to access other cloud resources during execution.

acs:ram::188077086902****:role/fc-test

runtime

string

The runtime environment of the function.

nodejs14

timeout

integer

The timeout period for the function to run. Unit: seconds. The minimum value is 1 second. The default value is 3 seconds. The function execution is stopped if it runs longer than this period.

60

tracingConfig TracingConfig

The Tracing Analysis configuration. After you integrate Function Compute with Tracing Analysis, you can record the time consumed by requests in Function Compute, view the cold start time of functions, and record the time consumed by internal function operations.

vpcConfig VPCConfig

The VPC configuration. After you configure this parameter, the function can access the specified VPC resources.

disableOndemand

boolean

Specifies whether to disable the creation of on-demand instances. If you enable this feature, on-demand instances are not created. Only provisioned instances can be used.

sessionAffinity

string

The affinity policy for Function Compute invocation requests. To implement request affinity for the MCP SSE protocol, set this parameter to MCP_SSE. To use cookie-based affinity, set this parameter to GENERATED_COOKIE. To use header-based affinity, set this parameter to HEADER_FIELD. If you do not set this parameter or set it to NONE, no affinity is used, and requests are routed based on the default scheduling policy of Function Compute.

MCP_SSE

enableLongLiving

boolean

Specifies whether to allow provisioned instances of GPU-accelerated functions to be long-living. If you enable this feature, the created function instances are not injected with STS tokens.

instanceIsolationMode

string

The instance isolation mode.

sessionAffinityConfig

string

When you set the sessionAffinity type, you must set the related affinity configuration. For MCP_SSE affinity, fill in the MCPSSESessionAffinityConfig configuration. For cookie-based affinity, fill in the CookieSessionAffinityConfig configuration. For header field-based affinity, fill in the HeaderFieldSessionAffinityConfig configuration.

{\"sseEndpointPath\":\"/sse\", \"sessionConcurrencyPerInstance\":20}