ALIYUN::DNS::DomainRecord类型用于添加解析记录。

语法

{
  "Type": "ALIYUN::DNS::DomainRecord",
  "Properties": {
    "RR": String,
    "DomainName": String,
    "Value": String,
    "Priority": Integer,
    "TTL": Integer,
    "Line": String,
    "Type": String
  }
} 

属性

属性名称类型必须允许更新描述约束
RRString主机记录。如果要解析@.example.com,主机记录要填写@,而不是空。
DomainNameString域名名称。
ValueString记录值。
PriorityIntegerMX记录的优先级。
TTLInteger解析生效时间。默认值:600秒(10分钟)。

更多信息,请参见TTL定义

LineString解析线路。默认值:default。
TypeString解析记录类型。关于取值的更多信息,请参见解析记录类型格式

返回值

Fn::GetAtt

RecordId:解析记录的ID。

示例

  • YAML格式

    ROSTemplateFormatVersion: '2015-09-01'
    Resources:
      DomainRecord:
        Type: ALIYUN::DNS::DomainRecord
        Properties:
          RR: '@'
          Type: A
          DomainName:
            Ref: DnsDomainName
          Value:
            Fn::Select:
              - '0'
              - Fn::GetAtt:
                  - Server
                  - PublicIps
          TTL: 600
    Outputs:
      RecordId:
        Description: Parse the ID of the record
        Value:
          Fn::GetAtt:
            - DomainRecord
            - RecordId
  • JSON格式

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Resources": {
        "DomainRecord": {
          "Type": "ALIYUN::DNS::DomainRecord",
          "Properties": {
            "RR": "@",
            "Type": "A",
            "DomainName": {
              "Ref": "DnsDomainName"
            },
            "Value": {
              "Fn::Select": [
                "0",
                {
                  "Fn::GetAtt": [
                    "Server",
                    "PublicIps"
                  ]
                }
              ]
            },
            "TTL": 600
          }
        }
      },
      "Outputs": {
        "RecordId": {
          "Description": "Parse the ID of the record",
          "Value": {
            "Fn::GetAtt": [
              "DomainRecord",
              "RecordId"
            ]
          }
        }
      }
    }