alicloud logo
Alibaba Cloud v3.34.0, Mar 17 23

alicloud.dns.getAlidnsRecords

This data source provides a list of Alidns Domain Records in an Alibaba Cloud account according to the specified filters.

NOTE: Available in 1.86.0+.

Example Usage

using System.Collections.Generic;
using Pulumi;
using AliCloud = Pulumi.AliCloud;

return await Deployment.RunAsync(() => 
{
    var recordsDs = AliCloud.Dns.GetAlidnsRecords.Invoke(new()
    {
        DomainName = "xiaozhu.top",
        Ids = new[]
        {
            "1978593525779****",
        },
        OutputFile = "records.txt",
        Type = "A",
    });

    return new Dictionary<string, object?>
    {
        ["firstRecordId"] = recordsDs.Apply(getAlidnsRecordsResult => getAlidnsRecordsResult.Records[0]?.RecordId),
    };
});
package main

import (
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/dns"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		recordsDs, err := dns.GetAlidnsRecords(ctx, &dns.GetAlidnsRecordsArgs{
			DomainName: "xiaozhu.top",
			Ids: []string{
				"1978593525779****",
			},
			OutputFile: pulumi.StringRef("records.txt"),
			Type:       pulumi.StringRef("A"),
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("firstRecordId", recordsDs.Records[0].RecordId)
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.dns.DnsFunctions;
import com.pulumi.alicloud.dns.inputs.GetAlidnsRecordsArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var recordsDs = DnsFunctions.getAlidnsRecords(GetAlidnsRecordsArgs.builder()
            .domainName("xiaozhu.top")
            .ids("1978593525779****")
            .outputFile("records.txt")
            .type("A")
            .build());

        ctx.export("firstRecordId", recordsDs.applyValue(getAlidnsRecordsResult -> getAlidnsRecordsResult.records()[0].recordId()));
    }
}
import pulumi
import pulumi_alicloud as alicloud

records_ds = alicloud.dns.get_alidns_records(domain_name="xiaozhu.top",
    ids=["1978593525779****"],
    output_file="records.txt",
    type="A")
pulumi.export("firstRecordId", records_ds.records[0].record_id)
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const recordsDs = alicloud.dns.getAlidnsRecords({
    domainName: "xiaozhu.top",
    ids: ["1978593525779****"],
    outputFile: "records.txt",
    type: "A",
});
export const firstRecordId = recordsDs.then(recordsDs => recordsDs.records?.[0]?.recordId);
variables:
  recordsDs:
    fn::invoke:
      Function: alicloud:dns:getAlidnsRecords
      Arguments:
        domainName: xiaozhu.top
        ids:
          - 1978593525779****
        outputFile: records.txt
        type: A
outputs:
  firstRecordId: ${recordsDs.records[0].recordId}

Using getAlidnsRecords

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getAlidnsRecords(args: GetAlidnsRecordsArgs, opts?: InvokeOptions): Promise<GetAlidnsRecordsResult>
function getAlidnsRecordsOutput(args: GetAlidnsRecordsOutputArgs, opts?: InvokeOptions): Output<GetAlidnsRecordsResult>
def get_alidns_records(direction: Optional[str] = None,
                       domain_name: Optional[str] = None,
                       group_id: Optional[int] = None,
                       ids: Optional[Sequence[str]] = None,
                       key_word: Optional[str] = None,
                       lang: Optional[str] = None,
                       line: Optional[str] = None,
                       order_by: Optional[str] = None,
                       output_file: Optional[str] = None,
                       rr_key_word: Optional[str] = None,
                       rr_regex: Optional[str] = None,
                       search_mode: Optional[str] = None,
                       status: Optional[str] = None,
                       type: Optional[str] = None,
                       type_key_word: Optional[str] = None,
                       value_key_word: Optional[str] = None,
                       value_regex: Optional[str] = None,
                       opts: Optional[InvokeOptions] = None) -> GetAlidnsRecordsResult
