All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::DNS::DomainRecord

Last Updated:Dec 31, 2024

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

Property

Type

Required

Editable

Description

Constraint

RR

String

Yes

Yes

The hostname field in the DNS record.

If you want to resolve @.example.com, you must specify an at sign (@) for this property instead of leaving this property empty.

DomainName

String

Yes

No

The domain name.

None.

Value

String

Yes

Yes

The record value.

None.

Priority

Integer

No

Yes

The priority of the mail exchanger (MX) record.

None.

TTL

Integer

No

Yes

The time to live (TTL) of the DNS record.

Default value: 600. Unit: seconds. The default value is equivalent to 10 minutes.

For more information, see TTL definition.

Line

String

No

Yes

The DNS resolution line.

Default value: default.

Type

String

Yes

Yes

The type of the DNS record.

For more information, see DNS record types.

Return values

Fn::GetAtt

RecordId: the ID of the DNS record.

Examples

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