github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/servicediscovery/publicDnsNamespace.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  // Provides a Service Discovery Public DNS Namespace resource.
    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.NewPublicDnsNamespace(ctx, "example", &servicediscovery.PublicDnsNamespaceArgs{
    32  //				Name:        pulumi.String("hoge.example.com"),
    33  //				Description: pulumi.String("example"),
    34  //			})
    35  //			if err != nil {
    36  //				return err
    37  //			}
    38  //			return nil
    39  //		})
    40  //	}
    41  //
    42  // ```
    43  // <!--End PulumiCodeChooser -->
    44  //
    45  // ## Import
    46  //
    47  // Using `pulumi import`, import Service Discovery Public DNS Namespace using the namespace ID. For example:
    48  //
    49  // ```sh
    50  // $ pulumi import aws:servicediscovery/publicDnsNamespace:PublicDnsNamespace example 0123456789
    51  // ```
    52  type PublicDnsNamespace struct {
    53  	pulumi.CustomResourceState
    54  
    55  	// The ARN that Amazon Route 53 assigns to the namespace when you create it.
    56  	Arn pulumi.StringOutput `pulumi:"arn"`
    57  	// The description that you specify for the namespace when you create it.
    58  	Description pulumi.StringPtrOutput `pulumi:"description"`
    59  	// The ID for the hosted zone that Amazon Route 53 creates when you create a namespace.
    60  	HostedZone pulumi.StringOutput `pulumi:"hostedZone"`
    61  	// The name of the namespace.
    62  	Name pulumi.StringOutput `pulumi:"name"`
    63  	// A map of tags to assign to the namespace. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    64  	Tags pulumi.StringMapOutput `pulumi:"tags"`
    65  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
    66  	//
    67  	// Deprecated: Please use `tags` instead.
    68  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
    69  }
    70  
    71  // NewPublicDnsNamespace registers a new resource with the given unique name, arguments, and options.
    72  func NewPublicDnsNamespace(ctx *pulumi.Context,
    73  	name string, args *PublicDnsNamespaceArgs, opts ...pulumi.ResourceOption) (*PublicDnsNamespace, error) {
    74  	if args == nil {
    75  		args = &PublicDnsNamespaceArgs{}
    76  	}
    77  
    78  	opts = internal.PkgResourceDefaultOpts(opts)
    79  	var resource PublicDnsNamespace
    80  	err := ctx.RegisterResource("aws:servicediscovery/publicDnsNamespace:PublicDnsNamespace", name, args, &resource, opts...)
    81  	if err != nil {
    82  		return nil, err
    83  	}
    84  	return &resource, nil
    85  }
    86  
    87  // GetPublicDnsNamespace gets an existing PublicDnsNamespace resource's state with the given name, ID, and optional
    88  // state properties that are used to uniquely qualify the lookup (nil if not required).
    89  func GetPublicDnsNamespace(ctx *pulumi.Context,
    90  	name string, id pulumi.IDInput, state *PublicDnsNamespaceState, opts ...pulumi.ResourceOption) (*PublicDnsNamespace, error) {
    91  	var resource PublicDnsNamespace
    92  	err := ctx.ReadResource("aws:servicediscovery/publicDnsNamespace:PublicDnsNamespace", name, id, state, &resource, opts...)
    93  	if err != nil {
    94  		return nil, err
    95  	}
    96  	return &resource, nil
    97  }
    98  
    99  // Input properties used for looking up and filtering PublicDnsNamespace resources.
   100  type publicDnsNamespaceState struct {
   101  	// The ARN that Amazon Route 53 assigns to the namespace when you create it.
   102  	Arn *string `pulumi:"arn"`
   103  	// The description that you specify for the namespace when you create it.
   104  	Description *string `pulumi:"description"`
   105  	// The ID for the hosted zone that Amazon Route 53 creates when you create a namespace.
   106  	HostedZone *string `pulumi:"hostedZone"`
   107  	// The name of the namespace.
   108  	Name *string `pulumi:"name"`
   109  	// A map of tags to assign to the namespace. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   110  	Tags map[string]string `pulumi:"tags"`
   111  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   112  	//
   113  	// Deprecated: Please use `tags` instead.
   114  	TagsAll map[string]string `pulumi:"tagsAll"`
   115  }
   116  
   117  type PublicDnsNamespaceState struct {
   118  	// The ARN that Amazon Route 53 assigns to the namespace when you create it.
   119  	Arn pulumi.StringPtrInput
   120  	// The description that you specify for the namespace when you create it.
   121  	Description pulumi.StringPtrInput
   122  	// The ID for the hosted zone that Amazon Route 53 creates when you create a namespace.
   123  	HostedZone pulumi.StringPtrInput
   124  	// The name of the namespace.
   125  	Name pulumi.StringPtrInput
   126  	// A map of tags to assign to the namespace. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   127  	Tags pulumi.StringMapInput
   128  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   129  	//
   130  	// Deprecated: Please use `tags` instead.
   131  	TagsAll pulumi.StringMapInput
   132  }
   133  
   134  func (PublicDnsNamespaceState) ElementType() reflect.Type {
   135  	return reflect.TypeOf((*publicDnsNamespaceState)(nil)).Elem()
   136  }
   137  
   138  type publicDnsNamespaceArgs struct {
   139  	// The description that you specify for the namespace when you create it.
   140  	Description *string `pulumi:"description"`
   141  	// The name of the namespace.
   142  	Name *string `pulumi:"name"`
   143  	// A map of tags to assign to the namespace. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   144  	Tags map[string]string `pulumi:"tags"`
   145  }
   146  
   147  // The set of arguments for constructing a PublicDnsNamespace resource.
   148  type PublicDnsNamespaceArgs struct {
   149  	// The description that you specify for the namespace when you create it.
   150  	Description pulumi.StringPtrInput
   151  	// The name of the namespace.
   152  	Name pulumi.StringPtrInput
   153  	// A map of tags to assign to the namespace. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   154  	Tags pulumi.StringMapInput
   155  }
   156  
   157  func (PublicDnsNamespaceArgs) ElementType() reflect.Type {
   158  	return reflect.TypeOf((*publicDnsNamespaceArgs)(nil)).Elem()
   159  }
   160  
   161  type PublicDnsNamespaceInput interface {
   162  	pulumi.Input
   163  
   164  	ToPublicDnsNamespaceOutput() PublicDnsNamespaceOutput
   165  	ToPublicDnsNamespaceOutputWithContext(ctx context.Context) PublicDnsNamespaceOutput
   166  }
   167  
   168  func (*PublicDnsNamespace) ElementType() reflect.Type {
   169  	return reflect.TypeOf((**PublicDnsNamespace)(nil)).Elem()
   170  }
   171  
   172  func (i *PublicDnsNamespace) ToPublicDnsNamespaceOutput() PublicDnsNamespaceOutput {
   173  	return i.ToPublicDnsNamespaceOutputWithContext(context.Background())
   174  }
   175  
   176  func (i *PublicDnsNamespace) ToPublicDnsNamespaceOutputWithContext(ctx context.Context) PublicDnsNamespaceOutput {
   177  	return pulumi.ToOutputWithContext(ctx, i).(PublicDnsNamespaceOutput)
   178  }
   179  
   180  // PublicDnsNamespaceArrayInput is an input type that accepts PublicDnsNamespaceArray and PublicDnsNamespaceArrayOutput values.
   181  // You can construct a concrete instance of `PublicDnsNamespaceArrayInput` via:
   182  //
   183  //	PublicDnsNamespaceArray{ PublicDnsNamespaceArgs{...} }
   184  type PublicDnsNamespaceArrayInput interface {
   185  	pulumi.Input
   186  
   187  	ToPublicDnsNamespaceArrayOutput() PublicDnsNamespaceArrayOutput
   188  	ToPublicDnsNamespaceArrayOutputWithContext(context.Context) PublicDnsNamespaceArrayOutput
   189  }
   190  
   191  type PublicDnsNamespaceArray []PublicDnsNamespaceInput
   192  
   193  func (PublicDnsNamespaceArray) ElementType() reflect.Type {
   194  	return reflect.TypeOf((*[]*PublicDnsNamespace)(nil)).Elem()
   195  }
   196  
   197  func (i PublicDnsNamespaceArray) ToPublicDnsNamespaceArrayOutput() PublicDnsNamespaceArrayOutput {
   198  	return i.ToPublicDnsNamespaceArrayOutputWithContext(context.Background())
   199  }
   200  
   201  func (i PublicDnsNamespaceArray) ToPublicDnsNamespaceArrayOutputWithContext(ctx context.Context) PublicDnsNamespaceArrayOutput {
   202  	return pulumi.ToOutputWithContext(ctx, i).(PublicDnsNamespaceArrayOutput)
   203  }
   204  
   205  // PublicDnsNamespaceMapInput is an input type that accepts PublicDnsNamespaceMap and PublicDnsNamespaceMapOutput values.
   206  // You can construct a concrete instance of `PublicDnsNamespaceMapInput` via:
   207  //
   208  //	PublicDnsNamespaceMap{ "key": PublicDnsNamespaceArgs{...} }
   209  type PublicDnsNamespaceMapInput interface {
   210  	pulumi.Input
   211  
   212  	ToPublicDnsNamespaceMapOutput() PublicDnsNamespaceMapOutput
   213  	ToPublicDnsNamespaceMapOutputWithContext(context.Context) PublicDnsNamespaceMapOutput
   214  }
   215  
   216  type PublicDnsNamespaceMap map[string]PublicDnsNamespaceInput
   217  
   218  func (PublicDnsNamespaceMap) ElementType() reflect.Type {
   219  	return reflect.TypeOf((*map[string]*PublicDnsNamespace)(nil)).Elem()
   220  }
   221  
   222  func (i PublicDnsNamespaceMap) ToPublicDnsNamespaceMapOutput() PublicDnsNamespaceMapOutput {
   223  	return i.ToPublicDnsNamespaceMapOutputWithContext(context.Background())
   224  }
   225  
   226  func (i PublicDnsNamespaceMap) ToPublicDnsNamespaceMapOutputWithContext(ctx context.Context) PublicDnsNamespaceMapOutput {
   227  	return pulumi.ToOutputWithContext(ctx, i).(PublicDnsNamespaceMapOutput)
   228  }
   229  
   230  type PublicDnsNamespaceOutput struct{ *pulumi.OutputState }
   231  
   232  func (PublicDnsNamespaceOutput) ElementType() reflect.Type {
   233  	return reflect.TypeOf((**PublicDnsNamespace)(nil)).Elem()
   234  }
   235  
   236  func (o PublicDnsNamespaceOutput) ToPublicDnsNamespaceOutput() PublicDnsNamespaceOutput {
   237  	return o
   238  }
   239  
   240  func (o PublicDnsNamespaceOutput) ToPublicDnsNamespaceOutputWithContext(ctx context.Context) PublicDnsNamespaceOutput {
   241  	return o
   242  }
   243  
   244  // The ARN that Amazon Route 53 assigns to the namespace when you create it.
   245  func (o PublicDnsNamespaceOutput) Arn() pulumi.StringOutput {
   246  	return o.ApplyT(func(v *PublicDnsNamespace) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   247  }
   248  
   249  // The description that you specify for the namespace when you create it.
   250  func (o PublicDnsNamespaceOutput) Description() pulumi.StringPtrOutput {
   251  	return o.ApplyT(func(v *PublicDnsNamespace) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)
   252  }
   253  
   254  // The ID for the hosted zone that Amazon Route 53 creates when you create a namespace.
   255  func (o PublicDnsNamespaceOutput) HostedZone() pulumi.StringOutput {
   256  	return o.ApplyT(func(v *PublicDnsNamespace) pulumi.StringOutput { return v.HostedZone }).(pulumi.StringOutput)
   257  }
   258  
   259  // The name of the namespace.
   260  func (o PublicDnsNamespaceOutput) Name() pulumi.StringOutput {
   261  	return o.ApplyT(func(v *PublicDnsNamespace) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
   262  }
   263  
   264  // A map of tags to assign to the namespace. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   265  func (o PublicDnsNamespaceOutput) Tags() pulumi.StringMapOutput {
   266  	return o.ApplyT(func(v *PublicDnsNamespace) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   267  }
   268  
   269  // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   270  //
   271  // Deprecated: Please use `tags` instead.
   272  func (o PublicDnsNamespaceOutput) TagsAll() pulumi.StringMapOutput {
   273  	return o.ApplyT(func(v *PublicDnsNamespace) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   274  }
   275  
   276  type PublicDnsNamespaceArrayOutput struct{ *pulumi.OutputState }
   277  
   278  func (PublicDnsNamespaceArrayOutput) ElementType() reflect.Type {
   279  	return reflect.TypeOf((*[]*PublicDnsNamespace)(nil)).Elem()
   280  }
   281  
   282  func (o PublicDnsNamespaceArrayOutput) ToPublicDnsNamespaceArrayOutput() PublicDnsNamespaceArrayOutput {
   283  	return o
   284  }
   285  
   286  func (o PublicDnsNamespaceArrayOutput) ToPublicDnsNamespaceArrayOutputWithContext(ctx context.Context) PublicDnsNamespaceArrayOutput {
   287  	return o
   288  }
   289  
   290  func (o PublicDnsNamespaceArrayOutput) Index(i pulumi.IntInput) PublicDnsNamespaceOutput {
   291  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *PublicDnsNamespace {
   292  		return vs[0].([]*PublicDnsNamespace)[vs[1].(int)]
   293  	}).(PublicDnsNamespaceOutput)
   294  }
   295  
   296  type PublicDnsNamespaceMapOutput struct{ *pulumi.OutputState }
   297  
   298  func (PublicDnsNamespaceMapOutput) ElementType() reflect.Type {
   299  	return reflect.TypeOf((*map[string]*PublicDnsNamespace)(nil)).Elem()
   300  }
   301  
   302  func (o PublicDnsNamespaceMapOutput) ToPublicDnsNamespaceMapOutput() PublicDnsNamespaceMapOutput {
   303  	return o
   304  }
   305  
   306  func (o PublicDnsNamespaceMapOutput) ToPublicDnsNamespaceMapOutputWithContext(ctx context.Context) PublicDnsNamespaceMapOutput {
   307  	return o
   308  }
   309  
   310  func (o PublicDnsNamespaceMapOutput) MapIndex(k pulumi.StringInput) PublicDnsNamespaceOutput {
   311  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *PublicDnsNamespace {
   312  		return vs[0].(map[string]*PublicDnsNamespace)[vs[1].(string)]
   313  	}).(PublicDnsNamespaceOutput)
   314  }
   315  
   316  func init() {
   317  	pulumi.RegisterInputType(reflect.TypeOf((*PublicDnsNamespaceInput)(nil)).Elem(), &PublicDnsNamespace{})
   318  	pulumi.RegisterInputType(reflect.TypeOf((*PublicDnsNamespaceArrayInput)(nil)).Elem(), PublicDnsNamespaceArray{})
   319  	pulumi.RegisterInputType(reflect.TypeOf((*PublicDnsNamespaceMapInput)(nil)).Elem(), PublicDnsNamespaceMap{})
   320  	pulumi.RegisterOutputType(PublicDnsNamespaceOutput{})
   321  	pulumi.RegisterOutputType(PublicDnsNamespaceArrayOutput{})
   322  	pulumi.RegisterOutputType(PublicDnsNamespaceMapOutput{})
   323  }