ALIYUN::DNS::DomainRecord类型用于添加解析记录。
语法
{
  "Type": "ALIYUN::DNS::DomainRecord",
  "Properties": {
    "RR": String,
    "DomainName": String,
    "Value": String,
    "Priority": Integer,
    "TTL": Integer,
    "Line": String,
    "Type": String
  }
} 属性
| 属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 | 
| RR | String | 是 | 是 | 主机记录。 | 如果要解析 | 
| DomainName | String | 是 | 否 | 域名名称。 | 无 | 
| Value | String | 是 | 是 | 记录值。 | 无 | 
| Priority | Integer | 否 | 是 | MX记录的优先级。 | 无 | 
| TTL | Integer | 否 | 是 | 解析生效时间。 | 默认值:600秒(10分钟)。 更多信息,请参见TTL定义。 | 
| Line | String | 否 | 是 | 解析线路。 | 默认值:default。 | 
| Type | String | 是 | 是 | 解析记录类型。 | 关于取值的更多信息,请参见解析记录类型格式 | 
返回值
Fn::GetAtt
RecordId:解析记录的ID。
示例
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{
  "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"
        ]
      }
    }
  }
}该文章对您有帮助吗?