Updated on 2024-11-12 GMT+08:00

Creating a CDN Function

Overview

FunctionGraph provides programmable CDN functions in the AP-Singapore region. You can use FunctionGraph to debug functions on the cloud and deliver them to off-premises CDN environments (available only in AP-Singapore).

By default, you do not have the permission to create CDN functions. To use CDN functions, contact Huawei Cloud FunctionGraph engineers to apply for a whitelist.

Prerequisite

An agency for CDN with permission to call functions has been created.

Creating an Agency

Before using CDN, you need to create an agency so that CDN can call functions created in FunctionGraph.

  1. Log in to the CDN console. In the navigation pane on the left, choose Domains.
  2. In the domain list, click the target domain name or click Configure in the Operation column.
  3. Click the Functions tab. If you use FunctionGraph for the first time, click Authorize Now. The authorization page is displayed.
  4. After the authorization is configured, click Authorize. An agency named CDNAccessFunctionGraph will be created on the IAM console. CDN then has permission to call your functions in FunctionGraph.

    Do not delete this created agency. Otherwise, CDN cannot call functions in FunctionGraph.

Procedure

  1. Log in to the FunctionGraph console and choose Templates in the navigation pane.
  2. Enter programmable-cdn in the search box in the upper right corner to query the programmable CDN function template. Then click Configure.

    Figure 1 Programmable CDN template

  3. Configure function details.

    • Region: Select a region.
    • Project: Use default.
    • Function Name: Enter a custom name.
    • Enterprise Project: Retain the default value default.

    Review the function configuration and click Create Function.

  4. On the function details page, click Code to compile a function.
  5. Select Version, click Public New Version, set Version and Description, and click OK.

    Figure 2 Publishing a new function version
    Figure 3 Configuring the version