Preparation
When creating a function on the FunctionGraph console, ensure that the size of the ZIP file to be uploaded does not exceed 50 MB. If it exceeds 50 MB, upload the ZIP file to an OBS bucket and then reference the file from the bucket. In this example, you need to create an OBS bucket to save the program package.
Additionally, you need to create a DMS queue and consumer group before adding an event source to the function.
After creating the OBS bucket, you must create an agency to delegate FunctionGraph to access DMS resources.
Creating an OBS bucket
- 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 obs-mycode.
For Storage Class, select Standard.
For Bucket Policy, select Private.
- Click Create Now.
Creating a DMS Queue and Consumer Group
Creating a Queue
- Log in to the DMS console, and choose Queue Manager in the navigation pane.
- On the Queue Manager page, click Create Queue.
- In the Create Queue dialog box, set the queue information according to Table 1. The parameter marked with an asterisk (*) is mandatory.
- Click OK.
Creating a Consumer Group
- On the Queue Manager page, click queue-test.
- Click Create Consumer Group, as shown in Figure 2.
- In the Create Consumer Group dialog box, enter a consumer group name according to Table 2. The parameter marked with an asterisk (*) is mandatory.
- Click OK. The consumer group is created as shown in Figure 3.
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_dms.
- 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, as shown in Figure 4.
Users with the Tenant Administrator permission can perform any operations on all cloud resources in the current region.
- 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.