1. Packages
  2. Civo Provider
  3. API Docs
  4. getDnsDomainName
civo 1.1.5 published on Thursday, Feb 6, 2025 by civo

civo.getDnsDomainName

Explore with Pulumi AI

civo 1.1.5 published on Thursday, Feb 6, 2025 by civo

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

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);
Copy
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)
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/civo/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
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
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),
    };
});
Copy
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()));
    }
}
Copy
variables:
  domain:
    fn::invoke:
      function: civo:getDnsDomainName
      arguments:
        name: domain.com
outputs:
  domainOutput: ${domain.name}
  domainIdOutput: ${domain.id}
Copy

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>
Copy
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]
Copy
func LookupDnsDomainName(ctx *Context, args *LookupDnsDomainNameArgs, opts ...InvokeOption) (*LookupDnsDomainNameResult, error)
func LookupDnsDomainNameOutput(ctx *Context, args *LookupDnsDomainNameOutputArgs, opts ...InvokeOption) LookupDnsDomainNameResultOutput
Copy

> 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)
}
Copy
public static CompletableFuture<GetDnsDomainNameResult> getDnsDomainName(GetDnsDomainNameArgs args, InvokeOptions options)
public static Output<GetDnsDomainNameResult> getDnsDomainName(GetDnsDomainNameArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: civo:index/getDnsDomainName:getDnsDomainName
  arguments:
    # arguments dictionary
Copy

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 civo/terraform-provider-civo
License
Notes
This Pulumi package is based on the civo Terraform Provider.
civo 1.1.5 published on Thursday, Feb 6, 2025 by civo