Skip to content

FunctionProps

Properties for defining a Function.

See https://www.alibabacloud.com/help/ros/developer-reference/aliyun-fc-function

Initializer

import "github.com/alibabacloud-go/ros-cdk/alicloudroscdkfc"
&alicloudroscdkfc.FunctionProps {
    FunctionName: interface{},
    Handler: interface{},
    Runtime: interface{},
    ServiceName: interface{},
    AsyncConfiguration: interface{},
    CaPort: interface{},
    Code: interface{},
    Cpu: interface{},
    CustomContainerConfig: interface{},
    CustomDns: interface{},
    CustomHealthCheckConfig: interface{},
    CustomRuntimeConfig: interface{},
    Description: interface{},
    DiskSize: interface{},
    EnvironmentVariables: interface{},
    GpuMemorySize: interface{},
    InitializationTimeout: interface{},
    Initializer: interface{},
    InstanceConcurrency: interface{},
    InstanceLifecycleConfig: interface{},
    InstanceSoftConcurrency: interface{},
    InstanceType: interface{},
    MemorySize: interface{},
    Timeout: interface{},
}

Properties

Name Type Description
FunctionName interface{} Property functionName: Function name.
Handler interface{} Property handler: The function execution entry point.
Runtime interface{} Property runtime: The function runtime environment.
ServiceName interface{} Property serviceName: Service name.
AsyncConfiguration interface{} Property asyncConfiguration: Configuration of asynchronous function calls.
CaPort interface{} Property caPort: Custom runtime and custom container runtime dedicated fields, which represent the port that the started custom http server listens to.
Code interface{} Property code: The code that contains the function implementation.
Cpu interface{} Property cpu: The number of vCPUs of the function.
CustomContainerConfig interface{} Property customContainerConfig: Custom container runtime related configuration.
CustomDns interface{} Property customDns: The custom DNS configurations of the function.
CustomHealthCheckConfig interface{} Property customHealthCheckConfig: The health check configurations for the custom runtime and custom container.
CustomRuntimeConfig interface{} Property customRuntimeConfig: Custom runtime related configuration.
Description interface{} Property description: Function description.
DiskSize interface{} Property diskSize: The disk size of the function.
EnvironmentVariables interface{} Property environmentVariables: The environment variable set for the function, you can get the value of the environment variable in the function.
GpuMemorySize interface{} Property gpuMemorySize: The GPU memory capacity for the function.
InitializationTimeout interface{} Property initializationTimeout: the max execution time of the initializer, in second.
Initializer interface{} Property initializer: the entry point of the initializer.
InstanceConcurrency interface{} Property instanceConcurrency: Function instance concurrency.
InstanceLifecycleConfig interface{} Property instanceLifecycleConfig: The configuration of the instance lifecycle function.
InstanceSoftConcurrency interface{} Property instanceSoftConcurrency: The soft concurrency of the instance.
InstanceType interface{} Property instanceType: Instance type.
MemorySize interface{} Property memorySize: The amount of memory that’s used to run function, in MB.
Timeout interface{} Property timeout: The maximum time duration a function can run, in seconds.

FunctionNameRequired

FunctionName interface{}
  • Type: interface{}

Property functionName: Function name.


HandlerRequired

Handler interface{}
  • Type: interface{}

Property handler: The function execution entry point.


RuntimeRequired

Runtime interface{}
  • Type: interface{}

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

ServiceName interface{}
  • Type: interface{}

Property serviceName: Service name.


AsyncConfigurationOptional

AsyncConfiguration interface{}
  • Type: interface{}

Property asyncConfiguration: Configuration of asynchronous function calls.


CaPortOptional

CaPort interface{}
  • Type: interface{}

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

Code interface{}
  • Type: interface{}

Property code: The code that contains the function implementation.


CpuOptional

Cpu interface{}
  • Type: interface{}

Property cpu: The number of vCPUs of the function.

The value must be a multiple of 0.05.


CustomContainerConfigOptional

CustomContainerConfig interface{}
  • Type: interface{}

Property customContainerConfig: Custom container runtime related configuration.

After configuration, the function can be replaced with a custom container to execute the function


CustomDnsOptional

CustomDns interface{}
  • Type: interface{}

Property customDns: The custom DNS configurations of the function.


CustomHealthCheckConfigOptional

CustomHealthCheckConfig interface{}
  • Type: interface{}

Property customHealthCheckConfig: The health check configurations for the custom runtime and custom container.


CustomRuntimeConfigOptional

CustomRuntimeConfig interface{}
  • Type: interface{}

Property customRuntimeConfig: Custom runtime related configuration.


DescriptionOptional

Description interface{}
  • Type: interface{}

Property description: Function description.


DiskSizeOptional

DiskSize interface{}
  • Type: interface{}

Property diskSize: The disk size of the function.

Unit: MB. Valid values: 512 and 10240.


EnvironmentVariablesOptional

EnvironmentVariables interface{}
  • Type: interface{}

Property environmentVariables: The environment variable set for the function, you can get the value of the environment variable in the function.


GpuMemorySizeOptional

GpuMemorySize interface{}
  • Type: interface{}

Property gpuMemorySize: The GPU memory capacity for the function.

Unit: MB. The value must be a multiple of 1,024.


InitializationTimeoutOptional

InitializationTimeout interface{}
  • Type: interface{}

Property initializationTimeout: the max execution time of the initializer, in second.


InitializerOptional

Initializer interface{}
  • Type: interface{}

Property initializer: the entry point of the initializer.


InstanceConcurrencyOptional

InstanceConcurrency interface{}
  • Type: interface{}

Property instanceConcurrency: Function instance concurrency.

Value can be between 1 to 100.


InstanceLifecycleConfigOptional

InstanceLifecycleConfig interface{}
  • Type: interface{}

Property instanceLifecycleConfig: The configuration of the instance lifecycle function.


InstanceSoftConcurrencyOptional

InstanceSoftConcurrency interface{}
  • Type: interface{}

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

InstanceType interface{}
  • Type: interface{}

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

MemorySize interface{}
  • Type: interface{}

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

Timeout interface{}
  • Type: interface{}

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.