def get_alidns_records_output(direction: Optional[pulumi.Input[str]] = None,
                       domain_name: Optional[pulumi.Input[str]] = None,
                       group_id: Optional[pulumi.Input[int]] = None,
                       ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                       key_word: Optional[pulumi.Input[str]] = None,
                       lang: Optional[pulumi.Input[str]] = None,
                       line: Optional[pulumi.Input[str]] = None,
                       order_by: Optional[pulumi.Input[str]] = None,
                       output_file: Optional[pulumi.Input[str]] = None,
                       rr_key_word: Optional[pulumi.Input[str]] = None,
                       rr_regex: Optional[pulumi.Input[str]] = None,
                       search_mode: Optional[pulumi.Input[str]] = None,
                       status: Optional[pulumi.Input[str]] = None,
                       type: Optional[pulumi.Input[str]] = None,
                       type_key_word: Optional[pulumi.Input[str]] = None,
                       value_key_word: Optional[pulumi.Input[str]] = None,
                       value_regex: Optional[pulumi.Input[str]] = None,
                       opts: Optional[InvokeOptions] = None) -> Output[GetAlidnsRecordsResult]
func GetAlidnsRecords(ctx *Context, args *GetAlidnsRecordsArgs, opts ...InvokeOption) (*GetAlidnsRecordsResult, error)
func GetAlidnsRecordsOutput(ctx *Context, args *GetAlidnsRecordsOutputArgs, opts ...InvokeOption) GetAlidnsRecordsResultOutput

> Note: This function is named GetAlidnsRecords in the Go SDK.

