ALIYUN::DNS::DomainRecord is used to add a domain name system (DNS) record.

Syntax

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

Properties

PropertyTypeRequiredEditableDescriptionConstraint
RRStringYesNoThe hostname. For example, you must set this parameter to an at sign (@) if you want to resolve @.example.com. You cannot leave this parameter empty.
DomainNameStringYesNoThe domain name. None.
ValueStringYesNoThe value of the DNS record. None.
PriorityIntegerNoYesThe priority of the mail exchanger (MX) record. None.
TTLIntegerNoYesThe time to live (TTL) of the DNS record. Default value: 600. Unit: seconds.

For more information, see TTL.

LineStringNoYesThe resolution line. Default value: default.
TypeStringYesNoThe type of the DNS record. For more information about DNS record types, see DNS record types.

Response parameters

Fn::GetAtt

RecordId: the ID of the DNS record.

Examples

  • YAMLformat

    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
  • JSONformat

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