ParametersUI specification

default data type

string

The full description is

region:
  title: Territory
  type: string
  default: cn-hangzhou
  description: The region where the app is created
  enum:
    - cn-beijing
    - cn-hangzhou
    - cn-shanghai
    - cn-qingdao
    - cn-zhangjiakou
    - cn-huhehaote
    - cn-shenzhen
    - cn-chengdu
    - 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

enum represents the enumeration value, the user does not need to enter it manually, just select it directly

  • The expression in cli is:

  • The expression on the webpage is as

boolean

The full description is

internetAccess:
  type: boolean
  title: allow public network access
  description: Whether the function in the configuration service can access the Internet
  default: true
  • The expression in cli is:

  • The expression on the webpage is as

secret

The full description is

secret:
  type: secret
  title: Application Admin Password
  description: letters, numbers, underscores, 8-30 digits long
  default: 12345678
  • The expression in cli is:

  • The expression on the webpage is as

integer | int

The full description is

gpuMemorySize:
  title: memory size
  type: integer | int
  default: 4096
  description: The size of memory allocated by the application
  • The expression in cli is:

  • The expression on the webpage is as

custom UI

The main user of the custom UI is on the web side, and the user can operate it conveniently. Usually starts with x-

x-bucket

Used for oss bucket selection

bucketName:
  title: OSS bucket name
  type: string
  default: ""
  description: OSS bucket name (note the same region as the function)
  x-bucket:
    dependency:
      - region # depends on other input fields region

Displayed when Required does not contain bucketName

enabled

Disabled state

Field Description
Field NameTypeDescription
dependencylist<string>dependency fields

x-role

for character selection

triggerRoleArn:
  title: Trigger RAM Role ARN
  type: string
  default: ''
  pattern: '^acs:ram::[0-9]*:role/.*$'
  description: OSS uses this role to send event notifications to call functions
  required: true
  x-role:
    name: aliyunosseventnotificationrole # role name
    service: OSS # service account
    authorities:
      -AliyunFCInvocationAccess

pattern stands for regular, indicating that the value of the current field needs to match the regular

Field Description
Field NameTypeDescription
namestringsystem role name
servicestringService account, currently supported system accounts: OSS, FC, LOG
authoritieslist<string>system policies

x-nas

Choice of NAS mount points, VPCs, switches, security groups

mountPointsServerAddr:
  title: NAS mount point address
  type: string
  default: ""
  description: NAS mount point address, you can log in to <a href="https://nasnext.console.aliyun.com" target="_blank">NAS console</a> to view
  x-nas:
    denpendency:
      - region
Field Description
Field NameTypeDescription
dependencylist<string>dependency fields

Note that x-nas is used with the 'vpcId', 'vswitchId', 'securityGroupId' fields

vpcId:
  title: VPC Id
  type: string
  default: ""
  description: VPC ID where the NAS mount point is located, such as vpc-bp1lynmabizqdgt4308dt
vswitchId:
  title: Switch Id
  type: string
  default: ""
  description: VSW ID of the virtual switch where the NAS mount point is located, the switch should preferably be in the availability zone supported by FC
securityGroupId:
  title: Security Group Id
  type: string
  default: ""
  description: Log in to <a href="https://ecs.console.aliyun.com/#/securityGroup/region/cn-hangzhou" target="_blank">security group</a> to view, usually empty security created by default group (note the same region as above), for example sg-bp1cd2w08t3dy7nhrvtx

x-acr

Used to select and create images for Alibaba Cloud Container Image Service

acrRegistry:
  title: Mirror repository
  type: string
  examples: ['registry.cn-hangzhou.aliyuncs.com/fc-demo/custom-nodejs14-event-function:v0.1']
  description: The image repository address requires you to activate the service, create the repository, and set the access credentials in the https://cr.console.aliyun.com/
  x-acr:
    type: select

x-kafka

Choice of Kafka instance ID, kafkaEndpoint, VPCs, switches, security groups

kafkaInstanceID:
  title: kafka instance id
  type: string
  default: ''
  description: kafka 实例 id
  x-kafka:
    denpendency:
      - region
    related:
      - kafkaEndpoint
      - vpcId
      - vswitchId
      - securityGroupId
Field Description
Field NameTypeDescription
dependencylist<string>dependency fields
relatedlist<string>related fields

Note that x-kafka is used with the 'kafkaEndpoint', 'vpcId', 'vswitchId', 'securityGroupId' fields

kafkaEndpoint:
  title: kafka endpoint
  type: string
  default: ''
  description: kafka endpoint, 可以从 kafka 控制台获取
vpcID:
  title: kafka 实例所在 vpc id
  type: string
  default: ''
  description: VPC id。请注意需要填写函数计算支持的 az
vswitchID:
  title: vswitchID
  type: string
  default: ''
  description: vpc 中 vswitch id,用于内网访问 kafka
securityGroupID:
  title: security group id
  type: string
  default: ''
  description: vpc 下安全组 id,用于内网访问 kafka

x-domain

Used for configurable domain names to access your functions

domainName:
  title: domain configuration
  type: string
  required: false
  default: auto
  x-domain: true
Field Description
Field NameTypeDescription
x-domainBooleanx-domain: true, domain name configuration items can be displayed on the web
Automatic Configuration UI

Custom Configuration Domain Name UI

tips

Random suffix name ${default-suffix}

Used to generate a random suffix name for the field to ensure that each initialization can get a different value. Such as service name, etc.

serviceName:
  title: service name
  type: string
  default: web-framework-${default-suffix}
  pattern: "^[a-zA-Z_][a-zA-Z0-9-_]{0,127}$"
  description: The service name, which can only contain letters, numbers, underscores and dashes. Cannot start with a number or a dash. Length between 1-128
  • The expression in cli is:

  • The expression on the webpage is as

template engine

When the application is initialized, use art-template for template parsing

For example, when writing an application template, the user can specify the vpc configuration by himself, if it is specified, use the custom one, and use auto if it is not specified

  • publish.yaml
vpcConfigType:
  title: VPC network configuration
  type: string
  description: Configure the network used by the functions in the service, such as whether the function can access the Internet, whether it can access resources in the VPC, and so on.
  enum:
    - auto
    - Custom configuration
  • s.yaml
# ...others
service:
  name: "{{ serviceName }}"
  description: Welcome to ServerlessTool
  {{if vpcConfigType === 'auto'}}
  vpcConfig: auto
  {{else}}
  vpcConfig: # VPC configuration, after configuration, the function can access the specified VPC
    vpcId: "{{vpcID}}" # VPC ID
    securityGroupId: "{{securityGroupID}}" # The security group ID
    vswitchIds: # A list of switch IDs
      - "{{vswitchID}}"
  {{/if}}

For more syntax support, see the art-template documentation

custom filter filter

When the application is initialized, you can customize the filter when parsing the template.

  • First we need to define the filter in the hook/filter.js file

    Example of hook/filter.js content

    function timestamp(value) {
      return `your code: ${value}`
    }
    module.exports = {
      timestamp,
    };
    
  • Then you can use the filters we have defined in the template

    s.yaml example using filters

    # ...others
    time: "{{time | timestamp}}"
    
Edit this page on GitHub Updated at Sun, Aug 20, 2023