public static class GetAlidnsRecords 
{
    public static Task<GetAlidnsRecordsResult> InvokeAsync(GetAlidnsRecordsArgs args, InvokeOptions? opts = null)
    public static Output<GetAlidnsRecordsResult> Invoke(GetAlidnsRecordsInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetAlidnsRecordsResult> getAlidnsRecords(GetAlidnsRecordsArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
  function: alicloud:dns/getAlidnsRecords:getAlidnsRecords
  arguments:
    # arguments dictionary

The following arguments are supported:

DomainName string

The domain name associated to the records.

Direction string

Sorting direction. Valid values: DESC,ASC. Default to AESC.

GroupId int

Domain name group ID.

Ids List<string>

A list of record IDs.

KeyWord string

Keywords.

Lang string

User language.

Line string

ISP line. For checking all resolution lines enumeration please visit Alibaba Cloud DNS doc

OrderBy string

Sort by. Sort from newest to oldest according to the time added by resolution.

OutputFile string
RrKeyWord string

The keywords recorded by the host are searched according to the %RRKeyWord% mode, and are not case sensitive.

RrRegex string

Host record regex.

SearchMode string

Search mode, Valid values: LIKE, EXACT, ADVANCED, LIKE (fuzzy), EXACT (accurate) search supports KeyWord field, ADVANCED (advanced) mode supports other fields.

Status string

Record status. Valid values: ENABLE and DISABLE.

Type string

Record type. Valid values: A, NS, MX, TXT, CNAME, SRV, AAAA, REDIRECT_URL, FORWORD_URL .

TypeKeyWord string

Analyze type keywords, search by full match, not case sensitive.

ValueKeyWord string

The keywords of the recorded value are searched according to the %ValueKeyWord% mode, and are not case sensitive.

ValueRegex string

Host record value regex.

DomainName string

The domain name associated to the records.

Direction string

Sorting direction. Valid values: DESC,ASC. Default to AESC.

GroupId int

Domain name group ID.

Ids []string

A list of record IDs.

KeyWord string

Keywords.

Lang string

User language.

Line string

ISP line. For checking all resolution lines enumeration please visit Alibaba Cloud DNS doc

OrderBy string

Sort by. Sort from newest to oldest according to the time added by resolution.

OutputFile string
RrKeyWord string

The keywords recorded by the host are searched according to the %RRKeyWord% mode, and are not case sensitive.

RrRegex string

Host record regex.

SearchMode string

Search mode, Valid values: LIKE, EXACT, ADVANCED, LIKE (fuzzy), EXACT (accurate) search supports KeyWord field, ADVANCED (advanced) mode supports other fields.

Status string

Record status. Valid values: ENABLE and DISABLE.

Type string

Record type. Valid values: A, NS, MX, TXT, CNAME, SRV, AAAA, REDIRECT_URL, FORWORD_URL .

TypeKeyWord string

Analyze type keywords, search by full match, not case sensitive.

ValueKeyWord string

The keywords of the recorded value are searched according to the %ValueKeyWord% mode, and are not case sensitive.

ValueRegex string

Host record value regex.

domainName String

The domain name associated to the records.

direction String

Sorting direction. Valid values: DESC,ASC. Default to AESC.

groupId Integer

Domain name group ID.

ids List<String>

A list of record IDs.

keyWord String

Keywords.

lang String

User language.

line String

ISP line. For checking all resolution lines enumeration please visit Alibaba Cloud DNS doc

orderBy String

Sort by. Sort from newest to oldest according to the time added by resolution.

outputFile String
rrKeyWord String

The keywords recorded by the host are searched according to the %RRKeyWord% mode, and are not case sensitive.

rrRegex String

Host record regex.

searchMode String

Search mode, Valid values: LIKE, EXACT, ADVANCED, LIKE (fuzzy), EXACT (accurate) search supports KeyWord field, ADVANCED (advanced) mode supports other fields.

status String

Record status. Valid values: ENABLE and DISABLE.

type String

Record type. Valid values: A, NS, MX, TXT, CNAME, SRV, AAAA, REDIRECT_URL, FORWORD_URL .

typeKeyWord String

Analyze type keywords, search by full match, not case sensitive.

valueKeyWord String

The keywords of the recorded value are searched according to the %ValueKeyWord% mode, and are not case sensitive.

valueRegex String

Host record value regex.

domainName string

The domain name associated to the records.

direction string

Sorting direction. Valid values: DESC,ASC. Default to AESC.

groupId number

Domain name group ID.

ids string[]

A list of record IDs.

keyWord string

Keywords.

lang string

User language.

line string

ISP line. For checking all resolution lines enumeration please visit Alibaba Cloud DNS doc

orderBy string

Sort by. Sort from newest to oldest according to the time added by resolution.

outputFile string
rrKeyWord string

The keywords recorded by the host are searched according to the %RRKeyWord% mode, and are not case sensitive.

rrRegex string

Host record regex.

searchMode string

Search mode, Valid values: LIKE, EXACT, ADVANCED, LIKE (fuzzy), EXACT (accurate) search supports KeyWord field, ADVANCED (advanced) mode supports other fields.

status string

Record status. Valid values: ENABLE and DISABLE.

type string

Record type. Valid values: A, NS, MX, TXT, CNAME, SRV, AAAA, REDIRECT_URL, FORWORD_URL .

typeKeyWord string

Analyze type keywords, search by full match, not case sensitive.

valueKeyWord string

The keywords of the recorded value are searched according to the %ValueKeyWord% mode, and are not case sensitive.

valueRegex string

Host record value regex.

domain_name str

The domain name associated to the records.

direction str

Sorting direction. Valid values: DESC,ASC. Default to AESC.

group_id int

Domain name group ID.

ids Sequence[str]

A list of record IDs.

key_word str

Keywords.

lang str

User language.

line str

ISP line. For checking all resolution lines enumeration please visit Alibaba Cloud DNS doc

order_by str

Sort by. Sort from newest to oldest according to the time added by resolution.

output_file str
rr_key_word str

The keywords recorded by the host are searched according to the %RRKeyWord% mode, and are not case sensitive.

rr_regex str

Host record regex.

search_mode str

Search mode, Valid values: LIKE, EXACT, ADVANCED, LIKE (fuzzy), EXACT (accurate) search supports KeyWord field, ADVANCED (advanced) mode supports other fields.

status str

Record status. Valid values: ENABLE and DISABLE.

type str

Record type. Valid values: A, NS, MX, TXT, CNAME, SRV, AAAA, REDIRECT_URL, FORWORD_URL .

type_key_word str

Analyze type keywords, search by full match, not case sensitive.

value_key_word str

The keywords of the recorded value are searched according to the %ValueKeyWord% mode, and are not case sensitive.

value_regex str

Host record value regex.

domainName String

The domain name associated to the records.

direction String

Sorting direction. Valid values: DESC,ASC. Default to AESC.

groupId Number

Domain name group ID.

ids List<String>

A list of record IDs.

keyWord String

Keywords.

lang String

User language.

line String

ISP line. For checking all resolution lines enumeration please visit Alibaba Cloud DNS doc

orderBy String

Sort by. Sort from newest to oldest according to the time added by resolution.

outputFile String
rrKeyWord String

The keywords recorded by the host are searched according to the %RRKeyWord% mode, and are not case sensitive.

rrRegex String

Host record regex.

searchMode String

Search mode, Valid values: LIKE, EXACT, ADVANCED, LIKE (fuzzy), EXACT (accurate) search supports KeyWord field, ADVANCED (advanced) mode supports other fields.

status String

Record status. Valid values: ENABLE and DISABLE.

type String

Record type. Valid values: A, NS, MX, TXT, CNAME, SRV, AAAA, REDIRECT_URL, FORWORD_URL .

typeKeyWord String

Analyze type keywords, search by full match, not case sensitive.

valueKeyWord String

The keywords of the recorded value are searched according to the %ValueKeyWord% mode, and are not case sensitive.

valueRegex String

Host record value regex.

getAlidnsRecords Result

The following output properties are available:

DomainName string

Name of the domain record belongs to.

Id string

The provider-assigned unique ID for this managed resource.

Ids List<string>

A list of record IDs.

Records List<Pulumi.AliCloud.Dns.Outputs.GetAlidnsRecordsRecord>

A list of records. Each element contains the following attributes:

Direction string
GroupId int
KeyWord string
Lang string
Line string

ISP line of the record.

OrderBy string
OutputFile string
RrKeyWord string
RrRegex string
SearchMode string
Status string

Status of the record.

Type string

Type of the record.

TypeKeyWord string
ValueKeyWord string
ValueRegex string
DomainName string

Name of the domain record belongs to.

Id string

The provider-assigned unique ID for this managed resource.

Ids []string

A list of record IDs.

Records []GetAlidnsRecordsRecord

A list of records. Each element contains the following attributes:

Direction string
GroupId int
KeyWord string
Lang string
Line string

ISP line of the record.

OrderBy string
OutputFile string
RrKeyWord string
RrRegex string
SearchMode string
Status string

Status of the record.

Type string

Type of the record.

TypeKeyWord string
ValueKeyWord string
ValueRegex string
domainName String

Name of the domain record belongs to.

id String

The provider-assigned unique ID for this managed resource.

ids List<String>

A list of record IDs.

records List<GetAliRecordsRecord>

A list of records. Each element contains the following attributes:

direction String
groupId Integer
keyWord String
lang String
line String

ISP line of the record.

orderBy String
outputFile String
rrKeyWord String
rrRegex String
searchMode String
status String

Status of the record.

type String

Type of the record.

typeKeyWord String
valueKeyWord String
valueRegex String
domainName string

Name of the domain record belongs to.

id string

The provider-assigned unique ID for this managed resource.

ids string[]

A list of record IDs.

records GetAlidnsRecordsRecord[]

A list of records. Each element contains the following attributes:

direction string
groupId number
keyWord string
lang string
line string

ISP line of the record.

orderBy string
outputFile string
rrKeyWord string
rrRegex string
searchMode string
status string

Status of the record.

type string

Type of the record.

typeKeyWord string
valueKeyWord string
valueRegex string
domain_name str

Name of the domain record belongs to.

id str

The provider-assigned unique ID for this managed resource.

ids Sequence[str]

A list of record IDs.

records Sequence[GetAlidnsRecordsRecord]

A list of records. Each element contains the following attributes:

direction str
group_id int
key_word str
lang str
line str

ISP line of the record.

order_by str
output_file str
rr_key_word str
rr_regex str
search_mode str
status str

Status of the record.

type str

Type of the record.

type_key_word str
value_key_word str
value_regex str
domainName String

Name of the domain record belongs to.

id String

The provider-assigned unique ID for this managed resource.

ids List<String>

A list of record IDs.

records List<Property Map>

A list of records. Each element contains the following attributes:

direction String
groupId Number
keyWord String
lang String
line String

ISP line of the record.

orderBy String
outputFile String
rrKeyWord String
rrRegex String
searchMode String
status String

Status of the record.

type String

Type of the record.

typeKeyWord String
valueKeyWord String
valueRegex String

Supporting Types

GetAlidnsRecordsRecord

DomainName string

The domain name associated to the records.

Id string

ID of the resource.

Line string

ISP line. For checking all resolution lines enumeration please visit Alibaba Cloud DNS doc

Locked bool

Indicates whether the record is locked.

Priority int

Priority of the MX record.

RecordId string

ID of the record.

Remark string

The remark of the domain record. NOTE: Available in 1.144.0+.

Rr string

Host record of the domain.

Status string

Record status. Valid values: ENABLE and DISABLE.

Ttl int

TTL of the record.

Type string

Record type. Valid values: A, NS, MX, TXT, CNAME, SRV, AAAA, REDIRECT_URL, FORWORD_URL .

Value string

Host record value of the domain.

DomainName string

The domain name associated to the records.

Id string

ID of the resource.

Line string

ISP line. For checking all resolution lines enumeration please visit Alibaba Cloud DNS doc

Locked bool

Indicates whether the record is locked.

Priority int

Priority of the MX record.

RecordId string

ID of the record.

Remark string

The remark of the domain record. NOTE: Available in 1.144.0+.

Rr string

Host record of the domain.

Status string

Record status. Valid values: ENABLE and DISABLE.

Ttl int

TTL of the record.

Type string

Record type. Valid values: A, NS, MX, TXT, CNAME, SRV, AAAA, REDIRECT_URL, FORWORD_URL .

Value string

Host record value of the domain.

domainName String

The domain name associated to the records.

id String

ID of the resource.

line String

ISP line. For checking all resolution lines enumeration please visit Alibaba Cloud DNS doc

locked Boolean

Indicates whether the record is locked.

priority Integer

Priority of the MX record.

recordId String

ID of the record.

remark String

The remark of the domain record. NOTE: Available in 1.144.0+.

rr String

Host record of the domain.

status String

Record status. Valid values: ENABLE and DISABLE.

ttl Integer

TTL of the record.

type String

Record type. Valid values: A, NS, MX, TXT, CNAME, SRV, AAAA, REDIRECT_URL, FORWORD_URL .

value String

Host record value of the domain.

domainName string

The domain name associated to the records.

id string

ID of the resource.

line string

ISP line. For checking all resolution lines enumeration please visit Alibaba Cloud DNS doc

locked boolean

Indicates whether the record is locked.

priority number

Priority of the MX record.

recordId string

ID of the record.

remark string

The remark of the domain record. NOTE: Available in 1.144.0+.

rr string

Host record of the domain.

status string

Record status. Valid values: ENABLE and DISABLE.

ttl number

TTL of the record.

type string

Record type. Valid values: A, NS, MX, TXT, CNAME, SRV, AAAA, REDIRECT_URL, FORWORD_URL .

value string

Host record value of the domain.

domain_name str

The domain name associated to the records.

id str

ID of the resource.

line str

ISP line. For checking all resolution lines enumeration please visit Alibaba Cloud DNS doc

locked bool

Indicates whether the record is locked.

priority int

Priority of the MX record.

record_id str

ID of the record.

remark str

The remark of the domain record. NOTE: Available in 1.144.0+.

rr str

Host record of the domain.

status str

Record status. Valid values: ENABLE and DISABLE.

ttl int

TTL of the record.

type str

Record type. Valid values: A, NS, MX, TXT, CNAME, SRV, AAAA, REDIRECT_URL, FORWORD_URL .

value str

Host record value of the domain.

domainName String

The domain name associated to the records.

id String

ID of the resource.

line String

ISP line. For checking all resolution lines enumeration please visit Alibaba Cloud DNS doc

locked Boolean

Indicates whether the record is locked.

priority Number

Priority of the MX record.

recordId String

ID of the record.

remark String

The remark of the domain record. NOTE: Available in 1.144.0+.

rr String

Host record of the domain.

status String

Record status. Valid values: ENABLE and DISABLE.

ttl Number

TTL of the record.

type String

Record type. Valid values: A, NS, MX, TXT, CNAME, SRV, AAAA, REDIRECT_URL, FORWORD_URL .

value String

Host record value of the domain.

Package Details

Repository
Alibaba Cloud pulumi/pulumi-alicloud
License
Apache-2.0
Notes

This Pulumi package is based on the alicloud Terraform Provider.