Send event notifications using Short Message Service

Updated at:

This topic describes how to configure event rules to automatically send event notifications using Short Message Service. This helps you stay informed about E-HPC cluster events and respond promptly.

Background information

E-HPC integrates with EventBridge to deliver operational events from your clusters and nodes to a dedicated event bus, allowing you to receive, query, and consume them. You can configure event rules to send SMS notifications for these events to specified mobile numbers, ensuring you are promptly informed of any activity.

手机通知

Important

Using Short Message Service incurs charges. For more information, see Billing overview of Short Message Service.

Prerequisites

Before you begin, complete the following prerequisites:

Step 1: Add SMS signature and template

  1. Log in to the Short Message Service console.

  2. In the left-side navigation pane, choose Domestic Messages > Signature Management.

  3. Add an SMS signature.

    1. On the Signature Management tab, click Add Signature.

    2. Enter the signature application information and click Submit.

      When you fill in the signature information, follow the specifications in SMS signature specifications. For more information, see Add a signature.

    3. Wait for the signature to be approved and note its name.

  4. In the left-side navigation pane, choose Domestic Messages > Template Management.

  5. Add an SMS template.

    1. On the Template Management tab, click Add Template.

    2. Fill in the template information and click Add.

      Ensure the template information complies with the SMS template specifications.

      For more information, see Add a template.

    3. Wait for the template to be approved and note the template code.

Step 2: Configure an E-HPC event rule

  1. Log in to the EventBridge console.

  2. In the left-side navigation pane, click Event Buses.

  3. In the top navigation bar, select a region.

  4. On the Event Buses page, click default to open its configuration page.

  5. In the left-side navigation pane, click Event Rules, and then click Create Rule.

  6. In the Create Rule panel, configure the rule.

    1. On the Configure Basic Information page, enter a name and description, and then click Next.

    2. On the Configure Event Pattern page, configure the following parameters and click Next.

      The following table describes the parameters.

      • Event Source Type: Select Alibaba Cloud Service Event Sources.

      • Event Source: Select acs.ehpc.

      • Event Type: Select an event. This topic uses ehpc:NodeOperation:NodeCreate as an example. For a list of all supported E-HPC events, see Elastic High Performance Computing (E-HPC) events.

  7. On the Configure Event Target page, configure the following parameters and click Create.

    The first time you perform this operation, you must grant EventBridge permission to access audit logs.

    The following table describes the parameters.

    • Service Type: Select Short Message Service.

    • Mobile Number: Select Fixed Value and enter the recipient's mobile number.

    • Signature Name: Enter the name of the SMS signature you created in Step 1.

    • Template CODE: Enter the template code of the SMS template you created in Step 1.

    • Push Content: The following example configures the content for a cluster scale-out event. For more information, see Event transformation.

      • Variable

        {
          "clusterId":"$.data.ClusterId",
          "jobQueue": "$.data.JobQueue",
          "count": "$.data.Count",
          "instanceType": "$.data.InstanceType"
        }
      • Template

        {
          "clusterId":"${clusterId}",
          "action":"Scale-out operation: ${count} ${instanceType} nodes have been added to the ${jobQueue} queue."
        }

Verify the results

The event rule configured in Step 2, for the event ehpc:NodeOperation:NodeCreate, triggers an SMS notification when you add nodes to scale out a cluster. To verify this, perform the following steps:

  1. Manually scale out nodes for a cluster. For more information, see Scale out a cluster.

  2. Check the SMS notification on the specified mobile number.