You can import contacts from CloudMonitor to the alerting system of Log Service.

Prerequisites

If you use a Resource Access Management (RAM) user, make sure that the RAM user is granted the required permissions to read contacts from CloudMonitor. You can grant permissions to a RAM user in one of the following modes:

In simple mode, a system policy is used to grant permissions. This mode allows you to grant permissions in a convenient manner. However, if you use this mode, more permissions may be granted to the RAM user than necessary. To grant permissions to a RAM user in simple mode, perform the following steps:

  1. Log on to the RAM console.
  2. In the left-side navigation pane, choose Identities > Users.
  3. On the Users page, find the RAM user to which you want to grant permissions and click Add Permissions in the Actions column.
  4. In the Add Permissions panel, click System Policy in the Select Policy section, click the AliyunCloudMonitorReadOnlyAccess policy, and then click OK.
  5. Click Complete.

In custom mode, a custom policy is used to grant permissions. This mode follows the principle of least privilege (POLP). However, this mode requires complex configurations. To grant permissions to a RAM user in custom mode, perform the following steps:

  1. Log on to the RAM console.
  2. Create a custom policy.
    1. In the left-side navigation pane, choose Permissions > Policies.
    2. On the Policies page, click Create Policy.
    3. On the Create Custom Policy page, configure the parameters and click OK. The following table describes the parameters.
      Parameter Description
      Policy Name The name of the policy. Example: CloudMonitorDescribeContacts.
      Configuration Mode Select Script.
      Policy Document The content of the policy. Replace the content in the editor with the following script:
      {   
          "Version": "1",
          "Statement": [{
              "Action": [
                  "cms:DescribeContactList",
                  "cms:DescribeContactGroupList"
              ],
              "Resource": "*",
              "Effect": "Allow"
          }]
      }
  3. Grant the permissions to the RAM user.
    1. In the left-side navigation pane, choose Identities > Users.
    2. On the Users page, find the RAM user to which you want to grant permissions and click Add Permissions in the Actions column.
    3. In the Add Permissions panel, click Custom Policy in the Select Policy section, click the CloudMonitorDescribeContacts policy, and then click OK.
    4. Click Complete.

Procedure

  1. Log on to the Log Service console.
  2. Go to the User Management page.
    1. In the Projects section, click the name of the project that you want to view.
    2. In the left-side navigation pane, click Alerts.
    3. On the Alert Center page, choose Alert Management > User Management.
  3. On the User Management page, choose Import Contacts > Import from CloudMonitor.
  4. In the Import from CloudMonitor dialog box, click Preview.
  5. Verify the contacts and click Import.

    If you select Import Webhook at the Same Time, you can also import the webhooks from CloudMonitor to the alerting system of Log Service.

    Import contacts