ALIYUN::DNS::CacheDomain

更新时间:
复制为 MD 格式

ALIYUN::DNS::CacheDomain类型用于添加 DNS 权威代理域名。

语法

{
  "Type": "ALIYUN::DNS::CacheDomain",
  "Properties": {
    "CacheTtlMin": Integer,
    "CacheTtlMax": Integer,
    "DomainName": String,
    "InstanceId": String,
    "SourceEdns": String,
    "SourceProtocol": String,
    "SourceDnsServer": List,
    "Remark": String
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

CacheTtlMax

Integer

缓存记录的最大TTL值。

范围限制:最小30,最大86400

CacheTtlMin

Integer

缓存记录的最小TTL值。

范围限制:最小30,最大86400

DomainName

String

DNS缓存域的域名。

InstanceId

String

DNS缓存域关联的实例ID。

SourceDnsServer

List

DNS服务器列表。

长度限制:最大100。更多信息,请参考SourceDnsServer属性

SourceEdns

String

是否为源DNS服务器启用EDNS。

允许值:

  • NOT_SUPPORT:不支持,

  • SUPPORT:支持

SourceProtocol

String

DNS服务器使用的协议。

允许值:

  • TCP

  • UDP(默认值)

Remark

String

DNS缓存域的备注。

SourceDnsServer语法

"SourceDnsServer": [
  {
    "Port": String,
    "Host": String
  }
]

SourceDnsServer属性

属性名称

类型

必须

允许更新

描述

约束

Host

String

DNS服务器的主机。

Port

String

DNS服务器的端口。

返回值

Fn::GetAtt

DomainName:DNS缓存的域名。

示例

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  SourceEdns:
    Type: String
    Description:
      en: Whether EDNS is enabled for the source DNS server.
      zh: 是否为源DNS服务器启用EDNS。
    AllowedValues:
      - NOT_SUPPORT
      - SUPPORT
    Required: true
  DomainName:
    Type: String
    Description:
      en: The domain name of the DNS cache domain.
      zh: DNS缓存域的域名。
    Required: true
  InstanceId:
    Type: String
    Description:
      en: The instance ID associated with the DNS cache domain.
      zh: 与DNS缓存域关联的实例ID。
    Required: true
  SourceProtocol:
    Type: String
    Description:
      en: The protocol used by the source DNS server.
      zh: 源DNS服务器使用的协议。
    AllowedValues:
      - UDP
      - TCP
    Required: true
  SourceDnsServer:
    AssociationPropertyMetadata:
      Parameters:
        Port:
          Type: String
          Description:
            en: Port of the source DNS server.
            zh: 源DNS服务器的端口。
          Required: true
        Host:
          Type: String
          Description:
            en: Host of the source DNS server.
            zh: 源DNS服务器的主机。
          Required: true
    AssociationProperty: List[Parameters]
    Type: Json
    Description:
      en: List of source DNS servers.
      zh: 源DNS服务器列表。
    Required: true
    MaxLength: 100
  CacheTtlMin:
    Type: Number
    Description:
      en: The minimum TTL value for cached records.
      zh: 缓存记录的最小TTL值。
    Required: true
    MinValue: 30
    MaxValue: 86400
  CacheTtlMax:
    Type: Number
    Description:
      en: The maximum TTL value for cached records.
      zh: 缓存记录的最大TTL值。
    Required: true
    MinValue: 30
    MaxValue: 86400
Resources:
  CacheDomain:
    Type: ALIYUN::DNS::CacheDomain
    Properties:
      SourceEdns:
        Ref: SourceEdns
      DomainName:
        Ref: DomainName
      InstanceId:
        Ref: InstanceId
      SourceProtocol:
        Ref: SourceProtocol
      SourceDnsServer:
        Ref: SourceDnsServer
      CacheTtlMin:
        Ref: CacheTtlMin
      CacheTtlMax:
        Ref: CacheTtlMax
Outputs:
  DomainName:
    Description:
      en: The domain name of the DNS cache.
      zh: DNS缓存的域名。
    Value:
      Fn::GetAtt:
        - CacheDomain
        - DomainName
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "SourceEdns": {
      "Type": "String",
      "Description": {
        "en": "Whether EDNS is enabled for the source DNS server.",
        "zh": "是否为源DNS服务器启用EDNS。"
      },
      "AllowedValues": [
        "NOT_SUPPORT",
        "SUPPORT"
      ],
      "Required": true
    },
    "DomainName": {
      "Type": "String",
      "Description": {
        "en": "The domain name of the DNS cache domain.",
        "zh": "DNS缓存域的域名。"
      },
      "Required": true
    },
    "InstanceId": {
      "Type": "String",
      "Description": {
        "en": "The instance ID associated with the DNS cache domain.",
        "zh": "与DNS缓存域关联的实例ID。"
      },
      "Required": true
    },
    "SourceProtocol": {
      "Type": "String",
      "Description": {
        "en": "The protocol used by the source DNS server.",
        "zh": "源DNS服务器使用的协议。"
      },
      "AllowedValues": [
        "UDP",
        "TCP"
      ],
      "Required": true
    },
    "SourceDnsServer": {
      "AssociationPropertyMetadata": {
        "Parameters": {
          "Port": {
            "Type": "String",
            "Description": {
              "en": "Port of the source DNS server.",
              "zh": "源DNS服务器的端口。"
            },
            "Required": true
          },
          "Host": {
            "Type": "String",
            "Description": {
              "en": "Host of the source DNS server.",
              "zh": "源DNS服务器的主机。"
            },
            "Required": true
          }
        }
      },
      "AssociationProperty": "List[Parameters]",
      "Type": "Json",
      "Description": {
        "en": "List of source DNS servers.",
        "zh": "源DNS服务器列表。"
      },
      "Required": true,
      "MaxLength": 100
    },
    "CacheTtlMin": {
      "Type": "Number",
      "Description": {
        "en": "The minimum TTL value for cached records.",
        "zh": "缓存记录的最小TTL值。"
      },
      "Required": true,
      "MinValue": 30,
      "MaxValue": 86400
    },
    "CacheTtlMax": {
      "Type": "Number",
      "Description": {
        "en": "The maximum TTL value for cached records.",
        "zh": "缓存记录的最大TTL值。"
      },
      "Required": true,
      "MinValue": 30,
      "MaxValue": 86400
    }
  },
  "Resources": {
    "CacheDomain": {
      "Type": "ALIYUN::DNS::CacheDomain",
      "Properties": {
        "SourceEdns": {
          "Ref": "SourceEdns"
        },
        "DomainName": {
          "Ref": "DomainName"
        },
        "InstanceId": {
          "Ref": "InstanceId"
        },
        "SourceProtocol": {
          "Ref": "SourceProtocol"
        },
        "SourceDnsServer": {
          "Ref": "SourceDnsServer"
        },
        "CacheTtlMin": {
          "Ref": "CacheTtlMin"
        },
        "CacheTtlMax": {
          "Ref": "CacheTtlMax"
        }
      }
    }
  },
  "Outputs": {
    "DomainName": {
      "Description": {
        "en": "The domain name of the DNS cache.",
        "zh": "DNS缓存的域名。"
      },
      "Value": {
        "Fn::GetAtt": [
          "CacheDomain",
          "DomainName"
        ]
      }
    }
  }
}