github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/rekognition/collection.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 rekognition 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 Rekognition Collection. 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/rekognition" 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 := rekognition.NewCollection(ctx, "example", &rekognition.CollectionArgs{ 33 // CollectionId: pulumi.String("my-collection"), 34 // Tags: pulumi.StringMap{ 35 // "example": pulumi.String("1"), 36 // }, 37 // }) 38 // if err != nil { 39 // return err 40 // } 41 // return nil 42 // }) 43 // } 44 // 45 // ``` 46 // <!--End PulumiCodeChooser --> 47 // 48 // ## Import 49 // 50 // Using `pulumi import`, import Rekognition Collection using the `example_id_arg`. For example: 51 // 52 // ```sh 53 // $ pulumi import aws:rekognition/collection:Collection example collection-id-12345678 54 // ``` 55 type Collection struct { 56 pulumi.CustomResourceState 57 58 // ARN of the Collection. 59 Arn pulumi.StringOutput `pulumi:"arn"` 60 // The name of the collection 61 // 62 // The following arguments are optional: 63 CollectionId pulumi.StringOutput `pulumi:"collectionId"` 64 // The Face Model Version that the collection was initialized with 65 FaceModelVersion pulumi.StringOutput `pulumi:"faceModelVersion"` 66 // A map of tags assigned to the WorkSpaces Connection Alias. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 67 Tags pulumi.StringMapOutput `pulumi:"tags"` 68 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 69 // 70 // Deprecated: Please use `tags` instead. 71 TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"` 72 Timeouts CollectionTimeoutsPtrOutput `pulumi:"timeouts"` 73 } 74 75 // NewCollection registers a new resource with the given unique name, arguments, and options. 76 func NewCollection(ctx *pulumi.Context, 77 name string, args *CollectionArgs, opts ...pulumi.ResourceOption) (*Collection, error) { 78 if args == nil { 79 return nil, errors.New("missing one or more required arguments") 80 } 81 82 if args.CollectionId == nil { 83 return nil, errors.New("invalid value for required argument 'CollectionId'") 84 } 85 opts = internal.PkgResourceDefaultOpts(opts) 86 var resource Collection 87 err := ctx.RegisterResource("aws:rekognition/collection:Collection", name, args, &resource, opts...) 88 if err != nil { 89 return nil, err 90 } 91 return &resource, nil 92 } 93 94 // GetCollection gets an existing Collection resource's state with the given name, ID, and optional 95 // state properties that are used to uniquely qualify the lookup (nil if not required). 96 func GetCollection(ctx *pulumi.Context, 97 name string, id pulumi.IDInput, state *CollectionState, opts ...pulumi.ResourceOption) (*Collection, error) { 98 var resource Collection 99 err := ctx.ReadResource("aws:rekognition/collection:Collection", name, id, state, &resource, opts...) 100 if err != nil { 101 return nil, err 102 } 103 return &resource, nil 104 } 105 106 // Input properties used for looking up and filtering Collection resources. 107 type collectionState struct { 108 // ARN of the Collection. 109 Arn *string `pulumi:"arn"` 110 // The name of the collection 111 // 112 // The following arguments are optional: 113 CollectionId *string `pulumi:"collectionId"` 114 // The Face Model Version that the collection was initialized with 115 FaceModelVersion *string `pulumi:"faceModelVersion"` 116 // A map of tags assigned to the WorkSpaces Connection Alias. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 117 Tags map[string]string `pulumi:"tags"` 118 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 119 // 120 // Deprecated: Please use `tags` instead. 121 TagsAll map[string]string `pulumi:"tagsAll"` 122 Timeouts *CollectionTimeouts `pulumi:"timeouts"` 123 } 124 125 type CollectionState struct { 126 // ARN of the Collection. 127 Arn pulumi.StringPtrInput 128 // The name of the collection 129 // 130 // The following arguments are optional: 131 CollectionId pulumi.StringPtrInput 132 // The Face Model Version that the collection was initialized with 133 FaceModelVersion pulumi.StringPtrInput 134 // A map of tags assigned to the WorkSpaces Connection Alias. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 135 Tags pulumi.StringMapInput 136 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 137 // 138 // Deprecated: Please use `tags` instead. 139 TagsAll pulumi.StringMapInput 140 Timeouts CollectionTimeoutsPtrInput 141 } 142 143 func (CollectionState) ElementType() reflect.Type { 144 return reflect.TypeOf((*collectionState)(nil)).Elem() 145 } 146 147 type collectionArgs struct { 148 // The name of the collection 149 // 150 // The following arguments are optional: 151 CollectionId string `pulumi:"collectionId"` 152 // A map of tags assigned to the WorkSpaces Connection Alias. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 153 Tags map[string]string `pulumi:"tags"` 154 Timeouts *CollectionTimeouts `pulumi:"timeouts"` 155 } 156 157 // The set of arguments for constructing a Collection resource. 158 type CollectionArgs struct { 159 // The name of the collection 160 // 161 // The following arguments are optional: 162 CollectionId pulumi.StringInput 163 // A map of tags assigned to the WorkSpaces Connection Alias. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 164 Tags pulumi.StringMapInput 165 Timeouts CollectionTimeoutsPtrInput 166 } 167 168 func (CollectionArgs) ElementType() reflect.Type { 169 return reflect.TypeOf((*collectionArgs)(nil)).Elem() 170 } 171 172 type CollectionInput interface { 173 pulumi.Input 174 175 ToCollectionOutput() CollectionOutput 176 ToCollectionOutputWithContext(ctx context.Context) CollectionOutput 177 } 178 179 func (*Collection) ElementType() reflect.Type { 180 return reflect.TypeOf((**Collection)(nil)).Elem() 181 } 182 183 func (i *Collection) ToCollectionOutput() CollectionOutput { 184 return i.ToCollectionOutputWithContext(context.Background()) 185 } 186 187 func (i *Collection) ToCollectionOutputWithContext(ctx context.Context) CollectionOutput { 188 return pulumi.ToOutputWithContext(ctx, i).(CollectionOutput) 189 } 190 191 // CollectionArrayInput is an input type that accepts CollectionArray and CollectionArrayOutput values. 192 // You can construct a concrete instance of `CollectionArrayInput` via: 193 // 194 // CollectionArray{ CollectionArgs{...} } 195 type CollectionArrayInput interface { 196 pulumi.Input 197 198 ToCollectionArrayOutput() CollectionArrayOutput 199 ToCollectionArrayOutputWithContext(context.Context) CollectionArrayOutput 200 } 201 202 type CollectionArray []CollectionInput 203 204 func (CollectionArray) ElementType() reflect.Type { 205 return reflect.TypeOf((*[]*Collection)(nil)).Elem() 206 } 207 208 func (i CollectionArray) ToCollectionArrayOutput() CollectionArrayOutput { 209 return i.ToCollectionArrayOutputWithContext(context.Background()) 210 } 211 212 func (i CollectionArray) ToCollectionArrayOutputWithContext(ctx context.Context) CollectionArrayOutput { 213 return pulumi.ToOutputWithContext(ctx, i).(CollectionArrayOutput) 214 } 215 216 // CollectionMapInput is an input type that accepts CollectionMap and CollectionMapOutput values. 217 // You can construct a concrete instance of `CollectionMapInput` via: 218 // 219 // CollectionMap{ "key": CollectionArgs{...} } 220 type CollectionMapInput interface { 221 pulumi.Input 222 223 ToCollectionMapOutput() CollectionMapOutput 224 ToCollectionMapOutputWithContext(context.Context) CollectionMapOutput 225 } 226 227 type CollectionMap map[string]CollectionInput 228 229 func (CollectionMap) ElementType() reflect.Type { 230 return reflect.TypeOf((*map[string]*Collection)(nil)).Elem() 231 } 232 233 func (i CollectionMap) ToCollectionMapOutput() CollectionMapOutput { 234 return i.ToCollectionMapOutputWithContext(context.Background()) 235 } 236 237 func (i CollectionMap) ToCollectionMapOutputWithContext(ctx context.Context) CollectionMapOutput { 238 return pulumi.ToOutputWithContext(ctx, i).(CollectionMapOutput) 239 } 240 241 type CollectionOutput struct{ *pulumi.OutputState } 242 243 func (CollectionOutput) ElementType() reflect.Type { 244 return reflect.TypeOf((**Collection)(nil)).Elem() 245 } 246 247 func (o CollectionOutput) ToCollectionOutput() CollectionOutput { 248 return o 249 } 250 251 func (o CollectionOutput) ToCollectionOutputWithContext(ctx context.Context) CollectionOutput { 252 return o 253 } 254 255 // ARN of the Collection. 256 func (o CollectionOutput) Arn() pulumi.StringOutput { 257 return o.ApplyT(func(v *Collection) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput) 258 } 259 260 // The name of the collection 261 // 262 // The following arguments are optional: 263 func (o CollectionOutput) CollectionId() pulumi.StringOutput { 264 return o.ApplyT(func(v *Collection) pulumi.StringOutput { return v.CollectionId }).(pulumi.StringOutput) 265 } 266 267 // The Face Model Version that the collection was initialized with 268 func (o CollectionOutput) FaceModelVersion() pulumi.StringOutput { 269 return o.ApplyT(func(v *Collection) pulumi.StringOutput { return v.FaceModelVersion }).(pulumi.StringOutput) 270 } 271 272 // A map of tags assigned to the WorkSpaces Connection Alias. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 273 func (o CollectionOutput) Tags() pulumi.StringMapOutput { 274 return o.ApplyT(func(v *Collection) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput) 275 } 276 277 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 278 // 279 // Deprecated: Please use `tags` instead. 280 func (o CollectionOutput) TagsAll() pulumi.StringMapOutput { 281 return o.ApplyT(func(v *Collection) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput) 282 } 283 284 func (o CollectionOutput) Timeouts() CollectionTimeoutsPtrOutput { 285 return o.ApplyT(func(v *Collection) CollectionTimeoutsPtrOutput { return v.Timeouts }).(CollectionTimeoutsPtrOutput) 286 } 287 288 type CollectionArrayOutput struct{ *pulumi.OutputState } 289 290 func (CollectionArrayOutput) ElementType() reflect.Type { 291 return reflect.TypeOf((*[]*Collection)(nil)).Elem() 292 } 293 294 func (o CollectionArrayOutput) ToCollectionArrayOutput() CollectionArrayOutput { 295 return o 296 } 297 298 func (o CollectionArrayOutput) ToCollectionArrayOutputWithContext(ctx context.Context) CollectionArrayOutput { 299 return o 300 } 301 302 func (o CollectionArrayOutput) Index(i pulumi.IntInput) CollectionOutput { 303 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Collection { 304 return vs[0].([]*Collection)[vs[1].(int)] 305 }).(CollectionOutput) 306 } 307 308 type CollectionMapOutput struct{ *pulumi.OutputState } 309 310 func (CollectionMapOutput) ElementType() reflect.Type { 311 return reflect.TypeOf((*map[string]*Collection)(nil)).Elem() 312 } 313 314 func (o CollectionMapOutput) ToCollectionMapOutput() CollectionMapOutput { 315 return o 316 } 317 318 func (o CollectionMapOutput) ToCollectionMapOutputWithContext(ctx context.Context) CollectionMapOutput { 319 return o 320 } 321 322 func (o CollectionMapOutput) MapIndex(k pulumi.StringInput) CollectionOutput { 323 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Collection { 324 return vs[0].(map[string]*Collection)[vs[1].(string)] 325 }).(CollectionOutput) 326 } 327 328 func init() { 329 pulumi.RegisterInputType(reflect.TypeOf((*CollectionInput)(nil)).Elem(), &Collection{}) 330 pulumi.RegisterInputType(reflect.TypeOf((*CollectionArrayInput)(nil)).Elem(), CollectionArray{}) 331 pulumi.RegisterInputType(reflect.TypeOf((*CollectionMapInput)(nil)).Elem(), CollectionMap{}) 332 pulumi.RegisterOutputType(CollectionOutput{}) 333 pulumi.RegisterOutputType(CollectionArrayOutput{}) 334 pulumi.RegisterOutputType(CollectionMapOutput{}) 335 }