getDnsRecords

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as cloudflare from "@pulumi/cloudflare";
const exampleDnsRecords = cloudflare.getDnsRecords({
zoneId: "023e105f4ecef8ad9ca31a8372d0c353",
comment: {
absent: "absent",
contains: "ello, worl",
endswith: "o, world",
exact: "Hello, world",
present: "present",
startswith: "Hello, w",
},
content: {
contains: "7.0.0.",
endswith: ".0.1",
exact: "127.0.0.1",
startswith: "127.0.",
},
name: {
contains: "w.example.",
endswith: ".example.com",
exact: "www.example.com",
startswith: "www.example",
},
search: "www.cloudflare.com",
tag: {
absent: "important",
contains: "greeting:ello, worl",
endswith: "greeting:o, world",
exact: "greeting:Hello, world",
present: "important",
startswith: "greeting:Hello, w",
},
type: "A",
});
import pulumi
import pulumi_cloudflare as cloudflare
example_dns_records = cloudflare.get_dns_records(zone_id="023e105f4ecef8ad9ca31a8372d0c353",
comment={
"absent": "absent",
"contains": "ello, worl",
"endswith": "o, world",
"exact": "Hello, world",
"present": "present",
"startswith": "Hello, w",
},
content={
"contains": "7.0.0.",
"endswith": ".0.1",
"exact": "127.0.0.1",
"startswith": "127.0.",
},
name={
"contains": "w.example.",
"endswith": ".example.com",
"exact": "www.example.com",
"startswith": "www.example",
},
search="www.cloudflare.com",
tag={
"absent": "important",
"contains": "greeting:ello, worl",
"endswith": "greeting:o, world",
"exact": "greeting:Hello, world",
"present": "important",
"startswith": "greeting:Hello, w",
},
type="A")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Cloudflare = Pulumi.Cloudflare;
return await Deployment.RunAsync(() =>
{
var exampleDnsRecords = Cloudflare.GetDnsRecords.Invoke(new()
{
ZoneId = "023e105f4ecef8ad9ca31a8372d0c353",
Comment = new Cloudflare.Inputs.GetDnsRecordsCommentInputArgs
{
Absent = "absent",
Contains = "ello, worl",
Endswith = "o, world",
Exact = "Hello, world",
Present = "present",
Startswith = "Hello, w",
},
Content = new Cloudflare.Inputs.GetDnsRecordsContentInputArgs
{
Contains = "7.0.0.",
Endswith = ".0.1",
Exact = "127.0.0.1",
Startswith = "127.0.",
},
Name = new Cloudflare.Inputs.GetDnsRecordsNameInputArgs
{
Contains = "w.example.",
Endswith = ".example.com",
Exact = "www.example.com",
Startswith = "www.example",
},
Search = "www.cloudflare.com",
Tag = new Cloudflare.Inputs.GetDnsRecordsTagInputArgs
{
Absent = "important",
Contains = "greeting:ello, worl",
Endswith = "greeting:o, world",
Exact = "greeting:Hello, world",
Present = "important",
Startswith = "greeting:Hello, w",
},
Type = "A",
});
});
package main
import (
"github.com/pulumi/pulumi-cloudflare/sdk/v6/go/cloudflare"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := cloudflare.LookupDnsRecords(ctx, &cloudflare.LookupDnsRecordsArgs{
ZoneId: "023e105f4ecef8ad9ca31a8372d0c353",
Comment: cloudflare.GetDnsRecordsComment{
Absent: pulumi.StringRef("absent"),
Contains: pulumi.StringRef("ello, worl"),
Endswith: pulumi.StringRef("o, world"),
Exact: pulumi.StringRef("Hello, world"),
Present: pulumi.StringRef("present"),
Startswith: pulumi.StringRef("Hello, w"),
},
Content: cloudflare.GetDnsRecordsContent{
Contains: pulumi.StringRef("7.0.0."),
Endswith: pulumi.StringRef(".0.1"),
Exact: pulumi.StringRef("127.0.0.1"),
Startswith: pulumi.StringRef("127.0."),
},
Name: cloudflare.GetDnsRecordsName{
Contains: pulumi.StringRef("w.example."),
Endswith: pulumi.StringRef(".example.com"),
Exact: pulumi.StringRef("www.example.com"),
Startswith: pulumi.StringRef("www.example"),
},
Search: pulumi.StringRef("www.cloudflare.com"),
Tag: cloudflare.GetDnsRecordsTag{
Absent: pulumi.StringRef("important"),
Contains: pulumi.StringRef("greeting:ello, worl"),
Endswith: pulumi.StringRef("greeting:o, world"),
Exact: pulumi.StringRef("greeting:Hello, world"),
Present: pulumi.StringRef("important"),
Startswith: pulumi.StringRef("greeting:Hello, w"),
},
Type: pulumi.StringRef("A"),
}, nil)
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.cloudflare.CloudflareFunctions;
import com.pulumi.cloudflare.inputs.GetDnsRecordsArgs;
import com.pulumi.cloudflare.inputs.GetDnsRecordsCommentArgs;
import com.pulumi.cloudflare.inputs.GetDnsRecordsContentArgs;
import com.pulumi.cloudflare.inputs.GetDnsRecordsNameArgs;
import com.pulumi.cloudflare.inputs.GetDnsRecordsTagArgs;
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 exampleDnsRecords = CloudflareFunctions.getDnsRecords(GetDnsRecordsArgs.builder()
.zoneId("023e105f4ecef8ad9ca31a8372d0c353")
.comment(GetDnsRecordsCommentArgs.builder()
.absent("absent")
.contains("ello, worl")
.endswith("o, world")
.exact("Hello, world")
.present("present")
.startswith("Hello, w")
.build())
.content(GetDnsRecordsContentArgs.builder()
.contains("7.0.0.")
.endswith(".0.1")
.exact("127.0.0.1")
.startswith("127.0.")
.build())
.name(GetDnsRecordsNameArgs.builder()
.contains("w.example.")
.endswith(".example.com")
.exact("www.example.com")
.startswith("www.example")
.build())
.search("www.cloudflare.com")
.tag(GetDnsRecordsTagArgs.builder()
.absent("important")
.contains("greeting:ello, worl")
.endswith("greeting:o, world")
.exact("greeting:Hello, world")
.present("important")
.startswith("greeting:Hello, w")
.build())
.type("A")
.build());
}
}
variables:
exampleDnsRecords:
fn::invoke:
function: cloudflare:getDnsRecords
arguments:
zoneId: 023e105f4ecef8ad9ca31a8372d0c353
comment:
absent: absent
contains: ello, worl
endswith: o, world
exact: Hello, world
present: present
startswith: Hello, w
content:
contains: 7.0.0.
endswith: .0.1
exact: 127.0.0.1
startswith: 127.0.
name:
contains: w.example.
endswith: .example.com
exact: www.example.com
startswith: www.example
search: www.cloudflare.com
tag:
absent: important
contains: greeting:ello, worl
endswith: greeting:o, world
exact: greeting:Hello, world
present: important
startswith: greeting:Hello, w
type: A

