Updated on 2024-11-15 GMT+08:00

Preparation

Enabling CTS

Configure a tracker on CTS, as shown in Figure 1. For details, see Configuring a Tracker.

Figure 1 Configuring a tracker

Creating an Agency

  1. Log in to the IAM console, and choose Agencies in the navigation pane.
  2. On the Agencies page, click Create Agency.
  3. Set the agency information.

    • For Agency Name: Enter an agency name, for example, serverless_trust.
    • For Agency Type, select Cloud service.
    • For Cloud Service, select FunctionGraph.
    • For Validity Period, select Unlimited.
    • For Description, enter a description.

  4. Click Next. On the Select Policy/Role page, select CTS Administrator and SMN Administrator.

    • SMN Administrator: Users with this permission can perform any operation on SMN resources.
    • CTS Administrator depends on Tenant Guest. When you select the former, the latter will also be selected.

  5. Click Next, select an authorization scope that meets your service requirements, and click OK.

Pushing Alarm Messages

  • Create a topic named cts_test on the SMN console. For details, see Creating a Topic.
  • Add subscriptions to the cts_test topic to push alarm messages. For details, see Adding a Subscription.

    Alarm messages of a subscribed topic can be pushed through emails, SMS messages, and HTTP/HTTPS.

    In this example, when operation log events trigger the specified function, the function filters operations that are performed by users not in the IP address whitelist, and pushes alarm messages to the subscription endpoints.