Function
This class encapsulates and extends the ROS resource type ALIYUN::FC3::Function
.
Initializers
import ros_cdk_fc3
ros_cdk_fc3.Function(
scope: Construct,
id: str,
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,
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_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,
timeout: typing.Union[typing.Union[int, float], IResolvable] = None,
tracing_config: typing.Union[IResolvable, TracingConfigProperty] = None,
vpc_config: typing.Union[IResolvable, VpcConfigProperty] = None,
enable_resource_property_constraint: bool = None
)
Name | Type | Description |
---|---|---|
scope |
ros_cdk_core.Construct |
No description. |
id |
str |
No 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. |
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_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. |
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. |
enable_resource_property_constraint |
bool |
No description. |
scope
Required
- Type: ros_cdk_core.Construct
id
Required
- Type: str
function_name
Required
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Property functionName: The name of the function.
handler
Required
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Property handler: The handler of the function.
runtime
Required
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Property runtime: The programming language of the function.
code
Optional
- Type: typing.Union[ros_cdk_core.IResolvable, CodeProperty]
Property code: Function code ZIP package.
Choose one of Code and CustomContainerConfig.
cpu
Optional
- 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_config
Optional
- Type: typing.Union[ros_cdk_core.IResolvable, CustomContainerConfigProperty]
Property customContainerConfig: Custom container configuration.
Choose one of Code and CustomContainerConfig.
custom_dns
Optional
- Type: typing.Union[ros_cdk_core.IResolvable, CustomDnsProperty]
Property customDns: Custom DNS configuration.
custom_runtime_config
Optional
- Type: typing.Union[ros_cdk_core.IResolvable, CustomRuntimeConfigProperty]
Property customRuntimeConfig: Custom runtime configuration.
description
Optional
- Type: typing.Union[str, ros_cdk_core.IResolvable]
Property description: Function description.
disk_size
Optional
- Type: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]
Property diskSize: The disk size of the function, in MB.
environment_variables
Optional
- Type: typing.Union[ros_cdk_core.IResolvable, typing.Mapping[typing.Any]]
Property environmentVariables: The environment variables of the function.
gpu_config
Optional
- Type: typing.Union[ros_cdk_core.IResolvable, GpuConfigProperty]
Property gpuConfig: The GPU configuration of the function.
instance_concurrency
Optional
- Type: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]
Property instanceConcurrency: The maximum number of concurrent instances of the function.
instance_lifecycle_config
Optional
- Type: typing.Union[ros_cdk_core.IResolvable, InstanceLifecycleConfigProperty]
Property instanceLifecycleConfig: The instance lifecycle configuration of the function.
internet_access
Optional
- Type: typing.Union[bool, ros_cdk_core.IResolvable]
Property internetAccess: Whether the function can access the Internet.
layers
Optional
- Type: typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[str, ros_cdk_core.IResolvable]]]
Property layers: The layers of the function.
log_config
Optional
- Type: typing.Union[ros_cdk_core.IResolvable, LogConfigProperty]
Property logConfig: The log configuration of the function.
memory_size
Optional
- Type: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]
Property memorySize: The memory size of the function, in MB.
nas_config
Optional
- Type: typing.Union[ros_cdk_core.IResolvable, NasConfigProperty]
Property nasConfig: The NAS configuration of the function.
oss_mount_config
Optional
- Type: typing.Union[ros_cdk_core.IResolvable, OssMountConfigProperty]
Property ossMountConfig: The OSS mount configuration of the function.
role
Optional
- 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.
timeout
Optional
- Type: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]
Property timeout: The timeout of the function.
tracing_config
Optional
- Type: typing.Union[ros_cdk_core.IResolvable, TracingConfigProperty]
Property tracingConfig: The tracing configuration of the function.
vpc_config
Optional
- Type: typing.Union[ros_cdk_core.IResolvable, VpcConfigProperty]
Property vpcConfig: The VPC configuration of the function.
enable_resource_property_constraint
Optional
- Type: bool
Methods
Name | Description |
---|---|
to_string |
Returns a string representation of this construct. |
synthesize |
Allows this construct to emit artifacts into the cloud assembly during synthesis. |
add_condition |
No description. |
add_count |
No description. |
add_dependency |
No description. |
add_resource_desc |
No description. |
apply_removal_policy |
No description. |
get_att |
No description. |
set_metadata |
No description. |
to_string
def to_string() -> str
Returns a string representation of this construct.
synthesize
def synthesize(
session: ISynthesisSession
) -> None
Allows this construct to emit artifacts into the cloud assembly during synthesis.
This method is usually implemented by framework-level constructs such as Stack
and Asset
as they participate in synthesizing the cloud assembly.
- Type: ros_cdk_core.ISynthesisSession
The synthesis session.
add_condition
def add_condition(
condition: RosCondition
) -> None
- Type: ros_cdk_core.RosCondition
add_count
def add_count(
count: typing.Union[typing.Union[int, float], IResolvable]
) -> None
- Type: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]
add_dependency
def add_dependency(
resource: Resource
) -> None
- Type: ros_cdk_core.Resource
add_resource_desc
def add_resource_desc(
desc: str
) -> None
- Type: str
apply_removal_policy
def apply_removal_policy(
policy: RemovalPolicy
) -> None
- Type: ros_cdk_core.RemovalPolicy
get_att
def get_att(
name: str
) -> IResolvable
- Type: str
set_metadata
def set_metadata(
key: str,
value: typing.Any
) -> None
- Type: str
- Type: typing.Any
Static Functions
Name | Description |
---|---|
is_construct |
Return whether the given object is a Construct. |
is_construct
import ros_cdk_fc3
ros_cdk_fc3.Function.is_construct(
x: typing.Any
)
Return whether the given object is a Construct.
- Type: typing.Any
Properties
Name | Type | Description |
---|---|---|
node |
ros_cdk_core.ConstructNode |
The construct tree node associated with this construct. |
ref |
str |
No description. |
stack |
ros_cdk_core.Stack |
The stack in which this resource is defined. |
resource |
ros_cdk_core.RosResource |
No description. |
attr_arn |
ros_cdk_core.IResolvable |
Attribute ARN: The ARN for ALIYUN::ROS::CustomResource. |
attr_function_id |
ros_cdk_core.IResolvable |
Attribute FunctionId: The function ID. |
attr_function_name |
ros_cdk_core.IResolvable |
Attribute FunctionName: The function name. |
node
Required
node: ConstructNode
- Type: ros_cdk_core.ConstructNode
The construct tree node associated with this construct.
ref
Required
ref: str
- Type: str
stack
Required
stack: Stack
- Type: ros_cdk_core.Stack
The stack in which this resource is defined.
resource
Optional
resource: RosResource
- Type: ros_cdk_core.RosResource
attr_arn
Required
attr_arn: IResolvable
- Type: ros_cdk_core.IResolvable
Attribute ARN: The ARN for ALIYUN::ROS::CustomResource.
attr_function_id
Required
attr_function_id: IResolvable
- Type: ros_cdk_core.IResolvable
Attribute FunctionId: The function ID.
attr_function_name
Required
attr_function_name: IResolvable
- Type: ros_cdk_core.IResolvable
Attribute FunctionName: The function name.