github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/kendra/getThesaurus.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 "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal" 11 "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 12 ) 13 14 // Provides details about a specific Amazon Kendra Thesaurus. 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/kendra" 25 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 26 // 27 // ) 28 // 29 // func main() { 30 // pulumi.Run(func(ctx *pulumi.Context) error { 31 // _, err := kendra.LookupThesaurus(ctx, &kendra.LookupThesaurusArgs{ 32 // IndexId: "12345678-1234-1234-1234-123456789123", 33 // ThesaurusId: "87654321-1234-4321-4321-321987654321", 34 // }, nil) 35 // if err != nil { 36 // return err 37 // } 38 // return nil 39 // }) 40 // } 41 // 42 // ``` 43 // <!--End PulumiCodeChooser --> 44 func LookupThesaurus(ctx *pulumi.Context, args *LookupThesaurusArgs, opts ...pulumi.InvokeOption) (*LookupThesaurusResult, error) { 45 opts = internal.PkgInvokeDefaultOpts(opts) 46 var rv LookupThesaurusResult 47 err := ctx.Invoke("aws:kendra/getThesaurus:getThesaurus", args, &rv, opts...) 48 if err != nil { 49 return nil, err 50 } 51 return &rv, nil 52 } 53 54 // A collection of arguments for invoking getThesaurus. 55 type LookupThesaurusArgs struct { 56 // Identifier of the index that contains the Thesaurus. 57 IndexId string `pulumi:"indexId"` 58 // Metadata that helps organize the Thesaurus you create. 59 Tags map[string]string `pulumi:"tags"` 60 // Identifier of the Thesaurus. 61 ThesaurusId string `pulumi:"thesaurusId"` 62 } 63 64 // A collection of values returned by getThesaurus. 65 type LookupThesaurusResult struct { 66 // ARN of the Thesaurus. 67 Arn string `pulumi:"arn"` 68 // Unix datetime that the Thesaurus was created. 69 CreatedAt string `pulumi:"createdAt"` 70 // Description of the Thesaurus. 71 Description string `pulumi:"description"` 72 // When the `status` field value is `FAILED`, this contains a message that explains why. 73 ErrorMessage string `pulumi:"errorMessage"` 74 // Size of the Thesaurus file in bytes. 75 FileSizeBytes int `pulumi:"fileSizeBytes"` 76 // The provider-assigned unique ID for this managed resource. 77 Id string `pulumi:"id"` 78 IndexId string `pulumi:"indexId"` 79 // Name of the Thesaurus. 80 Name string `pulumi:"name"` 81 // ARN of a role with permission to access the S3 bucket that contains the Thesaurus. For more information, see [IAM Roles for Amazon Kendra](https://docs.aws.amazon.com/kendra/latest/dg/iam-roles.html). 82 RoleArn string `pulumi:"roleArn"` 83 // S3 location of the Thesaurus input data. Detailed below. 84 SourceS3Paths []GetThesaurusSourceS3Path `pulumi:"sourceS3Paths"` 85 // Status of the Thesaurus. It is ready to use when the status is `ACTIVE`. 86 Status string `pulumi:"status"` 87 // Number of synonym rules in the Thesaurus file. 88 SynonymRuleCount int `pulumi:"synonymRuleCount"` 89 // Metadata that helps organize the Thesaurus you create. 90 Tags map[string]string `pulumi:"tags"` 91 // Number of unique terms in the Thesaurus file. For example, the synonyms `a,b,c` and `a=>d`, the term count would be 4. 92 TermCount int `pulumi:"termCount"` 93 ThesaurusId string `pulumi:"thesaurusId"` 94 // Date and time that the Thesaurus was last updated. 95 UpdatedAt string `pulumi:"updatedAt"` 96 } 97 98 func LookupThesaurusOutput(ctx *pulumi.Context, args LookupThesaurusOutputArgs, opts ...pulumi.InvokeOption) LookupThesaurusResultOutput { 99 return pulumi.ToOutputWithContext(context.Background(), args). 100 ApplyT(func(v interface{}) (LookupThesaurusResult, error) { 101 args := v.(LookupThesaurusArgs) 102 r, err := LookupThesaurus(ctx, &args, opts...) 103 var s LookupThesaurusResult 104 if r != nil { 105 s = *r 106 } 107 return s, err 108 }).(LookupThesaurusResultOutput) 109 } 110 111 // A collection of arguments for invoking getThesaurus. 112 type LookupThesaurusOutputArgs struct { 113 // Identifier of the index that contains the Thesaurus. 114 IndexId pulumi.StringInput `pulumi:"indexId"` 115 // Metadata that helps organize the Thesaurus you create. 116 Tags pulumi.StringMapInput `pulumi:"tags"` 117 // Identifier of the Thesaurus. 118 ThesaurusId pulumi.StringInput `pulumi:"thesaurusId"` 119 } 120 121 func (LookupThesaurusOutputArgs) ElementType() reflect.Type { 122 return reflect.TypeOf((*LookupThesaurusArgs)(nil)).Elem() 123 } 124 125 // A collection of values returned by getThesaurus. 126 type LookupThesaurusResultOutput struct{ *pulumi.OutputState } 127 128 func (LookupThesaurusResultOutput) ElementType() reflect.Type { 129 return reflect.TypeOf((*LookupThesaurusResult)(nil)).Elem() 130 } 131 132 func (o LookupThesaurusResultOutput) ToLookupThesaurusResultOutput() LookupThesaurusResultOutput { 133 return o 134 } 135 136 func (o LookupThesaurusResultOutput) ToLookupThesaurusResultOutputWithContext(ctx context.Context) LookupThesaurusResultOutput { 137 return o 138 } 139 140 // ARN of the Thesaurus. 141 func (o LookupThesaurusResultOutput) Arn() pulumi.StringOutput { 142 return o.ApplyT(func(v LookupThesaurusResult) string { return v.Arn }).(pulumi.StringOutput) 143 } 144 145 // Unix datetime that the Thesaurus was created. 146 func (o LookupThesaurusResultOutput) CreatedAt() pulumi.StringOutput { 147 return o.ApplyT(func(v LookupThesaurusResult) string { return v.CreatedAt }).(pulumi.StringOutput) 148 } 149 150 // Description of the Thesaurus. 151 func (o LookupThesaurusResultOutput) Description() pulumi.StringOutput { 152 return o.ApplyT(func(v LookupThesaurusResult) string { return v.Description }).(pulumi.StringOutput) 153 } 154 155 // When the `status` field value is `FAILED`, this contains a message that explains why. 156 func (o LookupThesaurusResultOutput) ErrorMessage() pulumi.StringOutput { 157 return o.ApplyT(func(v LookupThesaurusResult) string { return v.ErrorMessage }).(pulumi.StringOutput) 158 } 159 160 // Size of the Thesaurus file in bytes. 161 func (o LookupThesaurusResultOutput) FileSizeBytes() pulumi.IntOutput { 162 return o.ApplyT(func(v LookupThesaurusResult) int { return v.FileSizeBytes }).(pulumi.IntOutput) 163 } 164 165 // The provider-assigned unique ID for this managed resource. 166 func (o LookupThesaurusResultOutput) Id() pulumi.StringOutput { 167 return o.ApplyT(func(v LookupThesaurusResult) string { return v.Id }).(pulumi.StringOutput) 168 } 169 170 func (o LookupThesaurusResultOutput) IndexId() pulumi.StringOutput { 171 return o.ApplyT(func(v LookupThesaurusResult) string { return v.IndexId }).(pulumi.StringOutput) 172 } 173 174 // Name of the Thesaurus. 175 func (o LookupThesaurusResultOutput) Name() pulumi.StringOutput { 176 return o.ApplyT(func(v LookupThesaurusResult) string { return v.Name }).(pulumi.StringOutput) 177 } 178 179 // ARN of a role with permission to access the S3 bucket that contains the Thesaurus. For more information, see [IAM Roles for Amazon Kendra](https://docs.aws.amazon.com/kendra/latest/dg/iam-roles.html). 180 func (o LookupThesaurusResultOutput) RoleArn() pulumi.StringOutput { 181 return o.ApplyT(func(v LookupThesaurusResult) string { return v.RoleArn }).(pulumi.StringOutput) 182 } 183 184 // S3 location of the Thesaurus input data. Detailed below. 185 func (o LookupThesaurusResultOutput) SourceS3Paths() GetThesaurusSourceS3PathArrayOutput { 186 return o.ApplyT(func(v LookupThesaurusResult) []GetThesaurusSourceS3Path { return v.SourceS3Paths }).(GetThesaurusSourceS3PathArrayOutput) 187 } 188 189 // Status of the Thesaurus. It is ready to use when the status is `ACTIVE`. 190 func (o LookupThesaurusResultOutput) Status() pulumi.StringOutput { 191 return o.ApplyT(func(v LookupThesaurusResult) string { return v.Status }).(pulumi.StringOutput) 192 } 193 194 // Number of synonym rules in the Thesaurus file. 195 func (o LookupThesaurusResultOutput) SynonymRuleCount() pulumi.IntOutput { 196 return o.ApplyT(func(v LookupThesaurusResult) int { return v.SynonymRuleCount }).(pulumi.IntOutput) 197 } 198 199 // Metadata that helps organize the Thesaurus you create. 200 func (o LookupThesaurusResultOutput) Tags() pulumi.StringMapOutput { 201 return o.ApplyT(func(v LookupThesaurusResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput) 202 } 203 204 // Number of unique terms in the Thesaurus file. For example, the synonyms `a,b,c` and `a=>d`, the term count would be 4. 205 func (o LookupThesaurusResultOutput) TermCount() pulumi.IntOutput { 206 return o.ApplyT(func(v LookupThesaurusResult) int { return v.TermCount }).(pulumi.IntOutput) 207 } 208 209 func (o LookupThesaurusResultOutput) ThesaurusId() pulumi.StringOutput { 210 return o.ApplyT(func(v LookupThesaurusResult) string { return v.ThesaurusId }).(pulumi.StringOutput) 211 } 212 213 // Date and time that the Thesaurus was last updated. 214 func (o LookupThesaurusResultOutput) UpdatedAt() pulumi.StringOutput { 215 return o.ApplyT(func(v LookupThesaurusResult) string { return v.UpdatedAt }).(pulumi.StringOutput) 216 } 217 218 func init() { 219 pulumi.RegisterOutputType(LookupThesaurusResultOutput{}) 220 }