put-custom-runtime-function
Deploy custom runtime-compatible code projects to Alibaba Cloud Function Compute without manual packaging. Automatically updates existing functions if present. Specify location, function name, runtime configuration, and deployment region.
Instructions
将构建完成的匹配阿里云自定义运行时的工程,部署到函数计算。代码工程不需要手动打包,会自动处理。如果函数已存在,则尝试覆盖并更新目标函数。建议使用该方法前先确认函数是否存在
Input Schema
Name | Required | Description | Default |
---|---|---|---|
cpu | No | 函数的 CPU 规格,单位为 vCPU,为 0.05 vCPU 的倍数。 和 diskSize 必须同时存在, 如果仅仅填写 memorySize, cpu 和 diskSize 可以不填。内存规格(以GB计算)与CPU规格的比例必须在1到4之间,例如内存为1024MB,则CPU必须为0.25到1之间,默认为1 | |
customRuntimeConfig | Yes | 自定义运行时配置,定义启动命令、参数以及启动的HTTP Server的监听端口 | |
description | No | 函数的描述,可以描述一下函数的功能。 | |
diskSize | Yes | 磁盘大小,单位是MB,可选值: 512 | 10240 | |
environmentVariables | No | 运行时的环境变量配置 | |
functionName | Yes | 函数名称,函数名称在每个region必须是唯一的。 | |
instanceConcurrency | Yes | 单实例多并发数。规定了单个实例可以同时同时被多个请求命中的上限,只对自定义运行时与自定义容器镜像运行时生效。范围为[1, 200] | |
internetAccess | No | 是否支持从函数实例内访问互联网 | |
layers | No | 函数计算的层配置,当前会自动为custom.debian10,custom.debian11,custom.debian12添加默认的公共层 | |
location | Yes | 本地代码工程的根路径,例如/Users/xxx/my-project,不需要打包为zip | |
logConfig | No | 日志投递配置。如果配置为auto,则会自动创建SLS日志库并投递日志。如果配置为其他值,则需要配置project和logstore。 | |
memorySize | No | 函数的内存规格,单位为 MB,最小值为128,最大值为 30720。可以选择的内存规格为:128,256,512,1024,2048,4096,8192,16384,32768。默认为2048。内存规格(以GB计算)与CPU规格的比例必须在1到4之间,例如内存为1024MB,则CPU必须为0.25到1之间 | |
region | No | 部署的区域,当前可选的区域是cn-hangzhou, cn-shanghai, cn-beijing, cn-shenzhen, cn-hongkong, ap-southeast-1, ap-southeast-2, ap-southeast-3, ap-southeast-5, ap-northeast-1, eu-central-1, eu-west-1, us-west-1, us-east-1, ap-south-1, me-east-1, cn-chengdu, cn-wulanchabu, cn-guangzhou,默认是cn-hangzhou | cn-hangzhou |
role | No | 函数运行时的角色配置。授予函数计算所需权限的 RAM 角色,使用场景包含:1. 把函数产生的日志发送到您的日志库中。2. 为函数在执行过程中访问其他云资源生成的临时访问令牌。一般可以设置为aliyunfcdefaultrole。角色ARN为acs:ram::****:role/aliyunfcdefaultrole,只需要输入aliyunfcdefaultrole即可 | |
runtime | No | 函数的运行时环境,对于自定义运行时,当前支持debian10,debian11,debian12 | custom.debian10 |
tags | No | 函数标签的key与value配置 | |
timeout | No | 函数执行的超时时间,单位为秒,最小 1 秒,默认 3 秒。函数执行超过这个时间后会被终止执行。 | |
vpcConfig | No | 函数的VPC网络配置。如果配置为auto,则会自动创建VPC、VSwitch与安全组配置。如果配置为其他值,则需要配置vpcId、vSwitchIds与securityGroupId。函数实例会运行在配置的VPC网络中。 |