github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/kendra/thesaurus.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 kendra
     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  // Resource for managing an AWS Kendra Thesaurus.
    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/kendra"
    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 := kendra.NewThesaurus(ctx, "example", &kendra.ThesaurusArgs{
    33  //				IndexId: pulumi.Any(exampleAwsKendraIndex.Id),
    34  //				Name:    pulumi.String("Example"),
    35  //				RoleArn: pulumi.Any(exampleAwsIamRole.Arn),
    36  //				SourceS3Path: &kendra.ThesaurusSourceS3PathArgs{
    37  //					Bucket: pulumi.Any(exampleAwsS3Bucket.Id),
    38  //					Key:    pulumi.Any(exampleAwsS3Object.Key),
    39  //				},
    40  //				Tags: pulumi.StringMap{
    41  //					"Name": pulumi.String("Example Kendra Thesaurus"),
    42  //				},
    43  //			})
    44  //			if err != nil {
    45  //				return err
    46  //			}
    47  //			return nil
    48  //		})
    49  //	}
    50  //
    51  // ```
    52  // <!--End PulumiCodeChooser -->
    53  //
    54  // ## Import
    55  //
    56  // Using `pulumi import`, import `aws_kendra_thesaurus` using the unique identifiers of the thesaurus and index separated by a slash (`/`). For example:
    57  //
    58  // ```sh
    59  // $ pulumi import aws:kendra/thesaurus:Thesaurus example thesaurus-123456780/idx-8012925589
    60  // ```
    61  type Thesaurus struct {
    62  	pulumi.CustomResourceState
    63  
    64  	// ARN of the thesaurus.
    65  	Arn pulumi.StringOutput `pulumi:"arn"`
    66  	// The description for a thesaurus.
    67  	Description pulumi.StringPtrOutput `pulumi:"description"`
    68  	// The identifier of the index for a thesaurus.
    69  	IndexId pulumi.StringOutput `pulumi:"indexId"`
    70  	// The name for the thesaurus.
    71  	Name pulumi.StringOutput `pulumi:"name"`
    72  	// The IAM (Identity and Access Management) role used to access the thesaurus file in S3.
    73  	RoleArn pulumi.StringOutput `pulumi:"roleArn"`
    74  	// The S3 path where your thesaurus file sits in S3. Detailed below.
    75  	//
    76  	// The `sourceS3Path` configuration block supports the following arguments:
    77  	SourceS3Path ThesaurusSourceS3PathOutput `pulumi:"sourceS3Path"`
    78  	// The current status of the thesaurus.
    79  	Status pulumi.StringOutput `pulumi:"status"`
    80  	// Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    81  	Tags pulumi.StringMapOutput `pulumi:"tags"`
    82  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
    83  	//
    84  	// Deprecated: Please use `tags` instead.
    85  	TagsAll     pulumi.StringMapOutput `pulumi:"tagsAll"`
    86  	ThesaurusId pulumi.StringOutput    `pulumi:"thesaurusId"`
    87  }
    88  
    89  // NewThesaurus registers a new resource with the given unique name, arguments, and options.
    90  func NewThesaurus(ctx *pulumi.Context,
    91  	name string, args *ThesaurusArgs, opts ...pulumi.ResourceOption) (*Thesaurus, error) {
    92  	if args == nil {
    93  		return nil, errors.New("missing one or more required arguments")
    94  	}
    95  
    96  	if args.IndexId == nil {
    97  		return nil, errors.New("invalid value for required argument 'IndexId'")
    98  	}
    99  	if args.RoleArn == nil {
   100  		return nil, errors.New("invalid value for required argument 'RoleArn'")
   101  	}
   102  	if args.SourceS3Path == nil {
   103  		return nil, errors.New("invalid value for required argument 'SourceS3Path'")
   104  	}
   105  	opts = internal.PkgResourceDefaultOpts(opts)
   106  	var resource Thesaurus
   107  	err := ctx.RegisterResource("aws:kendra/thesaurus:Thesaurus", name, args, &resource, opts...)
   108  	if err != nil {
   109  		return nil, err
   110  	}
   111  	return &resource, nil
   112  }
   113  
   114  // GetThesaurus gets an existing Thesaurus resource's state with the given name, ID, and optional
   115  // state properties that are used to uniquely qualify the lookup (nil if not required).
   116  func GetThesaurus(ctx *pulumi.Context,
   117  	name string, id pulumi.IDInput, state *ThesaurusState, opts ...pulumi.ResourceOption) (*Thesaurus, error) {
   118  	var resource Thesaurus
   119  	err := ctx.ReadResource("aws:kendra/thesaurus:Thesaurus", name, id, state, &resource, opts...)
   120  	if err != nil {
   121  		return nil, err
   122  	}
   123  	return &resource, nil
   124  }
   125  
   126  // Input properties used for looking up and filtering Thesaurus resources.
   127  type thesaurusState struct {
   128  	// ARN of the thesaurus.
   129  	Arn *string `pulumi:"arn"`
   130  	// The description for a thesaurus.
   131  	Description *string `pulumi:"description"`
   132  	// The identifier of the index for a thesaurus.
   133  	IndexId *string `pulumi:"indexId"`
   134  	// The name for the thesaurus.
   135  	Name *string `pulumi:"name"`
   136  	// The IAM (Identity and Access Management) role used to access the thesaurus file in S3.
   137  	RoleArn *string `pulumi:"roleArn"`
   138  	// The S3 path where your thesaurus file sits in S3. Detailed below.
   139  	//
   140  	// The `sourceS3Path` configuration block supports the following arguments:
   141  	SourceS3Path *ThesaurusSourceS3Path `pulumi:"sourceS3Path"`
   142  	// The current status of the thesaurus.
   143  	Status *string `pulumi:"status"`
   144  	// Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   145  	Tags map[string]string `pulumi:"tags"`
   146  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   147  	//
   148  	// Deprecated: Please use `tags` instead.
   149  	TagsAll     map[string]string `pulumi:"tagsAll"`
   150  	ThesaurusId *string           `pulumi:"thesaurusId"`
   151  }
   152  
   153  type ThesaurusState struct {
   154  	// ARN of the thesaurus.
   155  	Arn pulumi.StringPtrInput
   156  	// The description for a thesaurus.
   157  	Description pulumi.StringPtrInput
   158  	// The identifier of the index for a thesaurus.
   159  	IndexId pulumi.StringPtrInput
   160  	// The name for the thesaurus.
   161  	Name pulumi.StringPtrInput
   162  	// The IAM (Identity and Access Management) role used to access the thesaurus file in S3.
   163  	RoleArn pulumi.StringPtrInput
   164  	// The S3 path where your thesaurus file sits in S3. Detailed below.
   165  	//
   166  	// The `sourceS3Path` configuration block supports the following arguments:
   167  	SourceS3Path ThesaurusSourceS3PathPtrInput
   168  	// The current status of the thesaurus.
   169  	Status pulumi.StringPtrInput
   170  	// Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   171  	Tags pulumi.StringMapInput
   172  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   173  	//
   174  	// Deprecated: Please use `tags` instead.
   175  	TagsAll     pulumi.StringMapInput
   176  	ThesaurusId pulumi.StringPtrInput
   177  }
   178  
   179  func (ThesaurusState) ElementType() reflect.Type {
   180  	return reflect.TypeOf((*thesaurusState)(nil)).Elem()
   181  }
   182  
   183  type thesaurusArgs struct {
   184  	// The description for a thesaurus.
   185  	Description *string `pulumi:"description"`
   186  	// The identifier of the index for a thesaurus.
   187  	IndexId string `pulumi:"indexId"`
   188  	// The name for the thesaurus.
   189  	Name *string `pulumi:"name"`
   190  	// The IAM (Identity and Access Management) role used to access the thesaurus file in S3.
   191  	RoleArn string `pulumi:"roleArn"`
   192  	// The S3 path where your thesaurus file sits in S3. Detailed below.
   193  	//
   194  	// The `sourceS3Path` configuration block supports the following arguments:
   195  	SourceS3Path ThesaurusSourceS3Path `pulumi:"sourceS3Path"`
   196  	// Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   197  	Tags map[string]string `pulumi:"tags"`
   198  }
   199  
   200  // The set of arguments for constructing a Thesaurus resource.
   201  type ThesaurusArgs struct {
   202  	// The description for a thesaurus.
   203  	Description pulumi.StringPtrInput
   204  	// The identifier of the index for a thesaurus.
   205  	IndexId pulumi.StringInput
   206  	// The name for the thesaurus.
   207  	Name pulumi.StringPtrInput
   208  	// The IAM (Identity and Access Management) role used to access the thesaurus file in S3.
   209  	RoleArn pulumi.StringInput
   210  	// The S3 path where your thesaurus file sits in S3. Detailed below.
   211  	//
   212  	// The `sourceS3Path` configuration block supports the following arguments:
   213  	SourceS3Path ThesaurusSourceS3PathInput
   214  	// Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   215  	Tags pulumi.StringMapInput
   216  }
   217  
   218  func (ThesaurusArgs) ElementType() reflect.Type {
   219  	return reflect.TypeOf((*thesaurusArgs)(nil)).Elem()
   220  }
   221  
   222  type ThesaurusInput interface {
   223  	pulumi.Input
   224  
   225  	ToThesaurusOutput() ThesaurusOutput
   226  	ToThesaurusOutputWithContext(ctx context.Context) ThesaurusOutput
   227  }
   228  
   229  func (*Thesaurus) ElementType() reflect.Type {
   230  	return reflect.TypeOf((**Thesaurus)(nil)).Elem()
   231  }
   232  
   233  func (i *Thesaurus) ToThesaurusOutput() ThesaurusOutput {
   234  	return i.ToThesaurusOutputWithContext(context.Background())
   235  }
   236  
   237  func (i *Thesaurus) ToThesaurusOutputWithContext(ctx context.Context) ThesaurusOutput {
   238  	return pulumi.ToOutputWithContext(ctx, i).(ThesaurusOutput)
   239  }
   240  
   241  // ThesaurusArrayInput is an input type that accepts ThesaurusArray and ThesaurusArrayOutput values.
   242  // You can construct a concrete instance of `ThesaurusArrayInput` via:
   243  //
   244  //	ThesaurusArray{ ThesaurusArgs{...} }
   245  type ThesaurusArrayInput interface {
   246  	pulumi.Input
   247  
   248  	ToThesaurusArrayOutput() ThesaurusArrayOutput
   249  	ToThesaurusArrayOutputWithContext(context.Context) ThesaurusArrayOutput
   250  }
   251  
   252  type ThesaurusArray []ThesaurusInput
   253  
   254  func (ThesaurusArray) ElementType() reflect.Type {
   255  	return reflect.TypeOf((*[]*Thesaurus)(nil)).Elem()
   256  }
   257  
   258  func (i ThesaurusArray) ToThesaurusArrayOutput() ThesaurusArrayOutput {
   259  	return i.ToThesaurusArrayOutputWithContext(context.Background())
   260  }
   261  
   262  func (i ThesaurusArray) ToThesaurusArrayOutputWithContext(ctx context.Context) ThesaurusArrayOutput {
   263  	return pulumi.ToOutputWithContext(ctx, i).(ThesaurusArrayOutput)
   264  }
   265  
   266  // ThesaurusMapInput is an input type that accepts ThesaurusMap and ThesaurusMapOutput values.
   267  // You can construct a concrete instance of `ThesaurusMapInput` via:
   268  //
   269  //	ThesaurusMap{ "key": ThesaurusArgs{...} }
   270  type ThesaurusMapInput interface {
   271  	pulumi.Input
   272  
   273  	ToThesaurusMapOutput() ThesaurusMapOutput
   274  	ToThesaurusMapOutputWithContext(context.Context) ThesaurusMapOutput
   275  }
   276  
   277  type ThesaurusMap map[string]ThesaurusInput
   278  
   279  func (ThesaurusMap) ElementType() reflect.Type {
   280  	return reflect.TypeOf((*map[string]*Thesaurus)(nil)).Elem()
   281  }
   282  
   283  func (i ThesaurusMap) ToThesaurusMapOutput() ThesaurusMapOutput {
   284  	return i.ToThesaurusMapOutputWithContext(context.Background())
   285  }
   286  
   287  func (i ThesaurusMap) ToThesaurusMapOutputWithContext(ctx context.Context) ThesaurusMapOutput {
   288  	return pulumi.ToOutputWithContext(ctx, i).(ThesaurusMapOutput)
   289  }
   290  
   291  type ThesaurusOutput struct{ *pulumi.OutputState }
   292  
   293  func (ThesaurusOutput) ElementType() reflect.Type {
   294  	return reflect.TypeOf((**Thesaurus)(nil)).Elem()
   295  }
   296  
   297  func (o ThesaurusOutput) ToThesaurusOutput() ThesaurusOutput {
   298  	return o
   299  }
   300  
   301  func (o ThesaurusOutput) ToThesaurusOutputWithContext(ctx context.Context) ThesaurusOutput {
   302  	return o
   303  }
   304  
   305  // ARN of the thesaurus.
   306  func (o ThesaurusOutput) Arn() pulumi.StringOutput {
   307  	return o.ApplyT(func(v *Thesaurus) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   308  }
   309  
   310  // The description for a thesaurus.
   311  func (o ThesaurusOutput) Description() pulumi.StringPtrOutput {
   312  	return o.ApplyT(func(v *Thesaurus) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)
   313  }
   314  
   315  // The identifier of the index for a thesaurus.
   316  func (o ThesaurusOutput) IndexId() pulumi.StringOutput {
   317  	return o.ApplyT(func(v *Thesaurus) pulumi.StringOutput { return v.IndexId }).(pulumi.StringOutput)
   318  }
   319  
   320  // The name for the thesaurus.
   321  func (o ThesaurusOutput) Name() pulumi.StringOutput {
   322  	return o.ApplyT(func(v *Thesaurus) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
   323  }
   324  
   325  // The IAM (Identity and Access Management) role used to access the thesaurus file in S3.
   326  func (o ThesaurusOutput) RoleArn() pulumi.StringOutput {
   327  	return o.ApplyT(func(v *Thesaurus) pulumi.StringOutput { return v.RoleArn }).(pulumi.StringOutput)
   328  }
   329  
   330  // The S3 path where your thesaurus file sits in S3. Detailed below.
   331  //
   332  // The `sourceS3Path` configuration block supports the following arguments:
   333  func (o ThesaurusOutput) SourceS3Path() ThesaurusSourceS3PathOutput {
   334  	return o.ApplyT(func(v *Thesaurus) ThesaurusSourceS3PathOutput { return v.SourceS3Path }).(ThesaurusSourceS3PathOutput)
   335  }
   336  
   337  // The current status of the thesaurus.
   338  func (o ThesaurusOutput) Status() pulumi.StringOutput {
   339  	return o.ApplyT(func(v *Thesaurus) pulumi.StringOutput { return v.Status }).(pulumi.StringOutput)
   340  }
   341  
   342  // Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   343  func (o ThesaurusOutput) Tags() pulumi.StringMapOutput {
   344  	return o.ApplyT(func(v *Thesaurus) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   345  }
   346  
   347  // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   348  //
   349  // Deprecated: Please use `tags` instead.
   350  func (o ThesaurusOutput) TagsAll() pulumi.StringMapOutput {
   351  	return o.ApplyT(func(v *Thesaurus) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   352  }
   353  
   354  func (o ThesaurusOutput) ThesaurusId() pulumi.StringOutput {
   355  	return o.ApplyT(func(v *Thesaurus) pulumi.StringOutput { return v.ThesaurusId }).(pulumi.StringOutput)
   356  }
   357  
   358  type ThesaurusArrayOutput struct{ *pulumi.OutputState }
   359  
   360  func (ThesaurusArrayOutput) ElementType() reflect.Type {
   361  	return reflect.TypeOf((*[]*Thesaurus)(nil)).Elem()
   362  }
   363  
   364  func (o ThesaurusArrayOutput) ToThesaurusArrayOutput() ThesaurusArrayOutput {
   365  	return o
   366  }
   367  
   368  func (o ThesaurusArrayOutput) ToThesaurusArrayOutputWithContext(ctx context.Context) ThesaurusArrayOutput {
   369  	return o
   370  }
   371  
   372  func (o ThesaurusArrayOutput) Index(i pulumi.IntInput) ThesaurusOutput {
   373  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Thesaurus {
   374  		return vs[0].([]*Thesaurus)[vs[1].(int)]
   375  	}).(ThesaurusOutput)
   376  }
   377  
   378  type ThesaurusMapOutput struct{ *pulumi.OutputState }
   379  
   380  func (ThesaurusMapOutput) ElementType() reflect.Type {
   381  	return reflect.TypeOf((*map[string]*Thesaurus)(nil)).Elem()
   382  }
   383  
   384  func (o ThesaurusMapOutput) ToThesaurusMapOutput() ThesaurusMapOutput {
   385  	return o
   386  }
   387  
   388  func (o ThesaurusMapOutput) ToThesaurusMapOutputWithContext(ctx context.Context) ThesaurusMapOutput {
   389  	return o
   390  }
   391  
   392  func (o ThesaurusMapOutput) MapIndex(k pulumi.StringInput) ThesaurusOutput {
   393  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Thesaurus {
   394  		return vs[0].(map[string]*Thesaurus)[vs[1].(string)]
   395  	}).(ThesaurusOutput)
   396  }
   397  
   398  func init() {
   399  	pulumi.RegisterInputType(reflect.TypeOf((*ThesaurusInput)(nil)).Elem(), &Thesaurus{})
   400  	pulumi.RegisterInputType(reflect.TypeOf((*ThesaurusArrayInput)(nil)).Elem(), ThesaurusArray{})
   401  	pulumi.RegisterInputType(reflect.TypeOf((*ThesaurusMapInput)(nil)).Elem(), ThesaurusMap{})
   402  	pulumi.RegisterOutputType(ThesaurusOutput{})
   403  	pulumi.RegisterOutputType(ThesaurusArrayOutput{})
   404  	pulumi.RegisterOutputType(ThesaurusMapOutput{})
   405  }