Skip to content

FunctionProps

Properties for defining a Function.

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

Initializer

import ros_cdk_fc
ros_cdk_fc.FunctionProps(
  function_name: typing.Union[str, IResolvable],
  handler: typing.Union[str, IResolvable],
  runtime: typing.Union[str, IResolvable],
  service_name: typing.Union[str, IResolvable],
  async_configuration: typing.Union[IResolvable, AsyncConfigurationProperty] = None,
  ca_port: typing.Union[typing.Union[int, float], IResolvable] = None,
  code: typing.Union[IResolvable, CodeProperty] = None,
  cpu: typing.Union[typing.Union[int, float], IResolvable] = None,
  custom_container_config: typing.Union[IResolvable, CustomContainerConfigProperty] = None,
  custom_dns: typing.Union[IResolvable, CustomDNSProperty] = None,
  custom_health_check_config: typing.Union[IResolvable, CustomHealthCheckConfigProperty] = None,
  custom_runtime_config: typing.Union[IResolvable, CustomRuntimeConfigProperty] = None,
  description: typing.Union[str, IResolvable] = None,
  disk_size: typing.Union[typing.Union[int, float], IResolvable] = None,
  environment_variables: typing.Union[IResolvable, typing.Mapping[typing.Any]] = None,
  gpu_memory_size: typing.Union[typing.Union[int, float], IResolvable] = None,
  initialization_timeout: typing.Union[typing.Union[int, float], IResolvable] = None,
  initializer: typing.Union[str, IResolvable] = None,
  instance_concurrency: typing.Union[typing.Union[int, float], IResolvable] = None,
  instance_lifecycle_config: typing.Union[IResolvable, InstanceLifecycleConfigProperty] = None,
  instance_soft_concurrency: typing.Union[typing.Union[int, float], IResolvable] = None,
  instance_type: typing.Union[str, IResolvable] = None,
  memory_size: typing.Union[typing.Union[int, float], IResolvable] = None,
  timeout: typing.Union[typing.Union[int, float], IResolvable] = None
)

Properties

Name Type Description
function_name typing.Union[str, ros_cdk_core.IResolvable] Property functionName: Function name.
handler typing.Union[str, ros_cdk_core.IResolvable] Property handler: The function execution entry point.
runtime typing.Union[str, ros_cdk_core.IResolvable] Property runtime: The function runtime environment.
service_name typing.Union[str, ros_cdk_core.IResolvable] Property serviceName: Service name.
async_configuration typing.Union[ros_cdk_core.IResolvable, AsyncConfigurationProperty] Property asyncConfiguration: Configuration of asynchronous function calls.
ca_port typing.Union[typing.Union[int, float], 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 typing.Union[ros_cdk_core.IResolvable, CodeProperty] Property code: The code that contains the function implementation.
cpu typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] Property cpu: The number of vCPUs of the function.
custom_container_config typing.Union[ros_cdk_core.IResolvable, CustomContainerConfigProperty] Property customContainerConfig: Custom container runtime related configuration.
custom_dns typing.Union[ros_cdk_core.IResolvable, CustomDNSProperty] Property customDns: The custom DNS configurations of the function.
custom_health_check_config typing.Union[ros_cdk_core.IResolvable, CustomHealthCheckConfigProperty] Property customHealthCheckConfig: The health check configurations for the custom runtime and custom container.
custom_runtime_config typing.Union[ros_cdk_core.IResolvable, CustomRuntimeConfigProperty] Property customRuntimeConfig: Custom runtime related configuration.
description typing.Union[str, ros_cdk_core.IResolvable] Property description: Function description.
disk_size typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] Property diskSize: The disk size of the function.
environment_variables typing.Union[ros_cdk_core.IResolvable, typing.Mapping[typing.Any]] Property environmentVariables: The environment variable set for the function, you can get the value of the environment variable in the function.
gpu_memory_size typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] Property gpuMemorySize: The GPU memory capacity for the function.
initialization_timeout typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] Property initializationTimeout: the max execution time of the initializer, in second.
initializer typing.Union[str, ros_cdk_core.IResolvable] Property initializer: the entry point of the initializer.
instance_concurrency typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] Property instanceConcurrency: Function instance concurrency.
instance_lifecycle_config typing.Union[ros_cdk_core.IResolvable, InstanceLifecycleConfigProperty] Property instanceLifecycleConfig: The configuration of the instance lifecycle function.
instance_soft_concurrency typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] Property instanceSoftConcurrency: The soft concurrency of the instance.
instance_type typing.Union[str, ros_cdk_core.IResolvable] Property instanceType: Instance type.
memory_size typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] Property memorySize: The amount of memory that’s used to run function, in MB.
timeout typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] Property timeout: The maximum time duration a function can run, in seconds.

