github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/route53/delegationSet.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 route53
     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 [Route53 Delegation Set](https://docs.aws.amazon.com/Route53/latest/APIReference/API-actions-by-function.html#actions-by-function-reusable-delegation-sets) 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/route53"
    25  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    26  //
    27  // )
    28  //
    29  //	func main() {
    30  //		pulumi.Run(func(ctx *pulumi.Context) error {
    31  //			main, err := route53.NewDelegationSet(ctx, "main", &route53.DelegationSetArgs{
    32  //				ReferenceName: pulumi.String("DynDNS"),
    33  //			})
    34  //			if err != nil {
    35  //				return err
    36  //			}
    37  //			_, err = route53.NewZone(ctx, "primary", &route53.ZoneArgs{
    38  //				Name:            pulumi.String("mydomain.com"),
    39  //				DelegationSetId: main.ID(),
    40  //			})
    41  //			if err != nil {
    42  //				return err
    43  //			}
    44  //			_, err = route53.NewZone(ctx, "secondary", &route53.ZoneArgs{
    45  //				Name:            pulumi.String("coolcompany.io"),
    46  //				DelegationSetId: main.ID(),
    47  //			})
    48  //			if err != nil {
    49  //				return err
    50  //			}
    51  //			return nil
    52  //		})
    53  //	}
    54  //
    55  // ```
    56  // <!--End PulumiCodeChooser -->
    57  //
    58  // ## Import
    59  //
    60  // Using `pulumi import`, import Route53 Delegation Sets using the delegation set `id`. For example:
    61  //
    62  // ```sh
    63  // $ pulumi import aws:route53/delegationSet:DelegationSet set1 N1PA6795SAMPLE
    64  // ```
    65  type DelegationSet struct {
    66  	pulumi.CustomResourceState
    67  
    68  	// The Amazon Resource Name (ARN) of the Delegation Set.
    69  	Arn pulumi.StringOutput `pulumi:"arn"`
    70  	// A list of authoritative name servers for the hosted zone
    71  	// (effectively a list of NS records).
    72  	NameServers pulumi.StringArrayOutput `pulumi:"nameServers"`
    73  	// This is a reference name used in Caller Reference
    74  	// (helpful for identifying single delegation set amongst others)
    75  	ReferenceName pulumi.StringPtrOutput `pulumi:"referenceName"`
    76  }
    77  
    78  // NewDelegationSet registers a new resource with the given unique name, arguments, and options.
    79  func NewDelegationSet(ctx *pulumi.Context,
    80  	name string, args *DelegationSetArgs, opts ...pulumi.ResourceOption) (*DelegationSet, error) {
    81  	if args == nil {
    82  		args = &DelegationSetArgs{}
    83  	}
    84  
    85  	opts = internal.PkgResourceDefaultOpts(opts)
    86  	var resource DelegationSet
    87  	err := ctx.RegisterResource("aws:route53/delegationSet:DelegationSet", name, args, &resource, opts...)
    88  	if err != nil {
    89  		return nil, err
    90  	}
    91  	return &resource, nil
    92  }
    93  
    94  // GetDelegationSet gets an existing DelegationSet resource's state with the given name, ID, and optional
    95  // state properties that are used to uniquely qualify the lookup (nil if not required).
    96  func GetDelegationSet(ctx *pulumi.Context,
    97  	name string, id pulumi.IDInput, state *DelegationSetState, opts ...pulumi.ResourceOption) (*DelegationSet, error) {
    98  	var resource DelegationSet
    99  	err := ctx.ReadResource("aws:route53/delegationSet:DelegationSet", name, id, state, &resource, opts...)
   100  	if err != nil {
   101  		return nil, err
   102  	}
   103  	return &resource, nil
   104  }
   105  
   106  // Input properties used for looking up and filtering DelegationSet resources.
   107  type delegationSetState struct {
   108  	// The Amazon Resource Name (ARN) of the Delegation Set.
   109  	Arn *string `pulumi:"arn"`
   110  	// A list of authoritative name servers for the hosted zone
   111  	// (effectively a list of NS records).
   112  	NameServers []string `pulumi:"nameServers"`
   113  	// This is a reference name used in Caller Reference
   114  	// (helpful for identifying single delegation set amongst others)
   115  	ReferenceName *string `pulumi:"referenceName"`
   116  }
   117  
   118  type DelegationSetState struct {
   119  	// The Amazon Resource Name (ARN) of the Delegation Set.
   120  	Arn pulumi.StringPtrInput
   121  	// A list of authoritative name servers for the hosted zone
   122  	// (effectively a list of NS records).
   123  	NameServers pulumi.StringArrayInput
   124  	// This is a reference name used in Caller Reference
   125  	// (helpful for identifying single delegation set amongst others)
   126  	ReferenceName pulumi.StringPtrInput
   127  }
   128  
   129  func (DelegationSetState) ElementType() reflect.Type {
   130  	return reflect.TypeOf((*delegationSetState)(nil)).Elem()
   131  }
   132  
   133  type delegationSetArgs struct {
   134  	// This is a reference name used in Caller Reference
   135  	// (helpful for identifying single delegation set amongst others)
   136  	ReferenceName *string `pulumi:"referenceName"`
   137  }
   138  
   139  // The set of arguments for constructing a DelegationSet resource.
   140  type DelegationSetArgs struct {
   141  	// This is a reference name used in Caller Reference
   142  	// (helpful for identifying single delegation set amongst others)
   143  	ReferenceName pulumi.StringPtrInput
   144  }
   145  
   146  func (DelegationSetArgs) ElementType() reflect.Type {
   147  	return reflect.TypeOf((*delegationSetArgs)(nil)).Elem()
   148  }
   149  
   150  type DelegationSetInput interface {
   151  	pulumi.Input
   152  
   153  	ToDelegationSetOutput() DelegationSetOutput
   154  	ToDelegationSetOutputWithContext(ctx context.Context) DelegationSetOutput
   155  }
   156  
   157  func (*DelegationSet) ElementType() reflect.Type {
   158  	return reflect.TypeOf((**DelegationSet)(nil)).Elem()
   159  }
   160  
   161  func (i *DelegationSet) ToDelegationSetOutput() DelegationSetOutput {
   162  	return i.ToDelegationSetOutputWithContext(context.Background())
   163  }
   164  
   165  func (i *DelegationSet) ToDelegationSetOutputWithContext(ctx context.Context) DelegationSetOutput {
   166  	return pulumi.ToOutputWithContext(ctx, i).(DelegationSetOutput)
   167  }
   168  
   169  // DelegationSetArrayInput is an input type that accepts DelegationSetArray and DelegationSetArrayOutput values.
   170  // You can construct a concrete instance of `DelegationSetArrayInput` via:
   171  //
   172  //	DelegationSetArray{ DelegationSetArgs{...} }
   173  type DelegationSetArrayInput interface {
   174  	pulumi.Input
   175  
   176  	ToDelegationSetArrayOutput() DelegationSetArrayOutput
   177  	ToDelegationSetArrayOutputWithContext(context.Context) DelegationSetArrayOutput
   178  }
   179  
   180  type DelegationSetArray []DelegationSetInput
   181  
   182  func (DelegationSetArray) ElementType() reflect.Type {
   183  	return reflect.TypeOf((*[]*DelegationSet)(nil)).Elem()
   184  }
   185  
   186  func (i DelegationSetArray) ToDelegationSetArrayOutput() DelegationSetArrayOutput {
   187  	return i.ToDelegationSetArrayOutputWithContext(context.Background())
   188  }
   189  
   190  func (i DelegationSetArray) ToDelegationSetArrayOutputWithContext(ctx context.Context) DelegationSetArrayOutput {
   191  	return pulumi.ToOutputWithContext(ctx, i).(DelegationSetArrayOutput)
   192  }
   193  
   194  // DelegationSetMapInput is an input type that accepts DelegationSetMap and DelegationSetMapOutput values.
   195  // You can construct a concrete instance of `DelegationSetMapInput` via:
   196  //
   197  //	DelegationSetMap{ "key": DelegationSetArgs{...} }
   198  type DelegationSetMapInput interface {
   199  	pulumi.Input
   200  
   201  	ToDelegationSetMapOutput() DelegationSetMapOutput
   202  	ToDelegationSetMapOutputWithContext(context.Context) DelegationSetMapOutput
   203  }
   204  
   205  type DelegationSetMap map[string]DelegationSetInput
   206  
   207  func (DelegationSetMap) ElementType() reflect.Type {
   208  	return reflect.TypeOf((*map[string]*DelegationSet)(nil)).Elem()
   209  }
   210  
   211  func (i DelegationSetMap) ToDelegationSetMapOutput() DelegationSetMapOutput {
   212  	return i.ToDelegationSetMapOutputWithContext(context.Background())
   213  }
   214  
   215  func (i DelegationSetMap) ToDelegationSetMapOutputWithContext(ctx context.Context) DelegationSetMapOutput {
   216  	return pulumi.ToOutputWithContext(ctx, i).(DelegationSetMapOutput)
   217  }
   218  
   219  type DelegationSetOutput struct{ *pulumi.OutputState }
   220  
   221  func (DelegationSetOutput) ElementType() reflect.Type {
   222  	return reflect.TypeOf((**DelegationSet)(nil)).Elem()
   223  }
   224  
   225  func (o DelegationSetOutput) ToDelegationSetOutput() DelegationSetOutput {
   226  	return o
   227  }
   228  
   229  func (o DelegationSetOutput) ToDelegationSetOutputWithContext(ctx context.Context) DelegationSetOutput {
   230  	return o
   231  }
   232  
   233  // The Amazon Resource Name (ARN) of the Delegation Set.
   234  func (o DelegationSetOutput) Arn() pulumi.StringOutput {
   235  	return o.ApplyT(func(v *DelegationSet) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   236  }
   237  
   238  // A list of authoritative name servers for the hosted zone
   239  // (effectively a list of NS records).
   240  func (o DelegationSetOutput) NameServers() pulumi.StringArrayOutput {
   241  	return o.ApplyT(func(v *DelegationSet) pulumi.StringArrayOutput { return v.NameServers }).(pulumi.StringArrayOutput)
   242  }
   243  
   244  // This is a reference name used in Caller Reference
   245  // (helpful for identifying single delegation set amongst others)
   246  func (o DelegationSetOutput) ReferenceName() pulumi.StringPtrOutput {
   247  	return o.ApplyT(func(v *DelegationSet) pulumi.StringPtrOutput { return v.ReferenceName }).(pulumi.StringPtrOutput)
   248  }
   249  
   250  type DelegationSetArrayOutput struct{ *pulumi.OutputState }
   251  
   252  func (DelegationSetArrayOutput) ElementType() reflect.Type {
   253  	return reflect.TypeOf((*[]*DelegationSet)(nil)).Elem()
   254  }
   255  
   256  func (o DelegationSetArrayOutput) ToDelegationSetArrayOutput() DelegationSetArrayOutput {
   257  	return o
   258  }
   259  
   260  func (o DelegationSetArrayOutput) ToDelegationSetArrayOutputWithContext(ctx context.Context) DelegationSetArrayOutput {
   261  	return o
   262  }
   263  
   264  func (o DelegationSetArrayOutput) Index(i pulumi.IntInput) DelegationSetOutput {
   265  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *DelegationSet {
   266  		return vs[0].([]*DelegationSet)[vs[1].(int)]
   267  	}).(DelegationSetOutput)
   268  }
   269  
   270  type DelegationSetMapOutput struct{ *pulumi.OutputState }
   271  
   272  func (DelegationSetMapOutput) ElementType() reflect.Type {
   273  	return reflect.TypeOf((*map[string]*DelegationSet)(nil)).Elem()
   274  }
   275  
   276  func (o DelegationSetMapOutput) ToDelegationSetMapOutput() DelegationSetMapOutput {
   277  	return o
   278  }
   279  
   280  func (o DelegationSetMapOutput) ToDelegationSetMapOutputWithContext(ctx context.Context) DelegationSetMapOutput {
   281  	return o
   282  }
   283  
   284  func (o DelegationSetMapOutput) MapIndex(k pulumi.StringInput) DelegationSetOutput {
   285  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *DelegationSet {
   286  		return vs[0].(map[string]*DelegationSet)[vs[1].(string)]
   287  	}).(DelegationSetOutput)
   288  }
   289  
   290  func init() {
   291  	pulumi.RegisterInputType(reflect.TypeOf((*DelegationSetInput)(nil)).Elem(), &DelegationSet{})
   292  	pulumi.RegisterInputType(reflect.TypeOf((*DelegationSetArrayInput)(nil)).Elem(), DelegationSetArray{})
   293  	pulumi.RegisterInputType(reflect.TypeOf((*DelegationSetMapInput)(nil)).Elem(), DelegationSetMap{})
   294  	pulumi.RegisterOutputType(DelegationSetOutput{})
   295  	pulumi.RegisterOutputType(DelegationSetArrayOutput{})
   296  	pulumi.RegisterOutputType(DelegationSetMapOutput{})
   297  }