Updated on 2023-11-15 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 compressed 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 Bucket Name, enter your-bucket-input.
    • For Data Redundancy Policy, select Single-AZ storage.
    • For Default Storage Class, select Standard.
    • For Bucket Policies, select Private.
    • Server-Side Encryption: Select Disable.
    • For Direct Reading, select Disable.

    Retain the default values for other parameters and click Create Now.

  3. Repeat 2 to create the destination bucket.

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

  4. View your-bucket-input and your-bucket-output 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 serverless_trust.
    • For Agency Type, select Cloud service.
    • For Cloud Service, select FunctionGraph.
    • For Validity Period, select Unlimited.
    • Enter a description.

  4. Click Next. On the Select Policy/Role page, select Tenant Administrator and click Next.

    Users with the Tenant Administrator permission can perform any operations on all cloud resources of the enterprise.

  5. Select an authorization scope that meets your service requirements, and click OK.