github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/servicediscovery/getDnsNamespace.go (about)

     1  // Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
     2  // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
     3  
     4  package servicediscovery
     5  
     6  import (
     7  	"context"
     8  	"reflect"
     9  
    10  	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal"
    11  	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    12  )
    13  
    14  // Retrieves information about a Service Discovery private or public DNS namespace.
    15  //
    16  // ## Example Usage
    17  //
    18  // <!--Start PulumiCodeChooser -->
    19  // ```go
    20  // package main
    21  //
    22  // import (
    23  //
    24  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/servicediscovery"
    25  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    26  //
    27  // )
    28  //
    29  //	func main() {
    30  //		pulumi.Run(func(ctx *pulumi.Context) error {
    31  //			_, err := servicediscovery.GetDnsNamespace(ctx, &servicediscovery.GetDnsNamespaceArgs{
    32  //				Name: "example.service.local",
    33  //				Type: "DNS_PRIVATE",
    34  //			}, nil)
    35  //			if err != nil {
    36  //				return err
    37  //			}
    38  //			return nil
    39  //		})
    40  //	}
    41  //
    42  // ```
    43  // <!--End PulumiCodeChooser -->
    44  func GetDnsNamespace(ctx *pulumi.Context, args *GetDnsNamespaceArgs, opts ...pulumi.InvokeOption) (*GetDnsNamespaceResult, error) {
    45  	opts = internal.PkgInvokeDefaultOpts(opts)
    46  	var rv GetDnsNamespaceResult
    47  	err := ctx.Invoke("aws:servicediscovery/getDnsNamespace:getDnsNamespace", args, &rv, opts...)
    48  	if err != nil {
    49  		return nil, err
    50  	}
    51  	return &rv, nil
    52  }
    53  
    54  // A collection of arguments for invoking getDnsNamespace.
    55  type GetDnsNamespaceArgs struct {
    56  	// Name of the namespace.
    57  	Name string `pulumi:"name"`
    58  	// Map of tags for the resource.
    59  	Tags map[string]string `pulumi:"tags"`
    60  	// Type of the namespace. Allowed values are `DNS_PUBLIC` or `DNS_PRIVATE`.
    61  	Type string `pulumi:"type"`
    62  }
    63  
    64  // A collection of values returned by getDnsNamespace.
    65  type GetDnsNamespaceResult struct {
    66  	// ARN of the namespace.
    67  	Arn string `pulumi:"arn"`
    68  	// Description of the namespace.
    69  	Description string `pulumi:"description"`
    70  	// ID for the hosted zone that Amazon Route 53 creates when you create a namespace.
    71  	HostedZone string `pulumi:"hostedZone"`
    72  	// The provider-assigned unique ID for this managed resource.
    73  	Id   string `pulumi:"id"`
    74  	Name string `pulumi:"name"`
    75  	// Map of tags for the resource.
    76  	Tags map[string]string `pulumi:"tags"`
    77  	Type string            `pulumi:"type"`
    78  }
    79  
    80  func GetDnsNamespaceOutput(ctx *pulumi.Context, args GetDnsNamespaceOutputArgs, opts ...pulumi.InvokeOption) GetDnsNamespaceResultOutput {
    81  	return pulumi.ToOutputWithContext(context.Background(), args).
    82  		ApplyT(func(v interface{}) (GetDnsNamespaceResult, error) {
    83  			args := v.(GetDnsNamespaceArgs)
    84  			r, err := GetDnsNamespace(ctx, &args, opts...)
    85  			var s GetDnsNamespaceResult
    86  			if r != nil {
    87  				s = *r
    88  			}
    89  			return s, err
    90  		}).(GetDnsNamespaceResultOutput)
    91  }
    92  
    93  // A collection of arguments for invoking getDnsNamespace.
    94  type GetDnsNamespaceOutputArgs struct {
    95  	// Name of the namespace.
    96  	Name pulumi.StringInput `pulumi:"name"`
    97  	// Map of tags for the resource.
    98  	Tags pulumi.StringMapInput `pulumi:"tags"`
    99  	// Type of the namespace. Allowed values are `DNS_PUBLIC` or `DNS_PRIVATE`.
   100  	Type pulumi.StringInput `pulumi:"type"`
   101  }
   102  
   103  func (GetDnsNamespaceOutputArgs) ElementType() reflect.Type {
   104  	return reflect.TypeOf((*GetDnsNamespaceArgs)(nil)).Elem()
   105  }
   106  
   107  // A collection of values returned by getDnsNamespace.
   108  type GetDnsNamespaceResultOutput struct{ *pulumi.OutputState }
   109  
   110  func (GetDnsNamespaceResultOutput) ElementType() reflect.Type {
   111  	return reflect.TypeOf((*GetDnsNamespaceResult)(nil)).Elem()
   112  }
   113  
   114  func (o GetDnsNamespaceResultOutput) ToGetDnsNamespaceResultOutput() GetDnsNamespaceResultOutput {
   115  	return o
   116  }
   117  
   118  func (o GetDnsNamespaceResultOutput) ToGetDnsNamespaceResultOutputWithContext(ctx context.Context) GetDnsNamespaceResultOutput {
   119  	return o
   120  }
   121  
   122  // ARN of the namespace.
   123  func (o GetDnsNamespaceResultOutput) Arn() pulumi.StringOutput {
   124  	return o.ApplyT(func(v GetDnsNamespaceResult) string { return v.Arn }).(pulumi.StringOutput)
   125  }
   126  
   127  // Description of the namespace.
   128  func (o GetDnsNamespaceResultOutput) Description() pulumi.StringOutput {
   129  	return o.ApplyT(func(v GetDnsNamespaceResult) string { return v.Description }).(pulumi.StringOutput)
   130  }
   131  
   132  // ID for the hosted zone that Amazon Route 53 creates when you create a namespace.
   133  func (o GetDnsNamespaceResultOutput) HostedZone() pulumi.StringOutput {
   134  	return o.ApplyT(func(v GetDnsNamespaceResult) string { return v.HostedZone }).(pulumi.StringOutput)
   135  }
   136  
   137  // The provider-assigned unique ID for this managed resource.
   138  func (o GetDnsNamespaceResultOutput) Id() pulumi.StringOutput {
   139  	return o.ApplyT(func(v GetDnsNamespaceResult) string { return v.Id }).(pulumi.StringOutput)
   140  }
   141  
   142  func (o GetDnsNamespaceResultOutput) Name() pulumi.StringOutput {
   143  	return o.ApplyT(func(v GetDnsNamespaceResult) string { return v.Name }).(pulumi.StringOutput)
   144  }
   145  
   146  // Map of tags for the resource.
   147  func (o GetDnsNamespaceResultOutput) Tags() pulumi.StringMapOutput {
   148  	return o.ApplyT(func(v GetDnsNamespaceResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput)
   149  }
   150  
   151  func (o GetDnsNamespaceResultOutput) Type() pulumi.StringOutput {
   152  	return o.ApplyT(func(v GetDnsNamespaceResult) string { return v.Type }).(pulumi.StringOutput)
   153  }
   154  
   155  func init() {
   156  	pulumi.RegisterOutputType(GetDnsNamespaceResultOutput{})
   157  }