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
- 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 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.
- 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.
- View your-bucket-input and your-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.