Skip to content

FunctionProps

Properties for defining a Function.

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

Initializer

import com.aliyun.ros.cdk.fc.FunctionProps;
FunctionProps.builder()
    .functionName(java.lang.String)
    .functionName(IResolvable)
    .handler(java.lang.String)
    .handler(IResolvable)
    .runtime(java.lang.String)
    .runtime(IResolvable)
    .serviceName(java.lang.String)
    .serviceName(IResolvable)
//  .asyncConfiguration(IResolvable)
//  .asyncConfiguration(AsyncConfigurationProperty)
//  .caPort(java.lang.Number)
//  .caPort(IResolvable)
//  .code(IResolvable)
//  .code(CodeProperty)
//  .cpu(java.lang.Number)
//  .cpu(IResolvable)
//  .customContainerConfig(IResolvable)
//  .customContainerConfig(CustomContainerConfigProperty)
//  .customDns(IResolvable)
//  .customDns(CustomDNSProperty)
//  .customHealthCheckConfig(IResolvable)
//  .customHealthCheckConfig(CustomHealthCheckConfigProperty)
//  .customRuntimeConfig(IResolvable)
//  .customRuntimeConfig(CustomRuntimeConfigProperty)
//  .description(java.lang.String)
//  .description(IResolvable)
//  .diskSize(java.lang.Number)
//  .diskSize(IResolvable)
//  .environmentVariables(IResolvable)
//  .environmentVariables(java.util.Map<java.lang.String, java.lang.Object>)
//  .gpuMemorySize(java.lang.Number)
//  .gpuMemorySize(IResolvable)
//  .initializationTimeout(java.lang.Number)
//  .initializationTimeout(IResolvable)
//  .initializer(java.lang.String)
//  .initializer(IResolvable)
//  .instanceConcurrency(java.lang.Number)
//  .instanceConcurrency(IResolvable)
//  .instanceLifecycleConfig(IResolvable)
//  .instanceLifecycleConfig(InstanceLifecycleConfigProperty)
//  .instanceSoftConcurrency(java.lang.Number)
//  .instanceSoftConcurrency(IResolvable)
//  .instanceType(java.lang.String)
//  .instanceType(IResolvable)
//  .memorySize(java.lang.Number)
//  .memorySize(IResolvable)
//  .timeout(java.lang.Number)
//  .timeout(IResolvable)
    .build();

Properties

Name Type Description
functionName java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property functionName: Function name.
handler java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property handler: The function execution entry point.
runtime java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property runtime: The function runtime environment.
serviceName java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property serviceName: Service name.
asyncConfiguration com.aliyun.ros.cdk.core.IResolvable OR AsyncConfigurationProperty Property asyncConfiguration: Configuration of asynchronous function calls.
caPort java.lang.Number OR com.aliyun.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 com.aliyun.ros.cdk.core.IResolvable OR CodeProperty Property code: The code that contains the function implementation.
cpu java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable Property cpu: The number of vCPUs of the function.
customContainerConfig com.aliyun.ros.cdk.core.IResolvable OR CustomContainerConfigProperty Property customContainerConfig: Custom container runtime related configuration.
customDns com.aliyun.ros.cdk.core.IResolvable OR CustomDNSProperty Property customDns: The custom DNS configurations of the function.
customHealthCheckConfig com.aliyun.ros.cdk.core.IResolvable OR CustomHealthCheckConfigProperty Property customHealthCheckConfig: The health check configurations for the custom runtime and custom container.
customRuntimeConfig com.aliyun.ros.cdk.core.IResolvable OR CustomRuntimeConfigProperty Property customRuntimeConfig: Custom runtime related configuration.
description java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property description: Function description.
diskSize java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable Property diskSize: The disk size of the function.
environmentVariables com.aliyun.ros.cdk.core.IResolvable OR java.util.Map Property environmentVariables: The environment variable set for the function, you can get the value of the environment variable in the function.
gpuMemorySize java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable Property gpuMemorySize: The GPU memory capacity for the function.
initializationTimeout java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable Property initializationTimeout: the max execution time of the initializer, in second.
initializer java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property initializer: the entry point of the initializer.
instanceConcurrency java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable Property instanceConcurrency: Function instance concurrency.
instanceLifecycleConfig com.aliyun.ros.cdk.core.IResolvable OR InstanceLifecycleConfigProperty Property instanceLifecycleConfig: The configuration of the instance lifecycle function.
instanceSoftConcurrency java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable Property instanceSoftConcurrency: The soft concurrency of the instance.
instanceType java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property instanceType: Instance type.
memorySize java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable Property memorySize: The amount of memory that’s used to run function, in MB.
timeout java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable Property timeout: The maximum time duration a function can run, in seconds.

functionNameRequired

public java.lang.Object getFunctionName();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property functionName: Function name.


handlerRequired

public java.lang.Object getHandler();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property handler: The function execution entry point.


runtimeRequired

public java.lang.Object getRuntime();
  • Type: java.lang.String OR com.aliyun.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 java.lang.Object getServiceName();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property serviceName: Service name.


asyncConfigurationOptional

public java.lang.Object getAsyncConfiguration();

Property asyncConfiguration: Configuration of asynchronous function calls.


caPortOptional

public java.lang.Object getCaPort();
  • Type: java.lang.Number OR com.aliyun.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 java.lang.Object getCode();

Property code: The code that contains the function implementation.


cpuOptional

public java.lang.Object getCpu();
  • Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable

Property cpu: The number of vCPUs of the function.

The value must be a multiple of 0.05.


customContainerConfigOptional

public java.lang.Object getCustomContainerConfig();

Property customContainerConfig: Custom container runtime related configuration.

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


customDnsOptional

public java.lang.Object getCustomDns();

Property customDns: The custom DNS configurations of the function.


customHealthCheckConfigOptional

public java.lang.Object getCustomHealthCheckConfig();

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


customRuntimeConfigOptional

public java.lang.Object getCustomRuntimeConfig();

Property customRuntimeConfig: Custom runtime related configuration.


descriptionOptional

public java.lang.Object getDescription();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property description: Function description.


diskSizeOptional

public java.lang.Object getDiskSize();
  • Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable

Property diskSize: The disk size of the function.

Unit: MB. Valid values: 512 and 10240.


environmentVariablesOptional

public java.lang.Object getEnvironmentVariables();
  • Type: com.aliyun.ros.cdk.core.IResolvable OR java.util.Map

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


gpuMemorySizeOptional

public java.lang.Object getGpuMemorySize();
  • Type: java.lang.Number OR com.aliyun.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 java.lang.Object getInitializationTimeout();
  • Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable

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


initializerOptional

public java.lang.Object getInitializer();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property initializer: the entry point of the initializer.


instanceConcurrencyOptional

public java.lang.Object getInstanceConcurrency();
  • Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable

Property instanceConcurrency: Function instance concurrency.

Value can be between 1 to 100.


instanceLifecycleConfigOptional

public java.lang.Object getInstanceLifecycleConfig();

Property instanceLifecycleConfig: The configuration of the instance lifecycle function.


instanceSoftConcurrencyOptional

public java.lang.Object getInstanceSoftConcurrency();
  • Type: java.lang.Number OR com.aliyun.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 java.lang.Object getInstanceType();
  • Type: java.lang.String OR com.aliyun.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 java.lang.Object getMemorySize();
  • Type: java.lang.Number OR com.aliyun.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 java.lang.Object getTimeout();
  • Type: java.lang.Number OR com.aliyun.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.