Updated on 2023-11-21 GMT+08:00

Using an LTS Trigger

For details about the timer event source, see Supported Event Sources.

Prerequisites

Creating an LTS Trigger

  1. Log in to the FunctionGraph console. In the navigation pane, choose Functions > Function List.
  2. Click the function to be configured to go to the function details page.
  3. Choose Configuration > Triggers and click Create Trigger.

    Figure 1 Creating a trigger

  4. 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.

  5. Click OK.

Configuring an LTS Event to Trigger the Function

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.

  1. Return to the FunctionGraph console. In the navigation pane, choose Functions > Function List.
  2. Click the function to be configured to go to the function details page.
  3. On the function details page, select a version.
  4. On the Code tab page, click Test. The Configure Test Event dialog box is displayed.
  5. 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.

  6. Click Test. The function test result is displayed.