Using an LTS Trigger
Prerequisites
- You have created a function. For details, see Creating a Function from Scratch.
- You have created an agency with the LTS FullAccess permission. For details about how to create an agency, see Configuring Agency Permissions.
- You have created a log group, for example, LogGroup1. For details, see Creating a Log Group.
- You have created a log stream, for example, LogTopic1. For details, see Creating a Log Stream.
Creating an LTS Trigger
- Log in to the FunctionGraph console. In the navigation pane, choose Functions > Function List.
- Click the function to be configured to go to the function details page.
- Choose Configuration > Triggers and click Create Trigger.
Figure 1 Creating a trigger
- Set the following parameters:
- Trigger Type: Select Log Tank Service (LTS).
- Log Group: Select a log group, for example, LogGroup1.
- Log Stream: Select a log stream, for example, LogStream1.
- Click OK.
Configuring an LTS Event to Trigger the Function
![](https://support.huaweicloud.com/intl/en-us/my-kualalumpur-1-usermanual-functiongraph/public_sys-resources/note_3.0-en-us.png)
When the size of an LTS event message exceeds 75 KB, it will be split into multiple messages by 75 KB to trigger the function.
- Return to the FunctionGraph console. In the navigation pane, choose Functions > Function List.
- Click the function to be configured to go to the function details page.
- On the function details page, select a version.
- On the Code tab page, click Test. The Configure Test Event dialog box is displayed.
- Set the parameters described in Table 1 and click Save.
Table 1 Test event information Parameter
Description
Configure Test Event
You can choose to create a test event or edit an existing one.
Use the default option Create new test event.
Event Template
Select lts-event-template.
Event Name
The event name can contain 1 to 25 characters and must start with a letter and end with a letter or digit. Only letters, digits, underscores (_), and hyphens (-) are allowed. For example, lts-123test.
Event data
The system automatically loads the built-in LTS event template, which is used in this example without modifications.
- Click Test. The function test result is displayed.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot