Alibaba Cloud v3.62.1 published on Monday, Sep 16, 2024 by Pulumi
alicloud.dns.getRecords
Explore with Pulumi AI
This data source provides a list of DNS Domain Records in an Alibaba Cloud account according to the specified filters.
NOTE: Available since v1.0.0.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const recordsDs = alicloud.dns.getRecords({
domainName: "xiaozhu.top",
isLocked: false,
type: "A",
hostRecordRegex: "^@",
outputFile: "records.txt",
});
export const firstRecordId = recordsDs.then(recordsDs => recordsDs.records?.[0]?.recordId);
import pulumi
import pulumi_alicloud as alicloud
records_ds = alicloud.dns.get_records(domain_name="xiaozhu.top",
is_locked=False,
type="A",
host_record_regex="^@",
output_file="records.txt")
pulumi.export("firstRecordId", records_ds.records[0].record_id)
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.GetRecords(ctx, &dns.GetRecordsArgs{
DomainName: "xiaozhu.top",
IsLocked: pulumi.BoolRef(false),
Type: pulumi.StringRef("A"),
HostRecordRegex: pulumi.StringRef("^@"),
OutputFile: pulumi.StringRef("records.txt"),
}, nil)
if err != nil {
return err
}
ctx.Export("firstRecordId", recordsDs.Records[0].RecordId)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var recordsDs = AliCloud.Dns.GetRecords.Invoke(new()
{
DomainName = "xiaozhu.top",
IsLocked = false,
Type = "A",
HostRecordRegex = "^@",
OutputFile = "records.txt",
});
return new Dictionary<string, object?>
{
["firstRecordId"] = recordsDs.Apply(getRecordsResult => getRecordsResult.Records[0]?.RecordId),
};
});
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.GetRecordsArgs;
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.getRecords(GetRecordsArgs.builder()
.domainName("xiaozhu.top")
.isLocked(false)
.type("A")
.hostRecordRegex("^@")
.outputFile("records.txt")
.build());
ctx.export("firstRecordId", recordsDs.applyValue(getRecordsResult -> getRecordsResult.records()[0].recordId()));
}
}
variables:
recordsDs:
fn::invoke:
Function: alicloud:dns:getRecords
Arguments:
domainName: xiaozhu.top
isLocked: false
type: A
hostRecordRegex: ^@
outputFile: records.txt
outputs:
firstRecordId: ${recordsDs.records[0].recordId}
Using getRecords
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 getRecords(args: GetRecordsArgs, opts?: InvokeOptions): Promise<GetRecordsResult>
function getRecordsOutput(args: GetRecordsOutputArgs, opts?: InvokeOptions): Output<GetRecordsResult>
def get_records(domain_name: Optional[str] = None,
host_record_regex: Optional[str] = None,
ids: Optional[Sequence[str]] = None,
is_locked: Optional[bool] = None,
line: Optional[str] = None,
output_file: Optional[str] = None,
status: Optional[str] = None,
type: Optional[str] = None,
value_regex: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetRecordsResult
def get_records_output(domain_name: Optional[pulumi.Input[str]] = None,
host_record_regex: Optional[pulumi.Input[str]] = None,
ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
is_locked: Optional[pulumi.Input[bool]] = None,
line: Optional[pulumi.Input[str]] = None,
output_file: Optional[pulumi.Input[str]] = None,
status: Optional[pulumi.Input[str]] = None,
type: Optional[pulumi.Input[str]] = None,
value_regex: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetRecordsResult]
func GetRecords(ctx *Context, args *GetRecordsArgs, opts ...InvokeOption) (*GetRecordsResult, error)
func GetRecordsOutput(ctx *Context, args *GetRecordsOutputArgs, opts ...InvokeOption) GetRecordsResultOutput
> Note: This function is named GetRecords
in the Go SDK.
public static class GetRecords
{
public static Task<GetRecordsResult> InvokeAsync(GetRecordsArgs args, InvokeOptions? opts = null)
public static Output<GetRecordsResult> Invoke(GetRecordsInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetRecordsResult> getRecords(GetRecordsArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: alicloud:dns/getRecords:getRecords
arguments:
# arguments dictionary
The following arguments are supported:
- Domain
Name string - The domain name associated to the records.
- Host
Record stringRegex - Host record regex.
- Ids List<string>
- A list of record IDs.
- Is
Locked bool - Whether the record is locked or not.
- Line string
- ISP line. Valid items are
default
,telecom
,unicom
,mobile
,oversea
,edu
,drpeng
,btvn
, .etc. For checking all resolution lines enumeration please visit Alibaba Cloud DNS doc - Output
File string - File name where to save data source results (after running
pulumi preview
). - Status string
- Record status. Valid items are
ENABLE
andDISABLE
. - Type string
- Record type. Valid items are
A
,NS
,MX
,TXT
,CNAME
,SRV
,AAAA
,REDIRECT_URL
,FORWORD_URL
. - Value
Regex string - Host record value regex.
- Domain
Name string - The domain name associated to the records.
- Host
Record stringRegex - Host record regex.
- Ids []string
- A list of record IDs.
- Is
Locked bool - Whether the record is locked or not.
- Line string
- ISP line. Valid items are
default
,telecom
,unicom
,mobile
,oversea
,edu
,drpeng
,btvn
, .etc. For checking all resolution lines enumeration please visit Alibaba Cloud DNS doc - Output
File string - File name where to save data source results (after running
pulumi preview
). - Status string
- Record status. Valid items are
ENABLE
andDISABLE
. - Type string
- Record type. Valid items are
A
,NS
,MX
,TXT
,CNAME
,SRV
,AAAA
,REDIRECT_URL
,FORWORD_URL
. - Value
Regex string - Host record value regex.
- domain
Name String - The domain name associated to the records.
- host
Record StringRegex - Host record regex.
- ids List<String>
- A list of record IDs.
- is
Locked Boolean - Whether the record is locked or not.
- line String
- ISP line. Valid items are
default
,telecom
,unicom
,mobile
,oversea
,edu
,drpeng
,btvn
, .etc. For checking all resolution lines enumeration please visit Alibaba Cloud DNS doc - output
File String - File name where to save data source results (after running
pulumi preview
). - status String
- Record status. Valid items are
ENABLE
andDISABLE
. - type String
- Record type. Valid items are
A
,NS
,MX
,TXT
,CNAME
,SRV
,AAAA
,REDIRECT_URL
,FORWORD_URL
. - value
Regex String - Host record value regex.
- domain
Name string - The domain name associated to the records.
- host
Record stringRegex - Host record regex.
- ids string[]
- A list of record IDs.
- is
Locked boolean - Whether the record is locked or not.
- line string
- ISP line. Valid items are
default
,telecom
,unicom
,mobile
,oversea
,edu
,drpeng
,btvn
, .etc. For checking all resolution lines enumeration please visit Alibaba Cloud DNS doc - output
File string - File name where to save data source results (after running
pulumi preview
). - status string
- Record status. Valid items are
ENABLE
andDISABLE
. - type string
- Record type. Valid items are
A
,NS
,MX
,TXT
,CNAME
,SRV
,AAAA
,REDIRECT_URL
,FORWORD_URL
. - value
Regex string - Host record value regex.
- domain_
name str - The domain name associated to the records.
- host_
record_ strregex - Host record regex.
- ids Sequence[str]
- A list of record IDs.
- is_
locked bool - Whether the record is locked or not.
- line str
- ISP line. Valid items are
default
,telecom
,unicom
,mobile
,oversea
,edu
,drpeng
,btvn
, .etc. For checking all resolution lines enumeration please visit Alibaba Cloud DNS doc - output_
file str - File name where to save data source results (after running
pulumi preview
). - status str
- Record status. Valid items are
ENABLE
andDISABLE
. - type str
- Record type. Valid items are
A
,NS
,MX
,TXT
,CNAME
,SRV
,AAAA
,REDIRECT_URL
,FORWORD_URL
. - value_
regex str - Host record value regex.
- domain
Name String - The domain name associated to the records.
- host
Record StringRegex - Host record regex.
- ids List<String>
- A list of record IDs.
- is
Locked Boolean - Whether the record is locked or not.
- line String
- ISP line. Valid items are
default
,telecom
,unicom
,mobile
,oversea
,edu
,drpeng
,btvn
, .etc. For checking all resolution lines enumeration please visit Alibaba Cloud DNS doc - output
File String - File name where to save data source results (after running
pulumi preview
). - status String
- Record status. Valid items are
ENABLE
andDISABLE
. - type String
- Record type. Valid items are
A
,NS
,MX
,TXT
,CNAME
,SRV
,AAAA
,REDIRECT_URL
,FORWORD_URL
. - value
Regex String - Host record value regex.
getRecords Result
The following output properties are available:
- Domain
Name string - Name of the domain the 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.
Ali Cloud. Dns. Outputs. Get Records Record> - A list of records. Each element contains the following attributes:
- Urls List<string>
- A list of entire URLs. Each item format as
<host_record>.<domain_name>
. - Host
Record stringRegex - Is
Locked bool - Line string
- ISP line of the record.
- Output
File string - Status string
- Status of the record.
- Type string
- Type of the record.
- Value
Regex string
- Domain
Name string - Name of the domain the record belongs to.
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids []string
- A list of record IDs.
- Records
[]Get
Records Record - A list of records. Each element contains the following attributes:
- Urls []string
- A list of entire URLs. Each item format as
<host_record>.<domain_name>
. - Host
Record stringRegex - Is
Locked bool - Line string
- ISP line of the record.
- Output
File string - Status string
- Status of the record.
- Type string
- Type of the record.
- Value
Regex string
- domain
Name String - Name of the domain the record belongs to.
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- A list of record IDs.
- records
List<Get
Records Record> - A list of records. Each element contains the following attributes:
- urls List<String>
- A list of entire URLs. Each item format as
<host_record>.<domain_name>
. - host
Record StringRegex - is
Locked Boolean - line String
- ISP line of the record.
- output
File String - status String
- Status of the record.
- type String
- Type of the record.
- value
Regex String
- domain
Name string - Name of the domain the record belongs to.
- id string
- The provider-assigned unique ID for this managed resource.
- ids string[]
- A list of record IDs.
- records
Get
Records Record[] - A list of records. Each element contains the following attributes:
- urls string[]
- A list of entire URLs. Each item format as
<host_record>.<domain_name>
. - host
Record stringRegex - is
Locked boolean - line string
- ISP line of the record.
- output
File string - status string
- Status of the record.
- type string
- Type of the record.
- value
Regex string
- domain_
name str - Name of the domain the record belongs to.
- id str
- The provider-assigned unique ID for this managed resource.
- ids Sequence[str]
- A list of record IDs.
- records
Sequence[Get
Records Record] - A list of records. Each element contains the following attributes:
- urls Sequence[str]
- A list of entire URLs. Each item format as
<host_record>.<domain_name>
. - host_
record_ strregex - is_
locked bool - line str
- ISP line of the record.
- output_
file str - status str
- Status of the record.
- type str
- Type of the record.
- value_
regex str
- domain
Name String - Name of the domain the 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:
- urls List<String>
- A list of entire URLs. Each item format as
<host_record>.<domain_name>
. - host
Record StringRegex - is
Locked Boolean - line String
- ISP line of the record.
- output
File String - status String
- Status of the record.
- type String
- Type of the record.
- value
Regex String
Supporting Types
GetRecordsRecord
- Domain
Name string - The domain name associated to the records.
- Host
Record string - Host record of the domain.
- Line string
- ISP line. Valid items are
default
,telecom
,unicom
,mobile
,oversea
,edu
,drpeng
,btvn
, .etc. 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 string - ID of the record.
- Status string
- Record status. Valid items are
ENABLE
andDISABLE
. - Ttl double
- TTL of the record.
- Type string
- Record type. Valid items are
A
,NS
,MX
,TXT
,CNAME
,SRV
,AAAA
,REDIRECT_URL
,FORWORD_URL
. - Value string
- Host record value of the domain.
- Domain
Name string - The domain name associated to the records.
- Host
Record string - Host record of the domain.
- Line string
- ISP line. Valid items are
default
,telecom
,unicom
,mobile
,oversea
,edu
,drpeng
,btvn
, .etc. 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 string - ID of the record.
- Status string
- Record status. Valid items are
ENABLE
andDISABLE
. - Ttl float64
- TTL of the record.
- Type string
- Record type. Valid items are
A
,NS
,MX
,TXT
,CNAME
,SRV
,AAAA
,REDIRECT_URL
,FORWORD_URL
. - Value string
- Host record value of the domain.
- domain
Name String - The domain name associated to the records.
- host
Record String - Host record of the domain.
- line String
- ISP line. Valid items are
default
,telecom
,unicom
,mobile
,oversea
,edu
,drpeng
,btvn
, .etc. 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. - record
Id String - ID of the record.
- status String
- Record status. Valid items are
ENABLE
andDISABLE
. - ttl Double
- TTL of the record.
- type String
- Record type. Valid items are
A
,NS
,MX
,TXT
,CNAME
,SRV
,AAAA
,REDIRECT_URL
,FORWORD_URL
. - value String
- Host record value of the domain.
- domain
Name string - The domain name associated to the records.
- host
Record string - Host record of the domain.
- line string
- ISP line. Valid items are
default
,telecom
,unicom
,mobile
,oversea
,edu
,drpeng
,btvn
, .etc. 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. - record
Id string - ID of the record.
- status string
- Record status. Valid items are
ENABLE
andDISABLE
. - ttl number
- TTL of the record.
- type string
- Record type. Valid items are
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.
- host_
record str - Host record of the domain.
- line str
- ISP line. Valid items are
default
,telecom
,unicom
,mobile
,oversea
,edu
,drpeng
,btvn
, .etc. 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.
- status str
- Record status. Valid items are
ENABLE
andDISABLE
. - ttl float
- TTL of the record.
- type str
- Record type. Valid items are
A
,NS
,MX
,TXT
,CNAME
,SRV
,AAAA
,REDIRECT_URL
,FORWORD_URL
. - value str
- Host record value of the domain.
- domain
Name String - The domain name associated to the records.
- host
Record String - Host record of the domain.
- line String
- ISP line. Valid items are
default
,telecom
,unicom
,mobile
,oversea
,edu
,drpeng
,btvn
, .etc. 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. - record
Id String - ID of the record.
- status String
- Record status. Valid items are
ENABLE
andDISABLE
. - ttl Number
- TTL of the record.
- type String
- Record type. Valid items are
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.