ALIYUN::DNS::DomainRecord

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

语法

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

属性

属性名称

类型

必须

允许更新

描述

约束

RR

String

主机记录。

如果要解析@.example.com,主机记录要填写@,而不是空。

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"
        ]
      }
    }
  }
}