civo.getDnsDomainName

Explore with Pulumi AI

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 System.Collections.Generic;
using Pulumi;
using Civo = Pulumi.Civo;

return await Deployment.RunAsync(() => 
{
    var domain = Civo.GetDnsDomainName.Invoke(new()
    {
        Name = "domain.com",
    });

    return new Dictionary<string, object?>
    {
        ["domainOutput"] = domain.Apply(getDnsDomainNameResult => getDnsDomainNameResult.Name),
        ["domainIdOutput"] = domain.Apply(getDnsDomainNameResult => getDnsDomainNameResult.Id),
    };
});
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, &civo.LookupDnsDomainNameArgs{
			Name: pulumi.StringRef("domain.com"),
		}, 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.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 domain = CivoFunctions.getDnsDomainName(GetDnsDomainNameArgs.builder()
            .name("domain.com")
            .build());

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

domain = civo.get_dns_domain_name(name="domain.com")
pulumi.export("domainOutput", domain.name)
pulumi.export("domainIdOutput", domain.id)
import * as pulumi from "@pulumi/pulumi";
import * as civo from "@pulumi/civo";

const domain = civo.getDnsDomainName({
    name: "domain.com",
});
export const domainOutput = domain.then(domain => domain.name);
export const domainIdOutput = domain.then(domain => domain.id);
variables:
  domain:
    fn::invoke:
      Function: civo:getDnsDomainName
      Arguments:
        name: domain.com
outputs:
  domainOutput: ${domain.name}
  domainIdOutput: ${domain.id}

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
fn::invoke:
  function: civo:index/getDnsDomainName:getDnsDomainName
  arguments:
    # arguments dictionary

The following arguments are supported:

Id string

The ID of this resource.

Name string

The name of the domain

Id string

The ID of this resource.

Name string

The name of the domain

id String

The ID of this resource.

name String

The name of the domain

id string

The ID of this resource.

name string

The name of the domain

id str

The ID of this resource.

name str

The name of the domain

id String

The ID of this resource.

name String

The name of the domain

getDnsDomainName Result

The following output properties are available:

Id string

The ID of this resource.

Name string

The name of the domain

Id string

The ID of this resource.

Name string

The name of the domain

id String

The ID of this resource.

name String

The name of the domain

id string

The ID of this resource.

name string

The name of the domain

id str

The ID of this resource.

name str

The name of the domain

id String

The ID of this resource.

name String

The name of the domain

Package Details

Repository
Civo pulumi/pulumi-civo
License
Apache-2.0
Notes

This Pulumi package is based on the civo Terraform Provider.