GetRecord

Get information on a DNS record. This data source provides the name, TTL, and zone file as configured on your DigitalOcean account. This is useful if the record in question is not managed by this provider.

An error is triggered if the provided domain name or record are not managed with your DigitalOcean account.

Example Usage

using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;

class MyStack : Stack
{
    public MyStack()
    {
        var example = Output.Create(DigitalOcean.GetRecord.InvokeAsync(new DigitalOcean.GetRecordArgs
        {
            Domain = "example.com",
            Name = "test",
        }));
        this.RecordType = example.Apply(example => example.Type);
        this.RecordTtl = example.Apply(example => example.Ttl);
    }

    [Output("recordType")]
    public Output<string> RecordType { get; set; }
    [Output("recordTtl")]
    public Output<string> RecordTtl { get; set; }
}

Coming soon!

import pulumi
import pulumi_digitalocean as digitalocean

example = digitalocean.get_record(domain="example.com",
    name="test")
pulumi.export("recordType", example.type)
pulumi.export("recordTtl", example.ttl)
import * as pulumi from "@pulumi/pulumi";
import * as digitalocean from "@pulumi/digitalocean";

const example = digitalocean.getRecord({
    domain: "example.com",
    name: "test",
});
export const recordType = example.then(example => example.type);
export const recordTtl = example.then(example => example.ttl);

Using GetRecord

function getRecord(args: GetRecordArgs, opts?: InvokeOptions): Promise<GetRecordResult>
function  get_record(domain=None, name=None, opts=None)
func GetRecord(ctx *Context, args *GetRecordArgs, opts ...InvokeOption) (*GetRecordResult, error)
public static class GetRecord {
    public static Task<GetRecordResult> InvokeAsync(GetRecordArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

Domain string

The domain name of the record.

Name string

The name of the record.

Domain string

The domain name of the record.

Name string

The name of the record.

domain string

The domain name of the record.

name string

The name of the record.

domain str

The domain name of the record.

name str

The name of the record.

GetRecord Result

The following output properties are available:

Data string
Domain string
Flags int
Id string

The provider-assigned unique ID for this managed resource.

Name string
Port int
Priority int
Tag string
Ttl int
Type string
Weight int
Data string
Domain string
Flags int
Id string

The provider-assigned unique ID for this managed resource.

Name string
Port int
Priority int
Tag string
Ttl int
Type string
Weight int
data string
domain string
flags number
id string

The provider-assigned unique ID for this managed resource.

name string
port number
priority number
tag string
ttl number
type string
weight number
data str
domain str
flags float
id str

The provider-assigned unique ID for this managed resource.

name str
port float
priority float
tag str
ttl float
type str
weight float

Package Details

Repository
https://github.com/pulumi/pulumi-digitalocean
License
Apache-2.0
Notes
This Pulumi package is based on the digitalocean Terraform Provider.