FunctionProps
Properties for defining a Function.
See https://www.alibabacloud.com/help/ros/developer-reference/aliyun-fc-function
Initializer
import { FunctionProps } from '@alicloud/ros-cdk-fc'
const functionProps: FunctionProps = { ... }
Properties
| Name | Type | Description |
|---|---|---|
functionName |
string | @alicloud/ros-cdk-core.IResolvable |
Property functionName: Function name. |
handler |
string | @alicloud/ros-cdk-core.IResolvable |
Property handler: The function execution entry point. |
runtime |
string | @alicloud/ros-cdk-core.IResolvable |
Property runtime: The function runtime environment. |
serviceName |
string | @alicloud/ros-cdk-core.IResolvable |
Property serviceName: Service name. |
asyncConfiguration |
@alicloud/ros-cdk-core.IResolvable | AsyncConfigurationProperty |
Property asyncConfiguration: Configuration of asynchronous function calls. |
caPort |
number | @alicloud/ros-cdk-core.IResolvable |
Property caPort: Custom runtime and custom container runtime dedicated fields, which represent the port that the started custom http server listens to. |
code |
@alicloud/ros-cdk-core.IResolvable | CodeProperty |
Property code: The code that contains the function implementation. |
cpu |
number | @alicloud/ros-cdk-core.IResolvable |
Property cpu: The number of vCPUs of the function. |
customContainerConfig |
@alicloud/ros-cdk-core.IResolvable | CustomContainerConfigProperty |
Property customContainerConfig: Custom container runtime related configuration. |
customDns |
@alicloud/ros-cdk-core.IResolvable | CustomDNSProperty |
Property customDns: The custom DNS configurations of the function. |
customHealthCheckConfig |
@alicloud/ros-cdk-core.IResolvable | CustomHealthCheckConfigProperty |
Property customHealthCheckConfig: The health check configurations for the custom runtime and custom container. |
customRuntimeConfig |
@alicloud/ros-cdk-core.IResolvable | CustomRuntimeConfigProperty |
Property customRuntimeConfig: Custom runtime related configuration. |
description |
string | @alicloud/ros-cdk-core.IResolvable |
Property description: Function description. |
diskSize |
number | @alicloud/ros-cdk-core.IResolvable |
Property diskSize: The disk size of the function. |
environmentVariables |
@alicloud/ros-cdk-core.IResolvable | {[ key: string ]: any} |
Property environmentVariables: The environment variable set for the function, you can get the value of the environment variable in the function. |
gpuMemorySize |
number | @alicloud/ros-cdk-core.IResolvable |
Property gpuMemorySize: The GPU memory capacity for the function. |
initializationTimeout |
number | @alicloud/ros-cdk-core.IResolvable |
Property initializationTimeout: the max execution time of the initializer, in second. |
initializer |
string | @alicloud/ros-cdk-core.IResolvable |
Property initializer: the entry point of the initializer. |
instanceConcurrency |
number | @alicloud/ros-cdk-core.IResolvable |
Property instanceConcurrency: Function instance concurrency. |
instanceLifecycleConfig |
@alicloud/ros-cdk-core.IResolvable | InstanceLifecycleConfigProperty |
Property instanceLifecycleConfig: The configuration of the instance lifecycle function. |
instanceSoftConcurrency |
number | @alicloud/ros-cdk-core.IResolvable |
Property instanceSoftConcurrency: The soft concurrency of the instance. |
instanceType |
string | @alicloud/ros-cdk-core.IResolvable |
Property instanceType: Instance type. |
memorySize |
number | @alicloud/ros-cdk-core.IResolvable |
Property memorySize: The amount of memory that’s used to run function, in MB. |
timeout |
number | @alicloud/ros-cdk-core.IResolvable |
Property timeout: The maximum time duration a function can run, in seconds. |
functionNameRequired
public readonly functionName: string | IResolvable;
- Type: string | @alicloud/ros-cdk-core.IResolvable
Property functionName: Function name.
handlerRequired
public readonly handler: string | IResolvable;
- Type: string | @alicloud/ros-cdk-core.IResolvable
Property handler: The function execution entry point.
runtimeRequired
public readonly runtime: string | IResolvable;
- Type: string | @alicloud/ros-cdk-core.IResolvable
Property runtime: The function runtime environment.
Supporting nodejs16、nodejs14、nodejs12、nodejs10、nodejs8、nodejs6、nodejs4.4、python3.10、python3.9、python3、python2.7、java11、java8、go1、php7.2、dotnetcore3.1、dotnetcore2.1、custom.debian10、custom和custom-container and so on
serviceNameRequired
public readonly serviceName: string | IResolvable;
- Type: string | @alicloud/ros-cdk-core.IResolvable
Property serviceName: Service name.
asyncConfigurationOptional
public readonly asyncConfiguration: IResolvable | AsyncConfigurationProperty;
- Type: @alicloud/ros-cdk-core.IResolvable | AsyncConfigurationProperty
Property asyncConfiguration: Configuration of asynchronous function calls.
caPortOptional
public readonly caPort: number | IResolvable;
- Type: number | @alicloud/ros-cdk-core.IResolvable
Property caPort: Custom runtime and custom container runtime dedicated fields, which represent the port that the started custom http server listens to.
The default value is 9000
codeOptional
public readonly code: IResolvable | CodeProperty;
- Type: @alicloud/ros-cdk-core.IResolvable | CodeProperty
Property code: The code that contains the function implementation.
cpuOptional
public readonly cpu: number | IResolvable;
- Type: number | @alicloud/ros-cdk-core.IResolvable
Property cpu: The number of vCPUs of the function.
The value must be a multiple of 0.05.
customContainerConfigOptional
public readonly customContainerConfig: IResolvable | CustomContainerConfigProperty;
- Type: @alicloud/ros-cdk-core.IResolvable | CustomContainerConfigProperty
Property customContainerConfig: Custom container runtime related configuration.
After configuration, the function can be replaced with a custom container to execute the function
customDnsOptional
public readonly customDns: IResolvable | CustomDNSProperty;
- Type: @alicloud/ros-cdk-core.IResolvable | CustomDNSProperty
Property customDns: The custom DNS configurations of the function.
customHealthCheckConfigOptional
public readonly customHealthCheckConfig: IResolvable | CustomHealthCheckConfigProperty;
- Type: @alicloud/ros-cdk-core.IResolvable | CustomHealthCheckConfigProperty
Property customHealthCheckConfig: The health check configurations for the custom runtime and custom container.
customRuntimeConfigOptional
public readonly customRuntimeConfig: IResolvable | CustomRuntimeConfigProperty;
- Type: @alicloud/ros-cdk-core.IResolvable | CustomRuntimeConfigProperty
Property customRuntimeConfig: Custom runtime related configuration.
descriptionOptional
public readonly description: string | IResolvable;
- Type: string | @alicloud/ros-cdk-core.IResolvable
Property description: Function description.
diskSizeOptional
public readonly diskSize: number | IResolvable;
- Type: number | @alicloud/ros-cdk-core.IResolvable
Property diskSize: The disk size of the function.
Unit: MB. Valid values: 512 and 10240.
environmentVariablesOptional
public readonly environmentVariables: IResolvable | {[ key: string ]: any};
- Type: @alicloud/ros-cdk-core.IResolvable | {[ key: string ]: any}
Property environmentVariables: The environment variable set for the function, you can get the value of the environment variable in the function.
gpuMemorySizeOptional
public readonly gpuMemorySize: number | IResolvable;
- Type: number | @alicloud/ros-cdk-core.IResolvable
Property gpuMemorySize: The GPU memory capacity for the function.
Unit: MB. The value must be a multiple of 1,024.
initializationTimeoutOptional
public readonly initializationTimeout: number | IResolvable;
- Type: number | @alicloud/ros-cdk-core.IResolvable
Property initializationTimeout: the max execution time of the initializer, in second.
initializerOptional
public readonly initializer: string | IResolvable;
- Type: string | @alicloud/ros-cdk-core.IResolvable
Property initializer: the entry point of the initializer.
instanceConcurrencyOptional
public readonly instanceConcurrency: number | IResolvable;
- Type: number | @alicloud/ros-cdk-core.IResolvable
Property instanceConcurrency: Function instance concurrency.
Value can be between 1 to 100.
instanceLifecycleConfigOptional
public readonly instanceLifecycleConfig: IResolvable | InstanceLifecycleConfigProperty;
- Type: @alicloud/ros-cdk-core.IResolvable | InstanceLifecycleConfigProperty
Property instanceLifecycleConfig: The configuration of the instance lifecycle function.
instanceSoftConcurrencyOptional
public readonly instanceSoftConcurrency: number | IResolvable;
- Type: number | @alicloud/ros-cdk-core.IResolvable
Property instanceSoftConcurrency: The soft concurrency of the instance.
You can use this parameter to implement graceful scale-up of instances. If the number of concurrent requests on an instance is greater than the value of soft concurrency, an instance scale-up is triggered. For example, if your instance requires a long time to start, you can specify a suitable soft concurrency to start the instance in advance.The value must be less than or equal to that of the instanceConcurrency parameter.
instanceTypeOptional
public readonly instanceType: string | IResolvable;
- Type: string | @alicloud/ros-cdk-core.IResolvable
Property instanceType: Instance type.
Value:e1: flexible instance. Memory size between 128 and 3072c1: performance instance. Memory size allow values are 4096, 8192, 16384 and 32768
memorySizeOptional
public readonly memorySize: number | IResolvable;
- Type: number | @alicloud/ros-cdk-core.IResolvable
Property memorySize: The amount of memory that’s used to run function, in MB.
Function Compute uses this value to allocate CPU resources proportionally. Defaults to 128 MB. It can be multiple of 64 MB and between 128 MB and 3072 MB.
timeoutOptional
public readonly timeout: number | IResolvable;
- Type: number | @alicloud/ros-cdk-core.IResolvable
Property timeout: The maximum time duration a function can run, in seconds.
After which Function Compute terminates the execution. Defaults to 3 seconds, and can be between 1 to 86400 seconds.