Return

A collection of values returned by getDnsRecords.

Parameters

argument

A collection of arguments for invoking getDnsRecords.


suspend fun getDnsRecords(comment: GetDnsRecordsComment? = null, content: GetDnsRecordsContent? = null, direction: String? = null, match: String? = null, maxItems: Int? = null, name: GetDnsRecordsName? = null, order: String? = null, proxied: Boolean? = null, search: String? = null, tag: GetDnsRecordsTag? = null, tagMatch: String? = null, type: String? = null, zoneId: String): GetDnsRecordsInvokeResult

Return

A collection of values returned by getDnsRecords.

Parameters

comment
content
direction

Direction to order DNS records in. Available values: "asc", "desc".

match

Whether to match all search requirements or at least one (any). If set to all, acts like a logical AND between filters. If set to any, acts like a logical OR instead. Note that the interaction between tag filters is controlled by the tag-match parameter instead. Available values: "any", "all".

maxItems

Max items to fetch, default: 1000

name
order

Field to order DNS records by. Available values: "type", "name", "content", "ttl", "proxied".

proxied

Whether the record is receiving the performance and security benefits of Cloudflare.

search

Allows searching in multiple properties of a DNS record simultaneously. This parameter is intended for human users, not automation. Its exact behavior is intentionally left unspecified and is subject to change in the future. This parameter works independently of the match setting. For automated searches, please use the other available parameters.

tag
tagMatch

Whether to match all tag search requirements or at least one (any). If set to all, acts like a logical AND between tag filters. If set to any, acts like a logical OR instead. Note that the regular match parameter is still used to combine the resulting condition with other filters that aren't related to tags. Available values: "any", "all".

type

Record type. Available values: "A", "AAAA", "CAA", "CERT", "CNAME", "DNSKEY", "DS", "HTTPS", "LOC", "MX", "NAPTR", "NS", "OPENPGPKEY", "PTR", "SMIMEA", "SRV", "SSHFP", "SVCB", "TLSA", "TXT", "URI".

zoneId

Identifier

See also


Return

A collection of values returned by getDnsRecords.

Parameters

argument

Builder for com.pulumi.cloudflare.kotlin.inputs.GetDnsRecordsPlainArgs.

See also