Civo

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

getDnsDomainName

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 = "domain.com",
        }));
        this.DomainOutput = domain.Apply(domain => domain.Name);
        this.DomainIdOutput = domain.Apply(domain => domain.Id);
    }

    [Output("domainOutput")]
    public Output<string> DomainOutput { get; set; }
    [Output("domainIdOutput")]
    public Output<string> DomainIdOutput { 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
		}
		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
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

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

This Pulumi package is based on the civo Terraform Provider.