function_nameRequired

function_name: typing.Union[str, IResolvable]
  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property functionName: Function name.


handlerRequired

handler: typing.Union[str, IResolvable]
  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property handler: The function execution entry point.


runtimeRequired

runtime: typing.Union[str, IResolvable]
  • Type: typing.Union[str, 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


service_nameRequired

service_name: typing.Union[str, IResolvable]
  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property serviceName: Service name.


async_configurationOptional

async_configuration: typing.Union[IResolvable, AsyncConfigurationProperty]

Property asyncConfiguration: Configuration of asynchronous function calls.


ca_portOptional

ca_port: typing.Union[typing.Union[int, float], IResolvable]
  • Type: typing.Union[typing.Union[int, float], 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

code: typing.Union[IResolvable, CodeProperty]
  • Type: typing.Union[ros_cdk_core.IResolvable, CodeProperty]

Property code: The code that contains the function implementation.


cpuOptional

cpu: typing.Union[typing.Union[int, float], IResolvable]
  • Type: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]

Property cpu: The number of vCPUs of the function.

The value must be a multiple of 0.05.


custom_container_configOptional

custom_container_config: typing.Union[IResolvable, CustomContainerConfigProperty]

Property customContainerConfig: Custom container runtime related configuration.

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


custom_dnsOptional

custom_dns: typing.Union[IResolvable, CustomDNSProperty]

Property customDns: The custom DNS configurations of the function.


custom_health_check_configOptional

custom_health_check_config: typing.Union[IResolvable, CustomHealthCheckConfigProperty]

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


custom_runtime_configOptional

custom_runtime_config: typing.Union[IResolvable, CustomRuntimeConfigProperty]

Property customRuntimeConfig: Custom runtime related configuration.


descriptionOptional

description: typing.Union[str, IResolvable]
  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property description: Function description.


disk_sizeOptional

disk_size: typing.Union[typing.Union[int, float], IResolvable]
  • Type: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]

Property diskSize: The disk size of the function.

Unit: MB. Valid values: 512 and 10240.


environment_variablesOptional

environment_variables: typing.Union[IResolvable, typing.Mapping[typing.Any]]
  • Type: typing.Union[ros_cdk_core.IResolvable, typing.Mapping[typing.Any]]

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


gpu_memory_sizeOptional

gpu_memory_size: typing.Union[typing.Union[int, float], IResolvable]
  • Type: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]

Property gpuMemorySize: The GPU memory capacity for the function.

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


initialization_timeoutOptional

initialization_timeout: typing.Union[typing.Union[int, float], IResolvable]
  • Type: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]

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


initializerOptional

initializer: typing.Union[str, IResolvable]
  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property initializer: the entry point of the initializer.


instance_concurrencyOptional

instance_concurrency: typing.Union[typing.Union[int, float], IResolvable]
  • Type: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]

Property instanceConcurrency: Function instance concurrency.

Value can be between 1 to 100.


instance_lifecycle_configOptional

instance_lifecycle_config: typing.Union[IResolvable, InstanceLifecycleConfigProperty]

Property instanceLifecycleConfig: The configuration of the instance lifecycle function.


instance_soft_concurrencyOptional

instance_soft_concurrency: typing.Union[typing.Union[int, float], IResolvable]
  • Type: typing.Union[typing.Union[int, float], 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.


instance_typeOptional

instance_type: typing.Union[str, IResolvable]
  • Type: typing.Union[str, 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


memory_sizeOptional

memory_size: typing.Union[typing.Union[int, float], IResolvable]
  • Type: typing.Union[typing.Union[int, float], 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

timeout: typing.Union[typing.Union[int, float], IResolvable]
  • Type: typing.Union[typing.Union[int, float], 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.