Updated on 2025-07-10 GMT+08:00

Preparation

Before creating a function and adding an event source, you need to create two OBS buckets to respectively store uploaded and watermarked images.

After creating the OBS buckets, you must create an agency to delegate FunctionGraph to access OBS resources.

Creating OBS Buckets

Precautions

  • The function and the source and destination buckets for storing images must be in the same region.
  • Use two different OBS buckets. If only one bucket is used, the function will be executed infinitely. (When an image is uploaded to the bucket, the function is triggered to process the image and store the processed image into the bucket again. In this way, the function executes endlessly.)

Procedure

  1. Log in to the OBS console, and click Create Bucket.
  2. On the Create Bucket page, set the bucket information.

    • For Region, select a region.
    • For Data Redundancy Policy, select Single-AZ storage.
    • For Bucket Name: Enter a custom bucket name, for example, bucket-input-fg.
    • For Default Storage Class, select Standard.
    • For Bucket Policies, select Private.
    • For Server-Side Encryption: select Disable
    • For Direct Reading, select Disable.

    Click Create Now.

  3. Repeat Step 2 to create the destination bucket.

    Name the destination bucket as bucket-output-fg, and select the same region and storage class as those of the source bucket.

  4. View bucket-input-fg and bucket-output-fg in the bucket list.

Creating an Agency

  1. In the left navigation pane of the management console, choose Management & Governance > Identity and Access Management to go to the IAM console. Then choose Agencies in the navigation pane.
  2. On the Agencies page, click Create Agency.
  3. Set the agency information.

    • For Agency Name: Enter an agency name, for example, serverless_trust.
    • For Agency Type, select Cloud service.
    • For Cloud Service, select FunctionGraph.
    • For Validity Period, select Unlimited.
    • For Description: Enter the description.

  4. Click Next. On the Select Policy/Role page, select OBS Administrator.
  5. Click Next, select an authorization scope that meets your service requirements, and click OK.