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
- Log in to the OBS console, and click Create Bucket.
- 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 hugb-bucket-input.
- 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.
- Repeat Step 2 to create the destination bucket.
Name the destination bucket as hugb-bucket-output, and select the same region and storage class as those of the source bucket.
- View hugb-bucket-input and hugb-bucket-output in the bucket list.
Creating an Agency
- 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.
- 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.
- Enter a description.
- 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.
- Select an authorization scope that meets your service requirements, and click OK.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.