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