1. Packages
  2. AWS
  3. API Docs
  4. servicediscovery
  5. getDnsNamespace
AWS v6.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

aws.servicediscovery.getDnsNamespace

Explore with Pulumi AI

AWS v6.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

Retrieves information about a Service Discovery private or public DNS namespace.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const test = aws.servicediscovery.getDnsNamespace({
    name: "example.service.local",
    type: "DNS_PRIVATE",
});
Copy
import pulumi
import pulumi_aws as aws

test = aws.servicediscovery.get_dns_namespace(name="example.service.local",
    type="DNS_PRIVATE")
Copy
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/servicediscovery"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := servicediscovery.GetDnsNamespace(ctx, &servicediscovery.GetDnsNamespaceArgs{
			Name: "example.service.local",
			Type: "DNS_PRIVATE",
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var test = Aws.ServiceDiscovery.GetDnsNamespace.Invoke(new()
    {
        Name = "example.service.local",
        Type = "DNS_PRIVATE",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.servicediscovery.ServicediscoveryFunctions;
import com.pulumi.aws.servicediscovery.inputs.GetDnsNamespaceArgs;
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 test = ServicediscoveryFunctions.getDnsNamespace(GetDnsNamespaceArgs.builder()
            .name("example.service.local")
            .type("DNS_PRIVATE")
            .build());

    }
}
Copy
variables:
  test:
    fn::invoke:
      function: aws:servicediscovery:getDnsNamespace
      arguments:
        name: example.service.local
        type: DNS_PRIVATE
Copy

Using getDnsNamespace

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 getDnsNamespace(args: GetDnsNamespaceArgs, opts?: InvokeOptions): Promise<GetDnsNamespaceResult>
function getDnsNamespaceOutput(args: GetDnsNamespaceOutputArgs, opts?: InvokeOptions): Output<GetDnsNamespaceResult>
Copy
def get_dns_namespace(name: Optional[str] = None,
                      tags: Optional[Mapping[str, str]] = None,
                      type: Optional[str] = None,
                      opts: Optional[InvokeOptions] = None) -> GetDnsNamespaceResult
def get_dns_namespace_output(name: Optional[pulumi.Input[str]] = None,
                      tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
                      type: Optional[pulumi.Input[str]] = None,
                      opts: Optional[InvokeOptions] = None) -> Output[GetDnsNamespaceResult]
Copy
func GetDnsNamespace(ctx *Context, args *GetDnsNamespaceArgs, opts ...InvokeOption) (*GetDnsNamespaceResult, error)
func GetDnsNamespaceOutput(ctx *Context, args *GetDnsNamespaceOutputArgs, opts ...InvokeOption) GetDnsNamespaceResultOutput
Copy

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

public static class GetDnsNamespace 
{
    public static Task<GetDnsNamespaceResult> InvokeAsync(GetDnsNamespaceArgs args, InvokeOptions? opts = null)
    public static Output<GetDnsNamespaceResult> Invoke(GetDnsNamespaceInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetDnsNamespaceResult> getDnsNamespace(GetDnsNamespaceArgs args, InvokeOptions options)
public static Output<GetDnsNamespaceResult> getDnsNamespace(GetDnsNamespaceArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: aws:servicediscovery/getDnsNamespace:getDnsNamespace
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Name This property is required. string
Name of the namespace.
Type This property is required. string
Type of the namespace. Allowed values are DNS_PUBLIC or DNS_PRIVATE.
Tags Dictionary<string, string>
Map of tags for the resource.
Name This property is required. string
Name of the namespace.
Type This property is required. string
Type of the namespace. Allowed values are DNS_PUBLIC or DNS_PRIVATE.
Tags map[string]string
Map of tags for the resource.
name This property is required. String
Name of the namespace.
type This property is required. String
Type of the namespace. Allowed values are DNS_PUBLIC or DNS_PRIVATE.
tags Map<String,String>
Map of tags for the resource.
name This property is required. string
Name of the namespace.
type This property is required. string
Type of the namespace. Allowed values are DNS_PUBLIC or DNS_PRIVATE.
tags {[key: string]: string}
Map of tags for the resource.
name This property is required. str
Name of the namespace.
type This property is required. str
Type of the namespace. Allowed values are DNS_PUBLIC or DNS_PRIVATE.
tags Mapping[str, str]
Map of tags for the resource.
name This property is required. String
Name of the namespace.
type This property is required. String
Type of the namespace. Allowed values are DNS_PUBLIC or DNS_PRIVATE.
tags Map<String>
Map of tags for the resource.

getDnsNamespace Result

The following output properties are available:

Arn string
ARN of the namespace.
Description string
Description of the namespace.
HostedZone string
ID for the hosted zone that Amazon Route 53 creates when you create a namespace.
Id string
The provider-assigned unique ID for this managed resource.
Name string
Tags Dictionary<string, string>
Map of tags for the resource.
Type string
Arn string
ARN of the namespace.
Description string
Description of the namespace.
HostedZone string
ID for the hosted zone that Amazon Route 53 creates when you create a namespace.
Id string
The provider-assigned unique ID for this managed resource.
Name string
Tags map[string]string
Map of tags for the resource.
Type string
arn String
ARN of the namespace.
description String
Description of the namespace.
hostedZone String
ID for the hosted zone that Amazon Route 53 creates when you create a namespace.
id String
The provider-assigned unique ID for this managed resource.
name String
tags Map<String,String>
Map of tags for the resource.
type String
arn string
ARN of the namespace.
description string
Description of the namespace.
hostedZone string
ID for the hosted zone that Amazon Route 53 creates when you create a namespace.
id string
The provider-assigned unique ID for this managed resource.
name string
tags {[key: string]: string}
Map of tags for the resource.
type string
arn str
ARN of the namespace.
description str
Description of the namespace.
hosted_zone str
ID for the hosted zone that Amazon Route 53 creates when you create a namespace.
id str
The provider-assigned unique ID for this managed resource.
name str
tags Mapping[str, str]
Map of tags for the resource.
type str
arn String
ARN of the namespace.
description String
Description of the namespace.
hostedZone String
ID for the hosted zone that Amazon Route 53 creates when you create a namespace.
id String
The provider-assigned unique ID for this managed resource.
name String
tags Map<String>
Map of tags for the resource.
type String

Package Details

Repository
AWS Classic pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.
AWS v6.76.0 published on Tuesday, Apr 8, 2025 by Pulumi