Pulumi Official
Package maintained by Pulumi
v2.2.4 published on Friday, Jul 29, 2022 by Pulumi


Get information on a domain. This data source provides the name and the id.

An error will be raised if the provided domain name is 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 = "",
        this.DomainOutput = domain.Apply(domain => domain.Name);
        this.DomainIdOutput = domain.Apply(domain => domain.Id);

    public Output<string> DomainOutput { get; set; }
    public Output<string> DomainIdOutput { get; set; }
package main

import (

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		domain, err := civo.LookupDnsDomainName(ctx, &GetDnsDomainNameArgs{
			Name: pulumi.StringRef(""),
		}, nil)
		if err != nil {
			return err
		ctx.Export("domainOutput", domain.Name)
		ctx.Export("domainIdOutput", domain.Id)
		return nil
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.civo.CivoFunctions;
import com.pulumi.civo.inputs.GetDnsDomainNameArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {;

    public static void stack(Context ctx) {
        final var domain = CivoFunctions.getDnsDomainName(GetDnsDomainNameArgs.builder()

        ctx.export("domainOutput", domain.applyValue(getDnsDomainNameResult ->;
        ctx.export("domainIdOutput", domain.applyValue(getDnsDomainNameResult ->;
import pulumi
import pulumi_civo as civo

domain = civo.get_dns_domain_name(name="")
import * as pulumi from "@pulumi/pulumi";
import * as civo from "@pulumi/civo";

const domain = civo.getDnsDomainName({
    name: "",
export const domainOutput = domain.then(domain =>;
export const domainIdOutput = domain.then(domain =>;
      Function: civo:getDnsDomainName
  domainOutput: ${}
  domainIdOutput: ${}

Using getDnsDomainName

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 getDnsDomainName(args: GetDnsDomainNameArgs, opts?: InvokeOptions): Promise<GetDnsDomainNameResult>
function getDnsDomainNameOutput(args: GetDnsDomainNameOutputArgs, opts?: InvokeOptions): Output<GetDnsDomainNameResult>
def get_dns_domain_name(id: Optional[str] = None,
                        name: Optional[str] = None,
                        opts: Optional[InvokeOptions] = None) -> GetDnsDomainNameResult
def get_dns_domain_name_output(id: Optional[pulumi.Input[str]] = None,
                        name: Optional[pulumi.Input[str]] = None,
                        opts: Optional[InvokeOptions] = None) -> Output[GetDnsDomainNameResult]
func LookupDnsDomainName(ctx *Context, args *LookupDnsDomainNameArgs, opts ...InvokeOption) (*LookupDnsDomainNameResult, error)
func LookupDnsDomainNameOutput(ctx *Context, args *LookupDnsDomainNameOutputArgs, opts ...InvokeOption) LookupDnsDomainNameResultOutput

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

public static class GetDnsDomainName 
    public static Task<GetDnsDomainNameResult> InvokeAsync(GetDnsDomainNameArgs args, InvokeOptions? opts = null)
    public static Output<GetDnsDomainNameResult> Invoke(GetDnsDomainNameInvokeArgs args, InvokeOptions? opts = null)
public static CompletableFuture<GetDnsDomainNameResult> getDnsDomainName(GetDnsDomainNameArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
  Function: civo:index/getDnsDomainName:getDnsDomainName
    # Arguments dictionary

The following arguments are supported:

Id string
Name string
Id string
Name string
id String
name String
id string
name string
id str
name str
id String
name String

getDnsDomainName Result

The following output properties are available:

Id string
Name string
Id string
Name string
id String
name String
id string
name string
id str
name str
id String
name String

Package Details


This Pulumi package is based on the civo Terraform Provider.