github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/cloudsearch/domain.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 cloudsearch
     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 an CloudSearch domain resource.
    15  //
    16  // The provider waits for the domain to become `Active` when applying a configuration.
    17  //
    18  // ## Example Usage
    19  //
    20  // <!--Start PulumiCodeChooser -->
    21  // ```go
    22  // package main
    23  //
    24  // import (
    25  //
    26  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/cloudsearch"
    27  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    28  //
    29  // )
    30  //
    31  //	func main() {
    32  //		pulumi.Run(func(ctx *pulumi.Context) error {
    33  //			_, err := cloudsearch.NewDomain(ctx, "example", &cloudsearch.DomainArgs{
    34  //				Name: pulumi.String("example-domain"),
    35  //				ScalingParameters: &cloudsearch.DomainScalingParametersArgs{
    36  //					DesiredInstanceType: pulumi.String("search.medium"),
    37  //				},
    38  //				IndexFields: cloudsearch.DomainIndexFieldArray{
    39  //					&cloudsearch.DomainIndexFieldArgs{
    40  //						Name:           pulumi.String("headline"),
    41  //						Type:           pulumi.String("text"),
    42  //						Search:         pulumi.Bool(true),
    43  //						Return:         pulumi.Bool(true),
    44  //						Sort:           pulumi.Bool(true),
    45  //						Highlight:      pulumi.Bool(false),
    46  //						AnalysisScheme: pulumi.String("_en_default_"),
    47  //					},
    48  //					&cloudsearch.DomainIndexFieldArgs{
    49  //						Name:         pulumi.String("price"),
    50  //						Type:         pulumi.String("double"),
    51  //						Search:       pulumi.Bool(true),
    52  //						Facet:        pulumi.Bool(true),
    53  //						Return:       pulumi.Bool(true),
    54  //						Sort:         pulumi.Bool(true),
    55  //						SourceFields: pulumi.String("headline"),
    56  //					},
    57  //				},
    58  //			})
    59  //			if err != nil {
    60  //				return err
    61  //			}
    62  //			return nil
    63  //		})
    64  //	}
    65  //
    66  // ```
    67  // <!--End PulumiCodeChooser -->
    68  //
    69  // ## Import
    70  //
    71  // Using `pulumi import`, import CloudSearch Domains using the `name`. For example:
    72  //
    73  // ```sh
    74  // $ pulumi import aws:cloudsearch/domain:Domain example example-domain
    75  // ```
    76  type Domain struct {
    77  	pulumi.CustomResourceState
    78  
    79  	// The domain's ARN.
    80  	Arn pulumi.StringOutput `pulumi:"arn"`
    81  	// The service endpoint for updating documents in a search domain.
    82  	DocumentServiceEndpoint pulumi.StringOutput `pulumi:"documentServiceEndpoint"`
    83  	// An internally generated unique identifier for the domain.
    84  	DomainId pulumi.StringOutput `pulumi:"domainId"`
    85  	// Domain endpoint options. Documented below.
    86  	EndpointOptions DomainEndpointOptionsOutput `pulumi:"endpointOptions"`
    87  	// The index fields for documents added to the domain. Documented below.
    88  	IndexFields DomainIndexFieldArrayOutput `pulumi:"indexFields"`
    89  	// Whether or not to maintain extra instances for the domain in a second Availability Zone to ensure high availability.
    90  	MultiAz pulumi.BoolOutput `pulumi:"multiAz"`
    91  	// The name of the CloudSearch domain.
    92  	Name pulumi.StringOutput `pulumi:"name"`
    93  	// Domain scaling parameters. Documented below.
    94  	ScalingParameters DomainScalingParametersOutput `pulumi:"scalingParameters"`
    95  	// The service endpoint for requesting search results from a search domain.
    96  	SearchServiceEndpoint pulumi.StringOutput `pulumi:"searchServiceEndpoint"`
    97  }
    98  
    99  // NewDomain registers a new resource with the given unique name, arguments, and options.
   100  func NewDomain(ctx *pulumi.Context,
   101  	name string, args *DomainArgs, opts ...pulumi.ResourceOption) (*Domain, error) {
   102  	if args == nil {
   103  		args = &DomainArgs{}
   104  	}
   105  
   106  	opts = internal.PkgResourceDefaultOpts(opts)
   107  	var resource Domain
   108  	err := ctx.RegisterResource("aws:cloudsearch/domain:Domain", name, args, &resource, opts...)
   109  	if err != nil {
   110  		return nil, err
   111  	}
   112  	return &resource, nil
   113  }
   114  
   115  // GetDomain gets an existing Domain resource's state with the given name, ID, and optional
   116  // state properties that are used to uniquely qualify the lookup (nil if not required).
   117  func GetDomain(ctx *pulumi.Context,
   118  	name string, id pulumi.IDInput, state *DomainState, opts ...pulumi.ResourceOption) (*Domain, error) {
   119  	var resource Domain
   120  	err := ctx.ReadResource("aws:cloudsearch/domain:Domain", name, id, state, &resource, opts...)
   121  	if err != nil {
   122  		return nil, err
   123  	}
   124  	return &resource, nil
   125  }
   126  
   127  // Input properties used for looking up and filtering Domain resources.
   128  type domainState struct {
   129  	// The domain's ARN.
   130  	Arn *string `pulumi:"arn"`
   131  	// The service endpoint for updating documents in a search domain.
   132  	DocumentServiceEndpoint *string `pulumi:"documentServiceEndpoint"`
   133  	// An internally generated unique identifier for the domain.
   134  	DomainId *string `pulumi:"domainId"`
   135  	// Domain endpoint options. Documented below.
   136  	EndpointOptions *DomainEndpointOptions `pulumi:"endpointOptions"`
   137  	// The index fields for documents added to the domain. Documented below.
   138  	IndexFields []DomainIndexField `pulumi:"indexFields"`
   139  	// Whether or not to maintain extra instances for the domain in a second Availability Zone to ensure high availability.
   140  	MultiAz *bool `pulumi:"multiAz"`
   141  	// The name of the CloudSearch domain.
   142  	Name *string `pulumi:"name"`
   143  	// Domain scaling parameters. Documented below.
   144  	ScalingParameters *DomainScalingParameters `pulumi:"scalingParameters"`
   145  	// The service endpoint for requesting search results from a search domain.
   146  	SearchServiceEndpoint *string `pulumi:"searchServiceEndpoint"`
   147  }
   148  
   149  type DomainState struct {
   150  	// The domain's ARN.
   151  	Arn pulumi.StringPtrInput
   152  	// The service endpoint for updating documents in a search domain.
   153  	DocumentServiceEndpoint pulumi.StringPtrInput
   154  	// An internally generated unique identifier for the domain.
   155  	DomainId pulumi.StringPtrInput
   156  	// Domain endpoint options. Documented below.
   157  	EndpointOptions DomainEndpointOptionsPtrInput
   158  	// The index fields for documents added to the domain. Documented below.
   159  	IndexFields DomainIndexFieldArrayInput
   160  	// Whether or not to maintain extra instances for the domain in a second Availability Zone to ensure high availability.
   161  	MultiAz pulumi.BoolPtrInput
   162  	// The name of the CloudSearch domain.
   163  	Name pulumi.StringPtrInput
   164  	// Domain scaling parameters. Documented below.
   165  	ScalingParameters DomainScalingParametersPtrInput
   166  	// The service endpoint for requesting search results from a search domain.
   167  	SearchServiceEndpoint pulumi.StringPtrInput
   168  }
   169  
   170  func (DomainState) ElementType() reflect.Type {
   171  	return reflect.TypeOf((*domainState)(nil)).Elem()
   172  }
   173  
   174  type domainArgs struct {
   175  	// Domain endpoint options. Documented below.
   176  	EndpointOptions *DomainEndpointOptions `pulumi:"endpointOptions"`
   177  	// The index fields for documents added to the domain. Documented below.
   178  	IndexFields []DomainIndexField `pulumi:"indexFields"`
   179  	// Whether or not to maintain extra instances for the domain in a second Availability Zone to ensure high availability.
   180  	MultiAz *bool `pulumi:"multiAz"`
   181  	// The name of the CloudSearch domain.
   182  	Name *string `pulumi:"name"`
   183  	// Domain scaling parameters. Documented below.
   184  	ScalingParameters *DomainScalingParameters `pulumi:"scalingParameters"`
   185  }
   186  
   187  // The set of arguments for constructing a Domain resource.
   188  type DomainArgs struct {
   189  	// Domain endpoint options. Documented below.
   190  	EndpointOptions DomainEndpointOptionsPtrInput
   191  	// The index fields for documents added to the domain. Documented below.
   192  	IndexFields DomainIndexFieldArrayInput
   193  	// Whether or not to maintain extra instances for the domain in a second Availability Zone to ensure high availability.
   194  	MultiAz pulumi.BoolPtrInput
   195  	// The name of the CloudSearch domain.
   196  	Name pulumi.StringPtrInput
   197  	// Domain scaling parameters. Documented below.
   198  	ScalingParameters DomainScalingParametersPtrInput
   199  }
   200  
   201  func (DomainArgs) ElementType() reflect.Type {
   202  	return reflect.TypeOf((*domainArgs)(nil)).Elem()
   203  }
   204  
   205  type DomainInput interface {
   206  	pulumi.Input
   207  
   208  	ToDomainOutput() DomainOutput
   209  	ToDomainOutputWithContext(ctx context.Context) DomainOutput
   210  }
   211  
   212  func (*Domain) ElementType() reflect.Type {
   213  	return reflect.TypeOf((**Domain)(nil)).Elem()
   214  }
   215  
   216  func (i *Domain) ToDomainOutput() DomainOutput {
   217  	return i.ToDomainOutputWithContext(context.Background())
   218  }
   219  
   220  func (i *Domain) ToDomainOutputWithContext(ctx context.Context) DomainOutput {
   221  	return pulumi.ToOutputWithContext(ctx, i).(DomainOutput)
   222  }
   223  
   224  // DomainArrayInput is an input type that accepts DomainArray and DomainArrayOutput values.
   225  // You can construct a concrete instance of `DomainArrayInput` via:
   226  //
   227  //	DomainArray{ DomainArgs{...} }
   228  type DomainArrayInput interface {
   229  	pulumi.Input
   230  
   231  	ToDomainArrayOutput() DomainArrayOutput
   232  	ToDomainArrayOutputWithContext(context.Context) DomainArrayOutput
   233  }
   234  
   235  type DomainArray []DomainInput
   236  
   237  func (DomainArray) ElementType() reflect.Type {
   238  	return reflect.TypeOf((*[]*Domain)(nil)).Elem()
   239  }
   240  
   241  func (i DomainArray) ToDomainArrayOutput() DomainArrayOutput {
   242  	return i.ToDomainArrayOutputWithContext(context.Background())
   243  }
   244  
   245  func (i DomainArray) ToDomainArrayOutputWithContext(ctx context.Context) DomainArrayOutput {
   246  	return pulumi.ToOutputWithContext(ctx, i).(DomainArrayOutput)
   247  }
   248  
   249  // DomainMapInput is an input type that accepts DomainMap and DomainMapOutput values.
   250  // You can construct a concrete instance of `DomainMapInput` via:
   251  //
   252  //	DomainMap{ "key": DomainArgs{...} }
   253  type DomainMapInput interface {
   254  	pulumi.Input
   255  
   256  	ToDomainMapOutput() DomainMapOutput
   257  	ToDomainMapOutputWithContext(context.Context) DomainMapOutput
   258  }
   259  
   260  type DomainMap map[string]DomainInput
   261  
   262  func (DomainMap) ElementType() reflect.Type {
   263  	return reflect.TypeOf((*map[string]*Domain)(nil)).Elem()
   264  }
   265  
   266  func (i DomainMap) ToDomainMapOutput() DomainMapOutput {
   267  	return i.ToDomainMapOutputWithContext(context.Background())
   268  }
   269  
   270  func (i DomainMap) ToDomainMapOutputWithContext(ctx context.Context) DomainMapOutput {
   271  	return pulumi.ToOutputWithContext(ctx, i).(DomainMapOutput)
   272  }
   273  
   274  type DomainOutput struct{ *pulumi.OutputState }
   275  
   276  func (DomainOutput) ElementType() reflect.Type {
   277  	return reflect.TypeOf((**Domain)(nil)).Elem()
   278  }
   279  
   280  func (o DomainOutput) ToDomainOutput() DomainOutput {
   281  	return o
   282  }
   283  
   284  func (o DomainOutput) ToDomainOutputWithContext(ctx context.Context) DomainOutput {
   285  	return o
   286  }
   287  
   288  // The domain's ARN.
   289  func (o DomainOutput) Arn() pulumi.StringOutput {
   290  	return o.ApplyT(func(v *Domain) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   291  }
   292  
   293  // The service endpoint for updating documents in a search domain.
   294  func (o DomainOutput) DocumentServiceEndpoint() pulumi.StringOutput {
   295  	return o.ApplyT(func(v *Domain) pulumi.StringOutput { return v.DocumentServiceEndpoint }).(pulumi.StringOutput)
   296  }
   297  
   298  // An internally generated unique identifier for the domain.
   299  func (o DomainOutput) DomainId() pulumi.StringOutput {
   300  	return o.ApplyT(func(v *Domain) pulumi.StringOutput { return v.DomainId }).(pulumi.StringOutput)
   301  }
   302  
   303  // Domain endpoint options. Documented below.
   304  func (o DomainOutput) EndpointOptions() DomainEndpointOptionsOutput {
   305  	return o.ApplyT(func(v *Domain) DomainEndpointOptionsOutput { return v.EndpointOptions }).(DomainEndpointOptionsOutput)
   306  }
   307  
   308  // The index fields for documents added to the domain. Documented below.
   309  func (o DomainOutput) IndexFields() DomainIndexFieldArrayOutput {
   310  	return o.ApplyT(func(v *Domain) DomainIndexFieldArrayOutput { return v.IndexFields }).(DomainIndexFieldArrayOutput)
   311  }
   312  
   313  // Whether or not to maintain extra instances for the domain in a second Availability Zone to ensure high availability.
   314  func (o DomainOutput) MultiAz() pulumi.BoolOutput {
   315  	return o.ApplyT(func(v *Domain) pulumi.BoolOutput { return v.MultiAz }).(pulumi.BoolOutput)
   316  }
   317  
   318  // The name of the CloudSearch domain.
   319  func (o DomainOutput) Name() pulumi.StringOutput {
   320  	return o.ApplyT(func(v *Domain) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
   321  }
   322  
   323  // Domain scaling parameters. Documented below.
   324  func (o DomainOutput) ScalingParameters() DomainScalingParametersOutput {
   325  	return o.ApplyT(func(v *Domain) DomainScalingParametersOutput { return v.ScalingParameters }).(DomainScalingParametersOutput)
   326  }
   327  
   328  // The service endpoint for requesting search results from a search domain.
   329  func (o DomainOutput) SearchServiceEndpoint() pulumi.StringOutput {
   330  	return o.ApplyT(func(v *Domain) pulumi.StringOutput { return v.SearchServiceEndpoint }).(pulumi.StringOutput)
   331  }
   332  
   333  type DomainArrayOutput struct{ *pulumi.OutputState }
   334  
   335  func (DomainArrayOutput) ElementType() reflect.Type {
   336  	return reflect.TypeOf((*[]*Domain)(nil)).Elem()
   337  }
   338  
   339  func (o DomainArrayOutput) ToDomainArrayOutput() DomainArrayOutput {
   340  	return o
   341  }
   342  
   343  func (o DomainArrayOutput) ToDomainArrayOutputWithContext(ctx context.Context) DomainArrayOutput {
   344  	return o
   345  }
   346  
   347  func (o DomainArrayOutput) Index(i pulumi.IntInput) DomainOutput {
   348  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Domain {
   349  		return vs[0].([]*Domain)[vs[1].(int)]
   350  	}).(DomainOutput)
   351  }
   352  
   353  type DomainMapOutput struct{ *pulumi.OutputState }
   354  
   355  func (DomainMapOutput) ElementType() reflect.Type {
   356  	return reflect.TypeOf((*map[string]*Domain)(nil)).Elem()
   357  }
   358  
   359  func (o DomainMapOutput) ToDomainMapOutput() DomainMapOutput {
   360  	return o
   361  }
   362  
   363  func (o DomainMapOutput) ToDomainMapOutputWithContext(ctx context.Context) DomainMapOutput {
   364  	return o
   365  }
   366  
   367  func (o DomainMapOutput) MapIndex(k pulumi.StringInput) DomainOutput {
   368  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Domain {
   369  		return vs[0].(map[string]*Domain)[vs[1].(string)]
   370  	}).(DomainOutput)
   371  }
   372  
   373  func init() {
   374  	pulumi.RegisterInputType(reflect.TypeOf((*DomainInput)(nil)).Elem(), &Domain{})
   375  	pulumi.RegisterInputType(reflect.TypeOf((*DomainArrayInput)(nil)).Elem(), DomainArray{})
   376  	pulumi.RegisterInputType(reflect.TypeOf((*DomainMapInput)(nil)).Elem(), DomainMap{})
   377  	pulumi.RegisterOutputType(DomainOutput{})
   378  	pulumi.RegisterOutputType(DomainArrayOutput{})
   379  	pulumi.RegisterOutputType(DomainMapOutput{})
   380  }