github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/iot/indexingConfiguration.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 iot
     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  // Managing [IoT Thing indexing](https://docs.aws.amazon.com/iot/latest/developerguide/managing-index.html).
    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/iot"
    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 := iot.NewIndexingConfiguration(ctx, "example", &iot.IndexingConfigurationArgs{
    32  //				ThingIndexingConfiguration: &iot.IndexingConfigurationThingIndexingConfigurationArgs{
    33  //					ThingIndexingMode:             pulumi.String("REGISTRY_AND_SHADOW"),
    34  //					ThingConnectivityIndexingMode: pulumi.String("STATUS"),
    35  //					DeviceDefenderIndexingMode:    pulumi.String("VIOLATIONS"),
    36  //					NamedShadowIndexingMode:       pulumi.String("ON"),
    37  //					Filter: &iot.IndexingConfigurationThingIndexingConfigurationFilterArgs{
    38  //						NamedShadowNames: pulumi.StringArray{
    39  //							pulumi.String("thing1shadow"),
    40  //						},
    41  //					},
    42  //					CustomFields: iot.IndexingConfigurationThingIndexingConfigurationCustomFieldArray{
    43  //						&iot.IndexingConfigurationThingIndexingConfigurationCustomFieldArgs{
    44  //							Name: pulumi.String("shadow.desired.power"),
    45  //							Type: pulumi.String("Boolean"),
    46  //						},
    47  //						&iot.IndexingConfigurationThingIndexingConfigurationCustomFieldArgs{
    48  //							Name: pulumi.String("attributes.version"),
    49  //							Type: pulumi.String("Number"),
    50  //						},
    51  //						&iot.IndexingConfigurationThingIndexingConfigurationCustomFieldArgs{
    52  //							Name: pulumi.String("shadow.name.thing1shadow.desired.DefaultDesired"),
    53  //							Type: pulumi.String("String"),
    54  //						},
    55  //						&iot.IndexingConfigurationThingIndexingConfigurationCustomFieldArgs{
    56  //							Name: pulumi.String("deviceDefender.securityProfile1.NUMBER_VALUE_BEHAVIOR.lastViolationValue.number"),
    57  //							Type: pulumi.String("Number"),
    58  //						},
    59  //					},
    60  //				},
    61  //			})
    62  //			if err != nil {
    63  //				return err
    64  //			}
    65  //			return nil
    66  //		})
    67  //	}
    68  //
    69  // ```
    70  // <!--End PulumiCodeChooser -->
    71  type IndexingConfiguration struct {
    72  	pulumi.CustomResourceState
    73  
    74  	// Thing group indexing configuration. See below.
    75  	ThingGroupIndexingConfiguration IndexingConfigurationThingGroupIndexingConfigurationOutput `pulumi:"thingGroupIndexingConfiguration"`
    76  	// Thing indexing configuration. See below.
    77  	ThingIndexingConfiguration IndexingConfigurationThingIndexingConfigurationOutput `pulumi:"thingIndexingConfiguration"`
    78  }
    79  
    80  // NewIndexingConfiguration registers a new resource with the given unique name, arguments, and options.
    81  func NewIndexingConfiguration(ctx *pulumi.Context,
    82  	name string, args *IndexingConfigurationArgs, opts ...pulumi.ResourceOption) (*IndexingConfiguration, error) {
    83  	if args == nil {
    84  		args = &IndexingConfigurationArgs{}
    85  	}
    86  
    87  	opts = internal.PkgResourceDefaultOpts(opts)
    88  	var resource IndexingConfiguration
    89  	err := ctx.RegisterResource("aws:iot/indexingConfiguration:IndexingConfiguration", name, args, &resource, opts...)
    90  	if err != nil {
    91  		return nil, err
    92  	}
    93  	return &resource, nil
    94  }
    95  
    96  // GetIndexingConfiguration gets an existing IndexingConfiguration resource's state with the given name, ID, and optional
    97  // state properties that are used to uniquely qualify the lookup (nil if not required).
    98  func GetIndexingConfiguration(ctx *pulumi.Context,
    99  	name string, id pulumi.IDInput, state *IndexingConfigurationState, opts ...pulumi.ResourceOption) (*IndexingConfiguration, error) {
   100  	var resource IndexingConfiguration
   101  	err := ctx.ReadResource("aws:iot/indexingConfiguration:IndexingConfiguration", name, id, state, &resource, opts...)
   102  	if err != nil {
   103  		return nil, err
   104  	}
   105  	return &resource, nil
   106  }
   107  
   108  // Input properties used for looking up and filtering IndexingConfiguration resources.
   109  type indexingConfigurationState struct {
   110  	// Thing group indexing configuration. See below.
   111  	ThingGroupIndexingConfiguration *IndexingConfigurationThingGroupIndexingConfiguration `pulumi:"thingGroupIndexingConfiguration"`
   112  	// Thing indexing configuration. See below.
   113  	ThingIndexingConfiguration *IndexingConfigurationThingIndexingConfiguration `pulumi:"thingIndexingConfiguration"`
   114  }
   115  
   116  type IndexingConfigurationState struct {
   117  	// Thing group indexing configuration. See below.
   118  	ThingGroupIndexingConfiguration IndexingConfigurationThingGroupIndexingConfigurationPtrInput
   119  	// Thing indexing configuration. See below.
   120  	ThingIndexingConfiguration IndexingConfigurationThingIndexingConfigurationPtrInput
   121  }
   122  
   123  func (IndexingConfigurationState) ElementType() reflect.Type {
   124  	return reflect.TypeOf((*indexingConfigurationState)(nil)).Elem()
   125  }
   126  
   127  type indexingConfigurationArgs struct {
   128  	// Thing group indexing configuration. See below.
   129  	ThingGroupIndexingConfiguration *IndexingConfigurationThingGroupIndexingConfiguration `pulumi:"thingGroupIndexingConfiguration"`
   130  	// Thing indexing configuration. See below.
   131  	ThingIndexingConfiguration *IndexingConfigurationThingIndexingConfiguration `pulumi:"thingIndexingConfiguration"`
   132  }
   133  
   134  // The set of arguments for constructing a IndexingConfiguration resource.
   135  type IndexingConfigurationArgs struct {
   136  	// Thing group indexing configuration. See below.
   137  	ThingGroupIndexingConfiguration IndexingConfigurationThingGroupIndexingConfigurationPtrInput
   138  	// Thing indexing configuration. See below.
   139  	ThingIndexingConfiguration IndexingConfigurationThingIndexingConfigurationPtrInput
   140  }
   141  
   142  func (IndexingConfigurationArgs) ElementType() reflect.Type {
   143  	return reflect.TypeOf((*indexingConfigurationArgs)(nil)).Elem()
   144  }
   145  
   146  type IndexingConfigurationInput interface {
   147  	pulumi.Input
   148  
   149  	ToIndexingConfigurationOutput() IndexingConfigurationOutput
   150  	ToIndexingConfigurationOutputWithContext(ctx context.Context) IndexingConfigurationOutput
   151  }
   152  
   153  func (*IndexingConfiguration) ElementType() reflect.Type {
   154  	return reflect.TypeOf((**IndexingConfiguration)(nil)).Elem()
   155  }
   156  
   157  func (i *IndexingConfiguration) ToIndexingConfigurationOutput() IndexingConfigurationOutput {
   158  	return i.ToIndexingConfigurationOutputWithContext(context.Background())
   159  }
   160  
   161  func (i *IndexingConfiguration) ToIndexingConfigurationOutputWithContext(ctx context.Context) IndexingConfigurationOutput {
   162  	return pulumi.ToOutputWithContext(ctx, i).(IndexingConfigurationOutput)
   163  }
   164  
   165  // IndexingConfigurationArrayInput is an input type that accepts IndexingConfigurationArray and IndexingConfigurationArrayOutput values.
   166  // You can construct a concrete instance of `IndexingConfigurationArrayInput` via:
   167  //
   168  //	IndexingConfigurationArray{ IndexingConfigurationArgs{...} }
   169  type IndexingConfigurationArrayInput interface {
   170  	pulumi.Input
   171  
   172  	ToIndexingConfigurationArrayOutput() IndexingConfigurationArrayOutput
   173  	ToIndexingConfigurationArrayOutputWithContext(context.Context) IndexingConfigurationArrayOutput
   174  }
   175  
   176  type IndexingConfigurationArray []IndexingConfigurationInput
   177  
   178  func (IndexingConfigurationArray) ElementType() reflect.Type {
   179  	return reflect.TypeOf((*[]*IndexingConfiguration)(nil)).Elem()
   180  }
   181  
   182  func (i IndexingConfigurationArray) ToIndexingConfigurationArrayOutput() IndexingConfigurationArrayOutput {
   183  	return i.ToIndexingConfigurationArrayOutputWithContext(context.Background())
   184  }
   185  
   186  func (i IndexingConfigurationArray) ToIndexingConfigurationArrayOutputWithContext(ctx context.Context) IndexingConfigurationArrayOutput {
   187  	return pulumi.ToOutputWithContext(ctx, i).(IndexingConfigurationArrayOutput)
   188  }
   189  
   190  // IndexingConfigurationMapInput is an input type that accepts IndexingConfigurationMap and IndexingConfigurationMapOutput values.
   191  // You can construct a concrete instance of `IndexingConfigurationMapInput` via:
   192  //
   193  //	IndexingConfigurationMap{ "key": IndexingConfigurationArgs{...} }
   194  type IndexingConfigurationMapInput interface {
   195  	pulumi.Input
   196  
   197  	ToIndexingConfigurationMapOutput() IndexingConfigurationMapOutput
   198  	ToIndexingConfigurationMapOutputWithContext(context.Context) IndexingConfigurationMapOutput
   199  }
   200  
   201  type IndexingConfigurationMap map[string]IndexingConfigurationInput
   202  
   203  func (IndexingConfigurationMap) ElementType() reflect.Type {
   204  	return reflect.TypeOf((*map[string]*IndexingConfiguration)(nil)).Elem()
   205  }
   206  
   207  func (i IndexingConfigurationMap) ToIndexingConfigurationMapOutput() IndexingConfigurationMapOutput {
   208  	return i.ToIndexingConfigurationMapOutputWithContext(context.Background())
   209  }
   210  
   211  func (i IndexingConfigurationMap) ToIndexingConfigurationMapOutputWithContext(ctx context.Context) IndexingConfigurationMapOutput {
   212  	return pulumi.ToOutputWithContext(ctx, i).(IndexingConfigurationMapOutput)
   213  }
   214  
   215  type IndexingConfigurationOutput struct{ *pulumi.OutputState }
   216  
   217  func (IndexingConfigurationOutput) ElementType() reflect.Type {
   218  	return reflect.TypeOf((**IndexingConfiguration)(nil)).Elem()
   219  }
   220  
   221  func (o IndexingConfigurationOutput) ToIndexingConfigurationOutput() IndexingConfigurationOutput {
   222  	return o
   223  }
   224  
   225  func (o IndexingConfigurationOutput) ToIndexingConfigurationOutputWithContext(ctx context.Context) IndexingConfigurationOutput {
   226  	return o
   227  }
   228  
   229  // Thing group indexing configuration. See below.
   230  func (o IndexingConfigurationOutput) ThingGroupIndexingConfiguration() IndexingConfigurationThingGroupIndexingConfigurationOutput {
   231  	return o.ApplyT(func(v *IndexingConfiguration) IndexingConfigurationThingGroupIndexingConfigurationOutput {
   232  		return v.ThingGroupIndexingConfiguration
   233  	}).(IndexingConfigurationThingGroupIndexingConfigurationOutput)
   234  }
   235  
   236  // Thing indexing configuration. See below.
   237  func (o IndexingConfigurationOutput) ThingIndexingConfiguration() IndexingConfigurationThingIndexingConfigurationOutput {
   238  	return o.ApplyT(func(v *IndexingConfiguration) IndexingConfigurationThingIndexingConfigurationOutput {
   239  		return v.ThingIndexingConfiguration
   240  	}).(IndexingConfigurationThingIndexingConfigurationOutput)
   241  }
   242  
   243  type IndexingConfigurationArrayOutput struct{ *pulumi.OutputState }
   244  
   245  func (IndexingConfigurationArrayOutput) ElementType() reflect.Type {
   246  	return reflect.TypeOf((*[]*IndexingConfiguration)(nil)).Elem()
   247  }
   248  
   249  func (o IndexingConfigurationArrayOutput) ToIndexingConfigurationArrayOutput() IndexingConfigurationArrayOutput {
   250  	return o
   251  }
   252  
   253  func (o IndexingConfigurationArrayOutput) ToIndexingConfigurationArrayOutputWithContext(ctx context.Context) IndexingConfigurationArrayOutput {
   254  	return o
   255  }
   256  
   257  func (o IndexingConfigurationArrayOutput) Index(i pulumi.IntInput) IndexingConfigurationOutput {
   258  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *IndexingConfiguration {
   259  		return vs[0].([]*IndexingConfiguration)[vs[1].(int)]
   260  	}).(IndexingConfigurationOutput)
   261  }
   262  
   263  type IndexingConfigurationMapOutput struct{ *pulumi.OutputState }
   264  
   265  func (IndexingConfigurationMapOutput) ElementType() reflect.Type {
   266  	return reflect.TypeOf((*map[string]*IndexingConfiguration)(nil)).Elem()
   267  }
   268  
   269  func (o IndexingConfigurationMapOutput) ToIndexingConfigurationMapOutput() IndexingConfigurationMapOutput {
   270  	return o
   271  }
   272  
   273  func (o IndexingConfigurationMapOutput) ToIndexingConfigurationMapOutputWithContext(ctx context.Context) IndexingConfigurationMapOutput {
   274  	return o
   275  }
   276  
   277  func (o IndexingConfigurationMapOutput) MapIndex(k pulumi.StringInput) IndexingConfigurationOutput {
   278  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *IndexingConfiguration {
   279  		return vs[0].(map[string]*IndexingConfiguration)[vs[1].(string)]
   280  	}).(IndexingConfigurationOutput)
   281  }
   282  
   283  func init() {
   284  	pulumi.RegisterInputType(reflect.TypeOf((*IndexingConfigurationInput)(nil)).Elem(), &IndexingConfiguration{})
   285  	pulumi.RegisterInputType(reflect.TypeOf((*IndexingConfigurationArrayInput)(nil)).Elem(), IndexingConfigurationArray{})
   286  	pulumi.RegisterInputType(reflect.TypeOf((*IndexingConfigurationMapInput)(nil)).Elem(), IndexingConfigurationMap{})
   287  	pulumi.RegisterOutputType(IndexingConfigurationOutput{})
   288  	pulumi.RegisterOutputType(IndexingConfigurationArrayOutput{})
   289  	pulumi.RegisterOutputType(IndexingConfigurationMapOutput{})
   290  }