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
- Ensure that the source bucket for storing uploaded images, the target bucket for storing processed images, and the function you will create are in the same region. In this tutorial, all of them are in CN North-Beijing1, the default region where FunctionGraph resides.
- 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
- Log in to the OBS console, and click Create Bucket.
- On the Create Bucket page, set the bucket information, as shown in Figure 1.
For Region, select a region.
For Bucket Name, enter your-bucket-input.
For Storage Class, select Standard.
For Bucket Policy, select Private.
Click Create Now.
- Repeat 2 to create the target bucket.
Name the target bucket as your-bucket-output, and select the same region and storage class as those of the source bucket.
- After creation, check whether the two buckets are displayed in the bucket list, as shown in Figure 2.
Creating an Agency
- Log in to the IAM console, and choose Agencies in the navigation pane.
- On the Agencies page, click Create Agency.
- 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.
- Click Assign Permissions. On the Assign Permissions page, select Tenant Administrator.
Figure 3 Creating an agency
Users with the Tenant Administrator permission can perform any operations on all cloud resources of the enterprise.
- Click OK.
Last Article: Introduction
Next Article: Building a Program


Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.