github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/directoryservice/conditionalForwader.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 directoryservice
     5  
     6  import (
     7  	"context"
     8  	"reflect"
     9  
    10  	"errors"
    11  	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal"
    12  	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    13  )
    14  
    15  // Provides a conditional forwarder for managed Microsoft AD in AWS Directory Service.
    16  //
    17  // ## Example Usage
    18  //
    19  // <!--Start PulumiCodeChooser -->
    20  // ```go
    21  // package main
    22  //
    23  // import (
    24  //
    25  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/directoryservice"
    26  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    27  //
    28  // )
    29  //
    30  //	func main() {
    31  //		pulumi.Run(func(ctx *pulumi.Context) error {
    32  //			_, err := directoryservice.NewConditionalForwader(ctx, "example", &directoryservice.ConditionalForwaderArgs{
    33  //				DirectoryId:      pulumi.Any(ad.Id),
    34  //				RemoteDomainName: pulumi.String("example.com"),
    35  //				DnsIps: pulumi.StringArray{
    36  //					pulumi.String("8.8.8.8"),
    37  //					pulumi.String("8.8.4.4"),
    38  //				},
    39  //			})
    40  //			if err != nil {
    41  //				return err
    42  //			}
    43  //			return nil
    44  //		})
    45  //	}
    46  //
    47  // ```
    48  // <!--End PulumiCodeChooser -->
    49  //
    50  // ## Import
    51  //
    52  // Using `pulumi import`, import conditional forwarders using the directory id and remote_domain_name. For example:
    53  //
    54  // ```sh
    55  // $ pulumi import aws:directoryservice/conditionalForwader:ConditionalForwader example d-1234567890:example.com
    56  // ```
    57  type ConditionalForwader struct {
    58  	pulumi.CustomResourceState
    59  
    60  	// ID of directory.
    61  	DirectoryId pulumi.StringOutput `pulumi:"directoryId"`
    62  	// A list of forwarder IP addresses.
    63  	DnsIps pulumi.StringArrayOutput `pulumi:"dnsIps"`
    64  	// The fully qualified domain name of the remote domain for which forwarders will be used.
    65  	RemoteDomainName pulumi.StringOutput `pulumi:"remoteDomainName"`
    66  }
    67  
    68  // NewConditionalForwader registers a new resource with the given unique name, arguments, and options.
    69  func NewConditionalForwader(ctx *pulumi.Context,
    70  	name string, args *ConditionalForwaderArgs, opts ...pulumi.ResourceOption) (*ConditionalForwader, error) {
    71  	if args == nil {
    72  		return nil, errors.New("missing one or more required arguments")
    73  	}
    74  
    75  	if args.DirectoryId == nil {
    76  		return nil, errors.New("invalid value for required argument 'DirectoryId'")
    77  	}
    78  	if args.DnsIps == nil {
    79  		return nil, errors.New("invalid value for required argument 'DnsIps'")
    80  	}
    81  	if args.RemoteDomainName == nil {
    82  		return nil, errors.New("invalid value for required argument 'RemoteDomainName'")
    83  	}
    84  	opts = internal.PkgResourceDefaultOpts(opts)
    85  	var resource ConditionalForwader
    86  	err := ctx.RegisterResource("aws:directoryservice/conditionalForwader:ConditionalForwader", name, args, &resource, opts...)
    87  	if err != nil {
    88  		return nil, err
    89  	}
    90  	return &resource, nil
    91  }
    92  
    93  // GetConditionalForwader gets an existing ConditionalForwader resource's state with the given name, ID, and optional
    94  // state properties that are used to uniquely qualify the lookup (nil if not required).
    95  func GetConditionalForwader(ctx *pulumi.Context,
    96  	name string, id pulumi.IDInput, state *ConditionalForwaderState, opts ...pulumi.ResourceOption) (*ConditionalForwader, error) {
    97  	var resource ConditionalForwader
    98  	err := ctx.ReadResource("aws:directoryservice/conditionalForwader:ConditionalForwader", name, id, state, &resource, opts...)
    99  	if err != nil {
   100  		return nil, err
   101  	}
   102  	return &resource, nil
   103  }
   104  
   105  // Input properties used for looking up and filtering ConditionalForwader resources.
   106  type conditionalForwaderState struct {
   107  	// ID of directory.
   108  	DirectoryId *string `pulumi:"directoryId"`
   109  	// A list of forwarder IP addresses.
   110  	DnsIps []string `pulumi:"dnsIps"`
   111  	// The fully qualified domain name of the remote domain for which forwarders will be used.
   112  	RemoteDomainName *string `pulumi:"remoteDomainName"`
   113  }
   114  
   115  type ConditionalForwaderState struct {
   116  	// ID of directory.
   117  	DirectoryId pulumi.StringPtrInput
   118  	// A list of forwarder IP addresses.
   119  	DnsIps pulumi.StringArrayInput
   120  	// The fully qualified domain name of the remote domain for which forwarders will be used.
   121  	RemoteDomainName pulumi.StringPtrInput
   122  }
   123  
   124  func (ConditionalForwaderState) ElementType() reflect.Type {
   125  	return reflect.TypeOf((*conditionalForwaderState)(nil)).Elem()
   126  }
   127  
   128  type conditionalForwaderArgs struct {
   129  	// ID of directory.
   130  	DirectoryId string `pulumi:"directoryId"`
   131  	// A list of forwarder IP addresses.
   132  	DnsIps []string `pulumi:"dnsIps"`
   133  	// The fully qualified domain name of the remote domain for which forwarders will be used.
   134  	RemoteDomainName string `pulumi:"remoteDomainName"`
   135  }
   136  
   137  // The set of arguments for constructing a ConditionalForwader resource.
   138  type ConditionalForwaderArgs struct {
   139  	// ID of directory.
   140  	DirectoryId pulumi.StringInput
   141  	// A list of forwarder IP addresses.
   142  	DnsIps pulumi.StringArrayInput
   143  	// The fully qualified domain name of the remote domain for which forwarders will be used.
   144  	RemoteDomainName pulumi.StringInput
   145  }
   146  
   147  func (ConditionalForwaderArgs) ElementType() reflect.Type {
   148  	return reflect.TypeOf((*conditionalForwaderArgs)(nil)).Elem()
   149  }
   150  
   151  type ConditionalForwaderInput interface {
   152  	pulumi.Input
   153  
   154  	ToConditionalForwaderOutput() ConditionalForwaderOutput
   155  	ToConditionalForwaderOutputWithContext(ctx context.Context) ConditionalForwaderOutput
   156  }
   157  
   158  func (*ConditionalForwader) ElementType() reflect.Type {
   159  	return reflect.TypeOf((**ConditionalForwader)(nil)).Elem()
   160  }
   161  
   162  func (i *ConditionalForwader) ToConditionalForwaderOutput() ConditionalForwaderOutput {
   163  	return i.ToConditionalForwaderOutputWithContext(context.Background())
   164  }
   165  
   166  func (i *ConditionalForwader) ToConditionalForwaderOutputWithContext(ctx context.Context) ConditionalForwaderOutput {
   167  	return pulumi.ToOutputWithContext(ctx, i).(ConditionalForwaderOutput)
   168  }
   169  
   170  // ConditionalForwaderArrayInput is an input type that accepts ConditionalForwaderArray and ConditionalForwaderArrayOutput values.
   171  // You can construct a concrete instance of `ConditionalForwaderArrayInput` via:
   172  //
   173  //	ConditionalForwaderArray{ ConditionalForwaderArgs{...} }
   174  type ConditionalForwaderArrayInput interface {
   175  	pulumi.Input
   176  
   177  	ToConditionalForwaderArrayOutput() ConditionalForwaderArrayOutput
   178  	ToConditionalForwaderArrayOutputWithContext(context.Context) ConditionalForwaderArrayOutput
   179  }
   180  
   181  type ConditionalForwaderArray []ConditionalForwaderInput
   182  
   183  func (ConditionalForwaderArray) ElementType() reflect.Type {
   184  	return reflect.TypeOf((*[]*ConditionalForwader)(nil)).Elem()
   185  }
   186  
   187  func (i ConditionalForwaderArray) ToConditionalForwaderArrayOutput() ConditionalForwaderArrayOutput {
   188  	return i.ToConditionalForwaderArrayOutputWithContext(context.Background())
   189  }
   190  
   191  func (i ConditionalForwaderArray) ToConditionalForwaderArrayOutputWithContext(ctx context.Context) ConditionalForwaderArrayOutput {
   192  	return pulumi.ToOutputWithContext(ctx, i).(ConditionalForwaderArrayOutput)
   193  }
   194  
   195  // ConditionalForwaderMapInput is an input type that accepts ConditionalForwaderMap and ConditionalForwaderMapOutput values.
   196  // You can construct a concrete instance of `ConditionalForwaderMapInput` via:
   197  //
   198  //	ConditionalForwaderMap{ "key": ConditionalForwaderArgs{...} }
   199  type ConditionalForwaderMapInput interface {
   200  	pulumi.Input
   201  
   202  	ToConditionalForwaderMapOutput() ConditionalForwaderMapOutput
   203  	ToConditionalForwaderMapOutputWithContext(context.Context) ConditionalForwaderMapOutput
   204  }
   205  
   206  type ConditionalForwaderMap map[string]ConditionalForwaderInput
   207  
   208  func (ConditionalForwaderMap) ElementType() reflect.Type {
   209  	return reflect.TypeOf((*map[string]*ConditionalForwader)(nil)).Elem()
   210  }
   211  
   212  func (i ConditionalForwaderMap) ToConditionalForwaderMapOutput() ConditionalForwaderMapOutput {
   213  	return i.ToConditionalForwaderMapOutputWithContext(context.Background())
   214  }
   215  
   216  func (i ConditionalForwaderMap) ToConditionalForwaderMapOutputWithContext(ctx context.Context) ConditionalForwaderMapOutput {
   217  	return pulumi.ToOutputWithContext(ctx, i).(ConditionalForwaderMapOutput)
   218  }
   219  
   220  type ConditionalForwaderOutput struct{ *pulumi.OutputState }
   221  
   222  func (ConditionalForwaderOutput) ElementType() reflect.Type {
   223  	return reflect.TypeOf((**ConditionalForwader)(nil)).Elem()
   224  }
   225  
   226  func (o ConditionalForwaderOutput) ToConditionalForwaderOutput() ConditionalForwaderOutput {
   227  	return o
   228  }
   229  
   230  func (o ConditionalForwaderOutput) ToConditionalForwaderOutputWithContext(ctx context.Context) ConditionalForwaderOutput {
   231  	return o
   232  }
   233  
   234  // ID of directory.
   235  func (o ConditionalForwaderOutput) DirectoryId() pulumi.StringOutput {
   236  	return o.ApplyT(func(v *ConditionalForwader) pulumi.StringOutput { return v.DirectoryId }).(pulumi.StringOutput)
   237  }
   238  
   239  // A list of forwarder IP addresses.
   240  func (o ConditionalForwaderOutput) DnsIps() pulumi.StringArrayOutput {
   241  	return o.ApplyT(func(v *ConditionalForwader) pulumi.StringArrayOutput { return v.DnsIps }).(pulumi.StringArrayOutput)
   242  }
   243  
   244  // The fully qualified domain name of the remote domain for which forwarders will be used.
   245  func (o ConditionalForwaderOutput) RemoteDomainName() pulumi.StringOutput {
   246  	return o.ApplyT(func(v *ConditionalForwader) pulumi.StringOutput { return v.RemoteDomainName }).(pulumi.StringOutput)
   247  }
   248  
   249  type ConditionalForwaderArrayOutput struct{ *pulumi.OutputState }
   250  
   251  func (ConditionalForwaderArrayOutput) ElementType() reflect.Type {
   252  	return reflect.TypeOf((*[]*ConditionalForwader)(nil)).Elem()
   253  }
   254  
   255  func (o ConditionalForwaderArrayOutput) ToConditionalForwaderArrayOutput() ConditionalForwaderArrayOutput {
   256  	return o
   257  }
   258  
   259  func (o ConditionalForwaderArrayOutput) ToConditionalForwaderArrayOutputWithContext(ctx context.Context) ConditionalForwaderArrayOutput {
   260  	return o
   261  }
   262  
   263  func (o ConditionalForwaderArrayOutput) Index(i pulumi.IntInput) ConditionalForwaderOutput {
   264  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ConditionalForwader {
   265  		return vs[0].([]*ConditionalForwader)[vs[1].(int)]
   266  	}).(ConditionalForwaderOutput)
   267  }
   268  
   269  type ConditionalForwaderMapOutput struct{ *pulumi.OutputState }
   270  
   271  func (ConditionalForwaderMapOutput) ElementType() reflect.Type {
   272  	return reflect.TypeOf((*map[string]*ConditionalForwader)(nil)).Elem()
   273  }
   274  
   275  func (o ConditionalForwaderMapOutput) ToConditionalForwaderMapOutput() ConditionalForwaderMapOutput {
   276  	return o
   277  }
   278  
   279  func (o ConditionalForwaderMapOutput) ToConditionalForwaderMapOutputWithContext(ctx context.Context) ConditionalForwaderMapOutput {
   280  	return o
   281  }
   282  
   283  func (o ConditionalForwaderMapOutput) MapIndex(k pulumi.StringInput) ConditionalForwaderOutput {
   284  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ConditionalForwader {
   285  		return vs[0].(map[string]*ConditionalForwader)[vs[1].(string)]
   286  	}).(ConditionalForwaderOutput)
   287  }
   288  
   289  func init() {
   290  	pulumi.RegisterInputType(reflect.TypeOf((*ConditionalForwaderInput)(nil)).Elem(), &ConditionalForwader{})
   291  	pulumi.RegisterInputType(reflect.TypeOf((*ConditionalForwaderArrayInput)(nil)).Elem(), ConditionalForwaderArray{})
   292  	pulumi.RegisterInputType(reflect.TypeOf((*ConditionalForwaderMapInput)(nil)).Elem(), ConditionalForwaderMap{})
   293  	pulumi.RegisterOutputType(ConditionalForwaderOutput{})
   294  	pulumi.RegisterOutputType(ConditionalForwaderArrayOutput{})
   295  	pulumi.RegisterOutputType(ConditionalForwaderMapOutput{})
   296  }