All Products
Search
Document Center

Function Compute:Function

Last Updated:Jan 14, 2026

Parameter

Type

Description

Example

object

The configuration of the function.

codeChecksum

string

The CRC-64 value of the function code package.

2825179536350****

codeSize

integer

The size of the function code package, in bytes.

412

cpu

number

The CPU specification of the function, in vCPUs. The value must be a multiple of 0.05 vCPU. The minimum value is 0.05 and the maximum value is 16. The ratio of CPU to memory size (in GB) must be between 1:1 and 1:4.

1

createdTime

string

The time when the function was created.

2023-04-01T08:15:27Z

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, in MB. Valid values are 512 MB and 10240 MB.

512

environmentVariables

object

The environment variables of the function. The configured environment variables can be accessed in the runtime environment.

string

The value of the environment variable.

value1

functionArn

string

The resource identifier of the function.

acs:fc:cn-shanghai:123:functions/functionName

functionId

string

The globally unique ID that is generated by the system for the function.

aa715851-1c20-4b89-a8fb-***

functionName

string

The name of the function.

my-function-1

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 the function can access the Internet. Default value: true.

true

lastModifiedTime

string

The time when the function was last updated.

2023-05-01T08:15:27Z

lastUpdateStatus

string

The status of the last update operation on the function. When a function is created, the value is `Successful`. Valid values: `Successful`, `Failed`, and `InProgress`.

InProgress

lastUpdateStatusReason

string

The reason for the status of the last update operation on the function.

The system is currently processing the acceleration optimization for the image.

lastUpdateStatusReasonCode

string

The status code for the reason of the last update operation on the function.

ImageOptimizing

layers

array

The list of layers.

FunctionLayer

The layer information.

logConfig LogConfig

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

memorySize

integer

The memory size of the function, in MB. The value must be a multiple of 64 MB. The minimum value is 128 MB and the maximum value is 32 GB. The ratio of CPU to memory size (in GB) must be between 1:1 and 1:4.

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 you grant to Function Compute. After you set this parameter, Function Compute assumes the role to generate temporary access credentials. The function can use the temporary access credentials of the role to access specified Alibaba Cloud services, such as OSS and Tablestore.

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

runtime

string

The runtime environment of the function. The following runtimes are supported: nodejs12, nodejs14, nodejs16, nodejs18, nodejs20, go1, python3, python3.9, python3.10, python3.12, java8, java11, php7.2, dotnetcore3.1, custom, custom.debian10, custom.debian11, custom.debian12, and custom-container.

python3.10

state

string

The current state of the function.

Pending

stateReason

string

The reason why the function is in the current state.

Function creating

stateReasonCode

string

The status code for the reason why the function is in the current state.

Creating

timeout

integer

The timeout period for the function to run, in seconds. The minimum value is 1 second and the maximum value is 86,400 seconds. The default value is 3 seconds. If the function runs longer than this period, the execution is stopped.

60

tracingConfig TracingConfig

The Tracing Analysis configuration. Integrating Function Compute with Tracing Analysis lets you record the time that requests consume in Function Compute, view the cold start time of functions, and record the time consumed within functions.

vpcConfig VPCConfig

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

tags

array

The list of tags.

Tag

The tag information.

disableOndemand

boolean

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

invocationRestriction

FunctionRestriction

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

When you set the `sessionAffinity` type, you must configure the related affinity settings. For `MCP_SSE` affinity, specify the `MCPSSESessionAffinityConfig` settings. For cookie-based affinity, specify the `CookieSessionAffinityConfig` settings. For header field-based affinity, specify the `HeaderFieldSessionAffinityConfig` settings.

resourceGroupId

string

The ID of the resource group.

instanceIsolationMode

string

The isolation mode for the instance.

sessionAffinityConfig

string

When you set the `sessionAffinity` type, you must configure the related affinity settings. For `MCP_SSE` affinity, specify the `MCPSSESessionAffinityConfig` settings. For cookie-based affinity, specify the `CookieSessionAffinityConfig` settings. For header field-based affinity, specify the `HeaderFieldSessionAffinityConfig` settings.

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

idleTimeout

integer

The amount of time that an instance can remain idle before it is released.

100

disableInjectCredentials

string

Specifies whether to prevent the injection of the Security Token Service (STS) token. Valid values are `None`, `Env`, `Request`, and `All`. `None` means the token is injected. `Env` means the token is not injected into environment variables. `Request` means the token is not injected into the request, including the context and header. `All` means the token is not injected.

Env

polarFsConfig PolarFsConfig

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