FunctionProps
Properties for defining a Function.
See https://www.alibabacloud.com/help/ros/developer-reference/aliyun-fc3-function
Initializer
import ros_cdk_fc3
ros_cdk_fc3.FunctionProps(
function_name: typing.Union[str, IResolvable],
handler: typing.Union[str, IResolvable],
runtime: typing.Union[str, IResolvable],
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_runtime_config: typing.Union[IResolvable, CustomRuntimeConfigProperty] = None,
description: typing.Union[str, IResolvable] = None,
disable_ondemand: typing.Union[bool, IResolvable] = None,
disk_size: typing.Union[typing.Union[int, float], IResolvable] = None,
environment_variables: typing.Union[IResolvable, typing.Mapping[typing.Any]] = None,
gpu_config: typing.Union[IResolvable, GpuConfigProperty] = None,
instance_concurrency: typing.Union[typing.Union[int, float], IResolvable] = None,
instance_isolation_mode: typing.Union[str, IResolvable] = None,
instance_lifecycle_config: typing.Union[IResolvable, InstanceLifecycleConfigProperty] = None,
internet_access: typing.Union[bool, IResolvable] = None,
layers: typing.Union[IResolvable, typing.List[typing.Union[str, IResolvable]]] = None,
log_config: typing.Union[IResolvable, LogConfigProperty] = None,
memory_size: typing.Union[typing.Union[int, float], IResolvable] = None,
nas_config: typing.Union[IResolvable, NasConfigProperty] = None,
oss_mount_config: typing.Union[IResolvable, OssMountConfigProperty] = None,
role: typing.Union[str, IResolvable] = None,
session_affinity: typing.Union[str, IResolvable] = None,
session_affinity_config: typing.Union[IResolvable, typing.Mapping[typing.Any]] = None,
tags: typing.List[TagsProperty] = None,
timeout: typing.Union[typing.Union[int, float], IResolvable] = None,
tracing_config: typing.Union[IResolvable, TracingConfigProperty] = None,
vpc_config: typing.Union[IResolvable, VpcConfigProperty] = None
)
Properties
| Name | Type | Description |
|---|---|---|
function_name | typing.Union[str, ros_cdk_core.IResolvable] | Property functionName: The name of the function. |
handler | typing.Union[str, ros_cdk_core.IResolvable] | Property handler: The handler of the function. |
runtime | typing.Union[str, ros_cdk_core.IResolvable] | Property runtime: The programming language of the function. |
code | typing.Union[ros_cdk_core.IResolvable, CodeProperty] | Property code: Function code ZIP package. |
cpu | typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] | Property cpu: The CPU size of the function in vCPU as a multiple of 0.05 vCPU. The minimum value is 0.05 and the maximum value is 16. At the same time, the ratio of cpu to memorySize (in GB) should be between 1:1 and 1:4. |
custom_container_config | typing.Union[ros_cdk_core.IResolvable, CustomContainerConfigProperty] | Property customContainerConfig: Custom container configuration. |
custom_dns | typing.Union[ros_cdk_core.IResolvable, CustomDnsProperty] | Property customDns: Custom DNS configuration. |
custom_runtime_config | typing.Union[ros_cdk_core.IResolvable, CustomRuntimeConfigProperty] | Property customRuntimeConfig: Custom runtime configuration. |
description | typing.Union[str, ros_cdk_core.IResolvable] | Property description: Function description. |
disable_ondemand | typing.Union[bool, ros_cdk_core.IResolvable] | Property disableOndemand: Whether to disable the creation of on-demand instances. |
disk_size | typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] | Property diskSize: The disk size of the function, in MB. |
environment_variables | typing.Union[ros_cdk_core.IResolvable, typing.Mapping[typing.Any]] | Property environmentVariables: The environment variables of the function. |
gpu_config | typing.Union[ros_cdk_core.IResolvable, GpuConfigProperty] | Property gpuConfig: The GPU configuration of the function. |
instance_concurrency | typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] | Property instanceConcurrency: The maximum number of concurrent instances of the function. |
instance_isolation_mode | typing.Union[str, ros_cdk_core.IResolvable] | Property instanceIsolationMode: Instance isolation mode. |
instance_lifecycle_config | typing.Union[ros_cdk_core.IResolvable, InstanceLifecycleConfigProperty] | Property instanceLifecycleConfig: The instance lifecycle configuration of the function. |
internet_access | typing.Union[bool, ros_cdk_core.IResolvable] | Property internetAccess: Whether the function can access the Internet. |
layers | typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[str, ros_cdk_core.IResolvable]]] | Property layers: The layers of the function. |
log_config | typing.Union[ros_cdk_core.IResolvable, LogConfigProperty] | Property logConfig: The log configuration of the function. |
memory_size | typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] | Property memorySize: The memory size of the function, in MB. |
nas_config | typing.Union[ros_cdk_core.IResolvable, NasConfigProperty] | Property nasConfig: The NAS configuration of the function. |
oss_mount_config | typing.Union[ros_cdk_core.IResolvable, OssMountConfigProperty] | Property ossMountConfig: The OSS mount configuration of the function. |
role | typing.Union[str, ros_cdk_core.IResolvable] | Property role: The user is authorized to the RAM role of Function Compute. |
session_affinity | typing.Union[str, ros_cdk_core.IResolvable] | Property sessionAffinity: The session affinity policy for Function Compute requests. |
session_affinity_config | typing.Union[ros_cdk_core.IResolvable, typing.Mapping[typing.Any]] | Property sessionAffinityConfig: Session affinity configuration. |
tags | typing.List[TagsProperty] | Property tags: Tags to attach to function. |
timeout | typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] | Property timeout: The timeout of the function. |
tracing_config | typing.Union[ros_cdk_core.IResolvable, TracingConfigProperty] | Property tracingConfig: The tracing configuration of the function. |
vpc_config | typing.Union[ros_cdk_core.IResolvable, VpcConfigProperty] | Property vpcConfig: The VPC configuration of the function. |
function_nameRequired
function_name: typing.Union[str, IResolvable]
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Property functionName: The name of the function.
handlerRequired
handler: typing.Union[str, IResolvable]
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Property handler: The handler of the function.
runtimeRequired
runtime: typing.Union[str, IResolvable]
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Property runtime: The programming language of the function.
codeOptional
code: typing.Union[IResolvable, CodeProperty]
- Type: typing.Union[ros_cdk_core.IResolvable, CodeProperty]
Property code: Function code ZIP package.
Choose one of Code and CustomContainerConfig.
cpuOptional
cpu: typing.Union[typing.Union[int, float], IResolvable]
- Type: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]
Property cpu: The CPU size of the function in vCPU as a multiple of 0.05 vCPU. The minimum value is 0.05 and the maximum value is 16. At the same time, the ratio of cpu to memorySize (in GB) should be between 1:1 and 1:4.
custom_container_configOptional
custom_container_config: typing.Union[IResolvable, CustomContainerConfigProperty]
- Type: typing.Union[ros_cdk_core.IResolvable, CustomContainerConfigProperty]
Property customContainerConfig: Custom container configuration.
Choose one of Code and CustomContainerConfig.
custom_dnsOptional
custom_dns: typing.Union[IResolvable, CustomDnsProperty]
- Type: typing.Union[ros_cdk_core.IResolvable, CustomDnsProperty]
Property customDns: Custom DNS configuration.
custom_runtime_configOptional
custom_runtime_config: typing.Union[IResolvable, CustomRuntimeConfigProperty]
- Type: typing.Union[ros_cdk_core.IResolvable, CustomRuntimeConfigProperty]
Property customRuntimeConfig: Custom runtime configuration.
descriptionOptional
description: typing.Union[str, IResolvable]
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Property description: Function description.
disable_ondemandOptional
disable_ondemand: typing.Union[bool, IResolvable]
- Type: typing.Union[bool, ros_cdk_core.IResolvable]
Property disableOndemand: Whether to disable the creation of on-demand instances.
When enabled, on-demand instances will not be created, and only reserved instances can be used.
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, in MB.
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 variables of the function.
gpu_configOptional
gpu_config: typing.Union[IResolvable, GpuConfigProperty]
- Type: typing.Union[ros_cdk_core.IResolvable, GpuConfigProperty]
Property gpuConfig: The GPU configuration of the function.
instance_concurrencyOptional
instance_concurrency: typing.Union[typing.Union[int, float], IResolvable]
- Type: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]
Property instanceConcurrency: The maximum number of concurrent instances of the function.
instance_isolation_modeOptional
instance_isolation_mode: typing.Union[str, IResolvable]
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Property instanceIsolationMode: Instance isolation mode.
instance_lifecycle_configOptional
instance_lifecycle_config: typing.Union[IResolvable, InstanceLifecycleConfigProperty]
- Type: typing.Union[ros_cdk_core.IResolvable, InstanceLifecycleConfigProperty]
Property instanceLifecycleConfig: The instance lifecycle configuration of the function.
internet_accessOptional
internet_access: typing.Union[bool, IResolvable]
- Type: typing.Union[bool, ros_cdk_core.IResolvable]
Property internetAccess: Whether the function can access the Internet.
layersOptional
layers: typing.Union[IResolvable, typing.List[typing.Union[str, IResolvable]]]
- Type: typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[str, ros_cdk_core.IResolvable]]]
Property layers: The layers of the function.
log_configOptional
log_config: typing.Union[IResolvable, LogConfigProperty]
- Type: typing.Union[ros_cdk_core.IResolvable, LogConfigProperty]
Property logConfig: The log configuration of the function.
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 memory size of the function, in MB.
nas_configOptional
nas_config: typing.Union[IResolvable, NasConfigProperty]
- Type: typing.Union[ros_cdk_core.IResolvable, NasConfigProperty]
Property nasConfig: The NAS configuration of the function.
oss_mount_configOptional
oss_mount_config: typing.Union[IResolvable, OssMountConfigProperty]
- Type: typing.Union[ros_cdk_core.IResolvable, OssMountConfigProperty]
Property ossMountConfig: The OSS mount configuration of the function.
roleOptional
role: typing.Union[str, IResolvable]
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Property role: The user is authorized to the RAM role of Function Compute.
After setting, Function Compute will assume the role and generate temporary access credentials. The temporary access credentials of this role can be used in functions to access specified Alibaba Cloud services, such as OSS and OTS.
session_affinityOptional
session_affinity: typing.Union[str, IResolvable]
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Property sessionAffinity: The session affinity policy for Function Compute requests.
Set to MCP_SSE to implement MCP SSE protocol request affinity. Set to GENERATED_COOKIE for cookie-based affinity. Set to HEADER_FIELD for header-based affinity. If not set or set to NONE, there is no affinity effect, and requests are routed according to the default scheduling policy of Function Compute.
session_affinity_configOptional
session_affinity_config: typing.Union[IResolvable, typing.Mapping[typing.Any]]
- Type: typing.Union[ros_cdk_core.IResolvable, typing.Mapping[typing.Any]]
Property sessionAffinityConfig: Session affinity configuration.
tagsOptional
tags: typing.List[TagsProperty]
- Type: typing.List[TagsProperty]
Property tags: Tags to attach to function.
Max support 20 tags to add during create function. Each tag with two properties Key and Value, and Key is required.
timeoutOptional
timeout: typing.Union[typing.Union[int, float], IResolvable]
- Type: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]
Property timeout: The timeout of the function.
tracing_configOptional
tracing_config: typing.Union[IResolvable, TracingConfigProperty]
- Type: typing.Union[ros_cdk_core.IResolvable, TracingConfigProperty]
Property tracingConfig: The tracing configuration of the function.
vpc_configOptional
vpc_config: typing.Union[IResolvable, VpcConfigProperty]
- Type: typing.Union[ros_cdk_core.IResolvable, VpcConfigProperty]
Property vpcConfig: The VPC configuration of the function.