Help Center> FunctionGraph> Developer Guide> Development Tools> Serverless Devs> Huawei Cloud FunctionGraph YAML Specifications
Updated on 2023-10-19 GMT+08:00

Huawei Cloud FunctionGraph YAML Specifications

Field Parsing

Table 1 Parameter description

Parameter Name

Required

Type

Description

region

True

Enum

Enum

funtion

True

Struct

Function

trigger

False

Struct

Triggers

Complete YAML Configuration

The YAML fields of Huawei Cloud FunctionGraph component are as follows:
edition: 1.0.0 #  YAML specifications version for the command line, which complies with the Semantic Versioning specifications.
name: fg-test # Project name
access: "default" # Key alias

vars: # Global variable
    region: "cn-east-3"
    functionName: "start-fg-event-nodejs14"

services:
    component-test: # Service name
    component: fgs # Component name
        props:
            region: ${vars.region}
            function:
                functionName: ${vars.functionName} # Function name
                handler: index.handler # Handler of the function
                memorySize: 256 # Memory required for the function
                timeout: 30 # Timeout for executing the function
                runtime: Node.js14.18 # Runtime
                agencyName: fgs-vpc-test # Agency name
                environmentVariables: # Environment variables
                    test: test
                    hello: world
                vpcId: xxx-xxx # Unique ID of a Virtual Private Cloud (VPC)
                subnetId: xxx-xxx #  Subnet ID
                concurrency: 10 # Maximum number of instances of a single function
                concurrentNum: 10 # Maximum number of concurrent tasks of a single instance
                codeType: zip # Code type of the function 
                dependVersionList: # Dependency ID
                    - xxx-xxx
                code: # Local code address
                    codeUri: ./code
            trigger:
                triggerTypeCode: TIMER # Trigger type
                status: DISABLED # Trigger status
                eventData: # Trigger configuration 
                    name: APIG_test  # API name
                    groupName: APIGroup_xxx # Group name 
                    auth: IAM # Security authentication
                    protocol: HTTPS # Request protocol
                    timeout: 5000 # Backend timeout duration