ALIYUN::ARMS::AlertContact类型用于创建报警联系人。

语法

{
  "Type": "ALIYUN::ARMS::AlertContact",
  "Properties": {
    "DingRobotWebhookUrl": String,
    "PhoneNum": String,
    "RegionId": String,
    "SystemNoc": Boolean,
    "ContactName": String,
    "Email": String
  }
}

属性

属性名称 类型 必须 允许更新 描述 约束
DingRobotWebhookUrl String 钉钉机器人Webhook URL。

获取方式请参见获取自定义机器人webhook

钉钉机器人安全设置中的自定义关键词请填写“报警”。
Email String 报警联系人邮箱
PhoneNum String 报警联系人手机号码 邮箱地址、手机号码和钉钉机器人Webhook URL这三种联系方式必须至少填写一种。
RegionId String 地域ID。默认为资源栈的地域ID。 取值:
  • cn-qingdao
  • cn-beijing
  • cn-shanghai
  • cn-hangzhou
  • cn-shenzhen
  • cn-hongkong
  • ap-southeast-1
SystemNoc Boolean 是否接收系统通知
ContactName String 报警联系人姓名

返回值

Fn::GetAtt

ContactId:报警联系人ID。

示例

JSON格式

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Resources": {
    "AlertContact": {
      "Type": "ALIYUN::ARMS::AlertContact",
      "Properties": {
        "PhoneNum": {
          "Ref": "PhoneNum"
        },
        "RegionId": {
          "Ref": "RegionId"
        },
        "SystemNoc": {
          "Ref": "SystemNoc"
        },
        "DingRobotWebhookUrl": {
          "Ref": "DingRobotWebhookUrl"
        },
        "ContactName": {
          "Ref": "ContactName"
        },
        "Email": {
          "Ref": "Email"
        }
      }
    }
  },
  "Parameters": {
    "PhoneNum": {
      "Type": "String",
      "Description": "The phone number of the contact."
    },
    "RegionId": {
      "Type": "String",
      "Description": "Region ID. Default to region of stack.",
      "AllowedValues": [
        "cn-qingdao",
        "cn-beijing",
        "cn-shanghai",
        "cn-hangzhou",
        "cn-shenzhen",
        "cn-hongkong",
        "ap-southeast-1"
      ]
    },
    "SystemNoc": {
      "Type": "Boolean",
      "Description": "Specifies whether to receive system alerts.",
      "AllowedValues": [
        "True",
        "true",
        "False",
        "false"
      ]
    },
    "DingRobotWebhookUrl": {
      "Type": "String",
      "Description": "The DingTalk Chatbot address of the contact."
    },
    "ContactName": {
      "Type": "String",
      "Description": "The name of the alert contact that you want to create."
    },
    "Email": {
      "Type": "String",
      "Description": "The email address of the contact."
    }
  },
  "Outputs": {
    "ContactId": {
      "Description": "The ID of the alert contact that you created.",
      "Value": {
        "Fn::GetAtt": [
          "AlertContact",
          "ContactId"
        ]
      }
    }
  }
}

YAML格式

ROSTemplateFormatVersion: '2015-09-01'
Resources:
  AlertContact:
    Type: 'ALIYUN::ARMS::AlertContact'
    Properties:
      PhoneNum:
        Ref: PhoneNum
      RegionId:
        Ref: RegionId
      SystemNoc:
        Ref: SystemNoc
      DingRobotWebhookUrl:
        Ref: DingRobotWebhookUrl
      ContactName:
        Ref: ContactName
      Email:
        Ref: Email
Parameters:
  PhoneNum:
    Type: String
    Description: The phone number of the contact.
  RegionId:
    Type: String
    Description: Region ID. Default to region of stack.
    AllowedValues:
      - cn-qingdao
      - cn-beijing
      - cn-shanghai
      - cn-hangzhou
      - cn-shenzhen
      - cn-hongkong
      - ap-southeast-1
  SystemNoc:
    Type: Boolean
    Description: Specifies whether to receive system alerts.
    AllowedValues:
      - 'True'
      - 'true'
      - 'False'
      - 'false'
  DingRobotWebhookUrl:
    Type: String
    Description: The DingTalk Chatbot address of the contact.
  ContactName:
    Type: String
    Description: The name of the alert contact that you want to create.
  Email:
    Type: String
    Description: The email address of the contact.
Outputs:
  ContactId:
    Description: The ID of the alert contact that you created.
    Value:
      'Fn::GetAtt':
        - AlertContact
        - ContactId