Function

Updated at:

Parameter

Type

Description

Example

object

The function configuration.

codeChecksum

string

The CRC-64 checksum of the function code package.

2825179536350****

codeSize

integer

The size of the function code package, in bytes.

412

cpu

number

The CPU specification for the function, in vCPUs. The value must be a multiple of 0.05 vCPU, with a minimum of 0.05 and a maximum of 16. The ratio of cpu to memorySize (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. If this parameter is configured, the function uses a custom container image. You must specify either code or customContainerConfig.

customDNS CustomDNS

The custom DNS configuration.

customRuntimeConfig CustomRuntimeConfig

The configuration for the custom runtime.

description

string

The description of the function.

my function

diskSize

integer

The disk size for the function, in MB. Valid values are 512 and 10240.

512

environmentVariables

object

The environment variables for the function. You can access these variables from the runtime.

string

The value of the environment variable.

value1

functionArn

string

The Alibaba Cloud Resource Name (ARN) of the function.

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

functionId

string

The globally unique, system-generated ID for the function.

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

functionName

string

The name of the function.

my-function-1

gpuConfig GPUConfig

The GPU configuration for the function.

handler

string

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

index.handler

instanceConcurrency

integer

The maximum number of concurrent requests a single function instance can process.

1

instanceLifecycleConfig InstanceLifecycleConfig

The instance lifecycle callback configuration.

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. Valid values: Successful, Failed, and InProgress.

InProgress

lastUpdateStatusReason

string

The reason for the current status of the last update operation.

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

lastUpdateStatusReasonCode

string

The reason code for the last update status.

ImageOptimizing

layers

array

A list of layers to apply to the function's execution environment.

FunctionLayer

The details of a layer.

logConfig LogConfig

The log configuration. Function logs are written to the specified Logstore.

memorySize

integer

The memory size for the function, in MB. The value must be a multiple of 64 and range from 128 to 32,768 (32 GB). The ratio of cpu to memorySize (in GB) must be between 1:1 and 1:4.

512

nasConfig NASConfig

The NAS configuration. This allows the function to access the specified NAS resources.

ossMountConfig OSSMountConfig

The Object Storage Service (OSS) mount configuration.

role

string

The RAM role that you grant to Function Compute. Function Compute assumes this role to generate temporary access credentials, which the function can then use to access other Alibaba Cloud services such as OSS and Tablestore.

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

runtime

string

The runtime for the function. Valid values: 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 for the function's current state.

Function creating

stateReasonCode

string

The reason code for the function's current state.

Creating

timeout

integer

The function execution timeout, in seconds. Default value: 3. Valid values: 1 to 86400. Function executions that exceed this timeout are terminated.

60

tracingConfig TracingConfig

The tracing configuration. Integrating Function Compute with a tracing service enables you to record request latency, view the cold start time of a function, and record the time spent inside the function.

vpcConfig VPCConfig

The VPC configuration. This allows the function to access resources in the specified VPC.

tags

array

A list of tags.

Tag

The details of a tag.

disableOndemand

boolean

Specifies whether to disable the creation of on-demand instances. If this parameter is set to true, no on-demand instances are created, and the function can only use reserved instances.

invocationRestriction

FunctionRestriction

The invocation restriction for the function.

sessionAffinity

string

The session affinity policy for Function Compute invocation requests. To implement session affinity for the MCP SSE protocol, set this parameter to MCP_SSE. For cookie-based affinity, set the value to GENERATED_COOKIE. For header-based affinity, set the value to HEADER_FIELD. If this parameter is not specified or is set to NONE, Function Compute does not apply session affinity and routes requests based on its default scheduling policy.

MCP_SSE

enableLongLiving

boolean

Specifies whether to enable long-lived sessions. This parameter is required when you use session affinity.

resourceGroupId

string

The ID of the resource group.

instanceIsolationMode

string

The isolation mode of the function instance.

sessionAffinityConfig

string

When you specify a sessionAffinity type, you must provide the corresponding affinity configuration. For MCP_SSE affinity, configure MCPSSESessionAffinityConfig. For cookie-based affinity, configure CookieSessionAffinityConfig. For header-based affinity, configure HeaderFieldSessionAffinityConfig.

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

idleTimeout

integer

The time, in seconds, an idle instance is kept alive before it is released.

100

disableInjectCredentials

string

Specifies whether to disable the injection of STS tokens. Valid values: None (tokens are injected), Env (tokens are not injected into environment variables), Request (tokens are not injected into the request context or headers), and All (all token injection is disabled).

Env

polarFsConfig PolarFsConfig

The PolarFS configuration. This allows the function to access the specified PolarFS resources.

lockInfo FunctionLockInfo

Information about the function lock.

{"lockedBy":"AgentRun","lockedAt":"2025-04-05T10:00:00Z","lockedResources":["function","trigger","version","alias"]}

juiceFsConfig JuiceFsConfig

The JuiceFS configuration.