Updated on 2023-10-19 GMT+08:00

YAML File

Field Parsing

Table 1 Parameter description

Parameter

Required

Type

Description

region

True

Enum

Region

function

True

Struct

Function

triggers

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 variables
    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
                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 for the function
                concurrentNum: 10 # Maximum number of concurrent requests per instance
                codeType: zip # Function code type
                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