Civo

Pulumi Official
Package maintained by Pulumi
v2.2.2 published on Thursday, Apr 21, 2022 by Pulumi

getDnsDomainRecord

Get information on a DNS record. This data source provides the name, TTL, and zone file as configured on your Civo account.

An error will be raised if the provided domain name or record are not in your Civo account.

Example Usage

using Pulumi;
using Civo = Pulumi.Civo;

class MyStack : Stack
{
    public MyStack()
    {
        var domain = Output.Create(Civo.GetDnsDomainName.InvokeAsync(new Civo.GetDnsDomainNameArgs
        {
            Name = "domain.com",
        }));
        var www = domain.Apply(domain => Output.Create(Civo.GetDnsDomainRecord.InvokeAsync(new Civo.GetDnsDomainRecordArgs
        {
            DomainId = domain.Id,
            Name = "www",
        })));
        this.RecordType = www.Apply(www => www.Type);
        this.RecordTtl = www.Apply(www => www.Ttl);
    }

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

import (
	"github.com/pulumi/pulumi-civo/sdk/v2/go/civo"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		domain, err := civo.LookupDnsDomainName(ctx, &GetDnsDomainNameArgs{
			Name: pulumi.StringRef("domain.com"),
		}, nil)
		if err != nil {
			return err
		}
		www, err := civo.LookupDnsDomainRecord(ctx, &GetDnsDomainRecordArgs{
			DomainId: domain.Id,
			Name:     "www",
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("recordType", www.Type)
		ctx.Export("recordTtl", www.Ttl)
		return nil
	})
}

Coming soon!

import pulumi
import pulumi_civo as civo

domain = civo.get_dns_domain_name(name="domain.com")
www = civo.get_dns_domain_record(domain_id=domain.id,
    name="www")
pulumi.export("recordType", www.type)
pulumi.export("recordTtl", www.ttl)
import * as pulumi from "@pulumi/pulumi";
import * as civo from "@pulumi/civo";

const domain = civo.getDnsDomainName({
    name: "domain.com",
});
const www = domain.then(domain => civo.getDnsDomainRecord({
    domainId: domain.id,
    name: "www",
}));
export const recordType = www.then(www => www.type);
export const recordTtl = www.then(www => www.ttl);

Coming soon!

Using getDnsDomainRecord

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 getDnsDomainRecord(args: GetDnsDomainRecordArgs, opts?: InvokeOptions): Promise<GetDnsDomainRecordResult>
function getDnsDomainRecordOutput(args: GetDnsDomainRecordOutputArgs, opts?: InvokeOptions): Output<GetDnsDomainRecordResult>
def get_dns_domain_record(domain_id: Optional[str] = None,
                          name: Optional[str] = None,
                          opts: Optional[InvokeOptions] = None) -> GetDnsDomainRecordResult
def get_dns_domain_record_output(domain_id: Optional[pulumi.Input[str]] = None,
                          name: Optional[pulumi.Input[str]] = None,
                          opts: Optional[InvokeOptions] = None) -> Output[GetDnsDomainRecordResult]
func LookupDnsDomainRecord(ctx *Context, args *LookupDnsDomainRecordArgs, opts ...InvokeOption) (*LookupDnsDomainRecordResult, error)
func LookupDnsDomainRecordOutput(ctx *Context, args *LookupDnsDomainRecordOutputArgs, opts ...InvokeOption) LookupDnsDomainRecordResultOutput

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

public static class GetDnsDomainRecord 
{
    public static Task<GetDnsDomainRecordResult> InvokeAsync(GetDnsDomainRecordArgs args, InvokeOptions? opts = null)
    public static Output<GetDnsDomainRecordResult> Invoke(GetDnsDomainRecordInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetDnsDomainRecordResult> getDnsDomainRecord(GetDnsDomainRecordArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
  Function: civo:index/getDnsDomainRecord:getDnsDomainRecord
  Arguments:
    # Arguments dictionary

The following arguments are supported:

DomainId string

The ID of the domain

Name string

The name of the record

DomainId string

The ID of the domain

Name string

The name of the record

domainId String

The ID of the domain

name String

The name of the record

domainId string

The ID of the domain

name string

The name of the record

domain_id str

The ID of the domain

name str

The name of the record

domainId String

The ID of the domain

name String

The name of the record

getDnsDomainRecord Result

The following output properties are available:

AccountId string

The ID account of the domain

CreatedAt string

The date when it was created in UTC format

DomainId string

The ID of the domain

Id string

The provider-assigned unique ID for this managed resource.

Name string

The name of the record

Priority int

The priority of the record

Ttl int

How long caching DNS servers should cache this record

Type string

The choice of record type from A, CNAME, MX, SRV or TXT

UpdatedAt string

The date when it was updated in UTC format

Value string

The IP address (A or MX), hostname (CNAME or MX) or text value (TXT) to serve for this record

AccountId string

The ID account of the domain

CreatedAt string

The date when it was created in UTC format

DomainId string

The ID of the domain

Id string

The provider-assigned unique ID for this managed resource.

Name string

The name of the record

Priority int

The priority of the record

Ttl int

How long caching DNS servers should cache this record

Type string

The choice of record type from A, CNAME, MX, SRV or TXT

UpdatedAt string

The date when it was updated in UTC format

Value string

The IP address (A or MX), hostname (CNAME or MX) or text value (TXT) to serve for this record

accountId String

The ID account of the domain

createdAt String

The date when it was created in UTC format

domainId String

The ID of the domain

id String

The provider-assigned unique ID for this managed resource.

name String

The name of the record

priority Integer

The priority of the record

ttl Integer

How long caching DNS servers should cache this record

type String

The choice of record type from A, CNAME, MX, SRV or TXT

updatedAt String

The date when it was updated in UTC format

value String

The IP address (A or MX), hostname (CNAME or MX) or text value (TXT) to serve for this record

accountId string

The ID account of the domain

createdAt string

The date when it was created in UTC format

domainId string

The ID of the domain

id string

The provider-assigned unique ID for this managed resource.

name string

The name of the record

priority number

The priority of the record

ttl number

How long caching DNS servers should cache this record

type string

The choice of record type from A, CNAME, MX, SRV or TXT

updatedAt string

The date when it was updated in UTC format

value string

The IP address (A or MX), hostname (CNAME or MX) or text value (TXT) to serve for this record

account_id str

The ID account of the domain

created_at str

The date when it was created in UTC format

domain_id str

The ID of the domain

id str

The provider-assigned unique ID for this managed resource.

name str

The name of the record

priority int

The priority of the record

ttl int

How long caching DNS servers should cache this record

type str

The choice of record type from A, CNAME, MX, SRV or TXT

updated_at str

The date when it was updated in UTC format

value str

The IP address (A or MX), hostname (CNAME or MX) or text value (TXT) to serve for this record

accountId String

The ID account of the domain

createdAt String

The date when it was created in UTC format

domainId String

The ID of the domain

id String

The provider-assigned unique ID for this managed resource.

name String

The name of the record

priority Number

The priority of the record

ttl Number

How long caching DNS servers should cache this record

type String

The choice of record type from A, CNAME, MX, SRV or TXT

updatedAt String

The date when it was updated in UTC format

value String

The IP address (A or MX), hostname (CNAME or MX) or text value (TXT) to serve for this record

Package Details

Repository
https://github.com/pulumi/pulumi-civo
License
Apache-2.0
Notes

This Pulumi package is based on the civo Terraform Provider.