Cloudflare v5.39.1 published on Tuesday, Sep 24, 2024 by Pulumi
cloudflare.getRecord
Explore with Pulumi AI
Use this data source to lookup a single DNS Record.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as cloudflare from "@pulumi/cloudflare";
const example = cloudflare.getRecord({
zoneId: "0da42c8d2132a9ddaf714f9e7c920711",
hostname: "example.com",
});
import pulumi
import pulumi_cloudflare as cloudflare
example = cloudflare.get_record(zone_id="0da42c8d2132a9ddaf714f9e7c920711",
hostname="example.com")
package main
import (
"github.com/pulumi/pulumi-cloudflare/sdk/v5/go/cloudflare"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := cloudflare.LookupRecord(ctx, &cloudflare.LookupRecordArgs{
ZoneId: "0da42c8d2132a9ddaf714f9e7c920711",
Hostname: "example.com",
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Cloudflare = Pulumi.Cloudflare;
return await Deployment.RunAsync(() =>
{
var example = Cloudflare.GetRecord.Invoke(new()
{
ZoneId = "0da42c8d2132a9ddaf714f9e7c920711",
Hostname = "example.com",
});
});
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.GetRecordArgs;
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 example = CloudflareFunctions.getRecord(GetRecordArgs.builder()
.zoneId("0da42c8d2132a9ddaf714f9e7c920711")
.hostname("example.com")
.build());
}
}
variables:
example:
fn::invoke:
Function: cloudflare:getRecord
Arguments:
zoneId: 0da42c8d2132a9ddaf714f9e7c920711
hostname: example.com
Using getRecord
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 getRecord(args: GetRecordArgs, opts?: InvokeOptions): Promise<GetRecordResult>
function getRecordOutput(args: GetRecordOutputArgs, opts?: InvokeOptions): Output<GetRecordResult>
def get_record(content: Optional[str] = None,
hostname: Optional[str] = None,
priority: Optional[int] = None,
type: Optional[str] = None,
zone_id: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetRecordResult
def get_record_output(content: Optional[pulumi.Input[str]] = None,
hostname: Optional[pulumi.Input[str]] = None,
priority: Optional[pulumi.Input[int]] = None,
type: Optional[pulumi.Input[str]] = None,
zone_id: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetRecordResult]
func LookupRecord(ctx *Context, args *LookupRecordArgs, opts ...InvokeOption) (*LookupRecordResult, error)
func LookupRecordOutput(ctx *Context, args *LookupRecordOutputArgs, opts ...InvokeOption) LookupRecordResultOutput
> Note: This function is named LookupRecord
in the Go SDK.
public static class GetRecord
{
public static Task<GetRecordResult> InvokeAsync(GetRecordArgs args, InvokeOptions? opts = null)
public static Output<GetRecordResult> Invoke(GetRecordInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetRecordResult> getRecord(GetRecordArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: cloudflare:index/getRecord:getRecord
arguments:
# arguments dictionary
The following arguments are supported:
getRecord Result
The following output properties are available:
- Hostname string
- Hostname to filter DNS record results on.
- Id string
- The provider-assigned unique ID for this managed resource.
- Proxiable bool
- Proxiable status of the found DNS record.
- Proxied bool
- Proxied status of the found DNS record.
- Ttl int
- TTL of the found DNS record.
- Value string
- Value of the found DNS record.
- Zone
Id string - The zone identifier to target for the resource.
- Content string
- Content to filter record results on.
- Priority int
- DNS priority to filter record results on.
- Type string
- DNS record type to filter record results on. Defaults to
A
.
- Hostname string
- Hostname to filter DNS record results on.
- Id string
- The provider-assigned unique ID for this managed resource.
- Proxiable bool
- Proxiable status of the found DNS record.
- Proxied bool
- Proxied status of the found DNS record.
- Ttl int
- TTL of the found DNS record.
- Value string
- Value of the found DNS record.
- Zone
Id string - The zone identifier to target for the resource.
- Content string
- Content to filter record results on.
- Priority int
- DNS priority to filter record results on.
- Type string
- DNS record type to filter record results on. Defaults to
A
.
- hostname String
- Hostname to filter DNS record results on.
- id String
- The provider-assigned unique ID for this managed resource.
- proxiable Boolean
- Proxiable status of the found DNS record.
- proxied Boolean
- Proxied status of the found DNS record.
- ttl Integer
- TTL of the found DNS record.
- value String
- Value of the found DNS record.
- zone
Id String - The zone identifier to target for the resource.
- content String
- Content to filter record results on.
- priority Integer
- DNS priority to filter record results on.
- type String
- DNS record type to filter record results on. Defaults to
A
.
- hostname string
- Hostname to filter DNS record results on.
- id string
- The provider-assigned unique ID for this managed resource.
- proxiable boolean
- Proxiable status of the found DNS record.
- proxied boolean
- Proxied status of the found DNS record.
- ttl number
- TTL of the found DNS record.
- value string
- Value of the found DNS record.
- zone
Id string - The zone identifier to target for the resource.
- content string
- Content to filter record results on.
- priority number
- DNS priority to filter record results on.
- type string
- DNS record type to filter record results on. Defaults to
A
.
- hostname str
- Hostname to filter DNS record results on.
- id str
- The provider-assigned unique ID for this managed resource.
- proxiable bool
- Proxiable status of the found DNS record.
- proxied bool
- Proxied status of the found DNS record.
- ttl int
- TTL of the found DNS record.
- value str
- Value of the found DNS record.
- zone_
id str - The zone identifier to target for the resource.
- content str
- Content to filter record results on.
- priority int
- DNS priority to filter record results on.
- type str
- DNS record type to filter record results on. Defaults to
A
.
- hostname String
- Hostname to filter DNS record results on.
- id String
- The provider-assigned unique ID for this managed resource.
- proxiable Boolean
- Proxiable status of the found DNS record.
- proxied Boolean
- Proxied status of the found DNS record.
- ttl Number
- TTL of the found DNS record.
- value String
- Value of the found DNS record.
- zone
Id String - The zone identifier to target for the resource.
- content String
- Content to filter record results on.
- priority Number
- DNS priority to filter record results on.
- type String
- DNS record type to filter record results on. Defaults to
A
.
Package Details
- Repository
- Cloudflare pulumi/pulumi-cloudflare
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
cloudflare
Terraform Provider.