github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/location/placeIndex.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 location
     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  // Provides a Location Service Place Index.
    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/location"
    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 := location.NewPlaceIndex(ctx, "example", &location.PlaceIndexArgs{
    33  //				DataSource: pulumi.String("Here"),
    34  //				IndexName:  pulumi.String("example"),
    35  //			})
    36  //			if err != nil {
    37  //				return err
    38  //			}
    39  //			return nil
    40  //		})
    41  //	}
    42  //
    43  // ```
    44  // <!--End PulumiCodeChooser -->
    45  //
    46  // ## Import
    47  //
    48  // Using `pulumi import`, import `aws_location_place_index` resources using the place index name. For example:
    49  //
    50  // ```sh
    51  // $ pulumi import aws:location/placeIndex:PlaceIndex example example
    52  // ```
    53  type PlaceIndex struct {
    54  	pulumi.CustomResourceState
    55  
    56  	// The timestamp for when the place index resource was created in ISO 8601 format.
    57  	CreateTime pulumi.StringOutput `pulumi:"createTime"`
    58  	// Specifies the geospatial data provider for the new place index.
    59  	DataSource pulumi.StringOutput `pulumi:"dataSource"`
    60  	// Configuration block with the data storage option chosen for requesting Places. Detailed below.
    61  	DataSourceConfiguration PlaceIndexDataSourceConfigurationOutput `pulumi:"dataSourceConfiguration"`
    62  	// The optional description for the place index resource.
    63  	Description pulumi.StringPtrOutput `pulumi:"description"`
    64  	// The Amazon Resource Name (ARN) for the place index resource. Used to specify a resource across AWS.
    65  	IndexArn pulumi.StringOutput `pulumi:"indexArn"`
    66  	// The name of the place index resource.
    67  	//
    68  	// The following arguments are optional:
    69  	IndexName pulumi.StringOutput `pulumi:"indexName"`
    70  	// Key-value tags for the place index. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    71  	Tags pulumi.StringMapOutput `pulumi:"tags"`
    72  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
    73  	//
    74  	// Deprecated: Please use `tags` instead.
    75  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
    76  	// The timestamp for when the place index resource was last update in ISO 8601.
    77  	UpdateTime pulumi.StringOutput `pulumi:"updateTime"`
    78  }
    79  
    80  // NewPlaceIndex registers a new resource with the given unique name, arguments, and options.
    81  func NewPlaceIndex(ctx *pulumi.Context,
    82  	name string, args *PlaceIndexArgs, opts ...pulumi.ResourceOption) (*PlaceIndex, error) {
    83  	if args == nil {
    84  		return nil, errors.New("missing one or more required arguments")
    85  	}
    86  
    87  	if args.DataSource == nil {
    88  		return nil, errors.New("invalid value for required argument 'DataSource'")
    89  	}
    90  	if args.IndexName == nil {
    91  		return nil, errors.New("invalid value for required argument 'IndexName'")
    92  	}
    93  	opts = internal.PkgResourceDefaultOpts(opts)
    94  	var resource PlaceIndex
    95  	err := ctx.RegisterResource("aws:location/placeIndex:PlaceIndex", name, args, &resource, opts...)
    96  	if err != nil {
    97  		return nil, err
    98  	}
    99  	return &resource, nil
   100  }
   101  
   102  // GetPlaceIndex gets an existing PlaceIndex resource's state with the given name, ID, and optional
   103  // state properties that are used to uniquely qualify the lookup (nil if not required).
   104  func GetPlaceIndex(ctx *pulumi.Context,
   105  	name string, id pulumi.IDInput, state *PlaceIndexState, opts ...pulumi.ResourceOption) (*PlaceIndex, error) {
   106  	var resource PlaceIndex
   107  	err := ctx.ReadResource("aws:location/placeIndex:PlaceIndex", name, id, state, &resource, opts...)
   108  	if err != nil {
   109  		return nil, err
   110  	}
   111  	return &resource, nil
   112  }
   113  
   114  // Input properties used for looking up and filtering PlaceIndex resources.
   115  type placeIndexState struct {
   116  	// The timestamp for when the place index resource was created in ISO 8601 format.
   117  	CreateTime *string `pulumi:"createTime"`
   118  	// Specifies the geospatial data provider for the new place index.
   119  	DataSource *string `pulumi:"dataSource"`
   120  	// Configuration block with the data storage option chosen for requesting Places. Detailed below.
   121  	DataSourceConfiguration *PlaceIndexDataSourceConfiguration `pulumi:"dataSourceConfiguration"`
   122  	// The optional description for the place index resource.
   123  	Description *string `pulumi:"description"`
   124  	// The Amazon Resource Name (ARN) for the place index resource. Used to specify a resource across AWS.
   125  	IndexArn *string `pulumi:"indexArn"`
   126  	// The name of the place index resource.
   127  	//
   128  	// The following arguments are optional:
   129  	IndexName *string `pulumi:"indexName"`
   130  	// Key-value tags for the place index. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   131  	Tags map[string]string `pulumi:"tags"`
   132  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   133  	//
   134  	// Deprecated: Please use `tags` instead.
   135  	TagsAll map[string]string `pulumi:"tagsAll"`
   136  	// The timestamp for when the place index resource was last update in ISO 8601.
   137  	UpdateTime *string `pulumi:"updateTime"`
   138  }
   139  
   140  type PlaceIndexState struct {
   141  	// The timestamp for when the place index resource was created in ISO 8601 format.
   142  	CreateTime pulumi.StringPtrInput
   143  	// Specifies the geospatial data provider for the new place index.
   144  	DataSource pulumi.StringPtrInput
   145  	// Configuration block with the data storage option chosen for requesting Places. Detailed below.
   146  	DataSourceConfiguration PlaceIndexDataSourceConfigurationPtrInput
   147  	// The optional description for the place index resource.
   148  	Description pulumi.StringPtrInput
   149  	// The Amazon Resource Name (ARN) for the place index resource. Used to specify a resource across AWS.
   150  	IndexArn pulumi.StringPtrInput
   151  	// The name of the place index resource.
   152  	//
   153  	// The following arguments are optional:
   154  	IndexName pulumi.StringPtrInput
   155  	// Key-value tags for the place index. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   156  	Tags pulumi.StringMapInput
   157  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   158  	//
   159  	// Deprecated: Please use `tags` instead.
   160  	TagsAll pulumi.StringMapInput
   161  	// The timestamp for when the place index resource was last update in ISO 8601.
   162  	UpdateTime pulumi.StringPtrInput
   163  }
   164  
   165  func (PlaceIndexState) ElementType() reflect.Type {
   166  	return reflect.TypeOf((*placeIndexState)(nil)).Elem()
   167  }
   168  
   169  type placeIndexArgs struct {
   170  	// Specifies the geospatial data provider for the new place index.
   171  	DataSource string `pulumi:"dataSource"`
   172  	// Configuration block with the data storage option chosen for requesting Places. Detailed below.
   173  	DataSourceConfiguration *PlaceIndexDataSourceConfiguration `pulumi:"dataSourceConfiguration"`
   174  	// The optional description for the place index resource.
   175  	Description *string `pulumi:"description"`
   176  	// The name of the place index resource.
   177  	//
   178  	// The following arguments are optional:
   179  	IndexName string `pulumi:"indexName"`
   180  	// Key-value tags for the place index. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   181  	Tags map[string]string `pulumi:"tags"`
   182  }
   183  
   184  // The set of arguments for constructing a PlaceIndex resource.
   185  type PlaceIndexArgs struct {
   186  	// Specifies the geospatial data provider for the new place index.
   187  	DataSource pulumi.StringInput
   188  	// Configuration block with the data storage option chosen for requesting Places. Detailed below.
   189  	DataSourceConfiguration PlaceIndexDataSourceConfigurationPtrInput
   190  	// The optional description for the place index resource.
   191  	Description pulumi.StringPtrInput
   192  	// The name of the place index resource.
   193  	//
   194  	// The following arguments are optional:
   195  	IndexName pulumi.StringInput
   196  	// Key-value tags for the place index. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   197  	Tags pulumi.StringMapInput
   198  }
   199  
   200  func (PlaceIndexArgs) ElementType() reflect.Type {
   201  	return reflect.TypeOf((*placeIndexArgs)(nil)).Elem()
   202  }
   203  
   204  type PlaceIndexInput interface {
   205  	pulumi.Input
   206  
   207  	ToPlaceIndexOutput() PlaceIndexOutput
   208  	ToPlaceIndexOutputWithContext(ctx context.Context) PlaceIndexOutput
   209  }
   210  
   211  func (*PlaceIndex) ElementType() reflect.Type {
   212  	return reflect.TypeOf((**PlaceIndex)(nil)).Elem()
   213  }
   214  
   215  func (i *PlaceIndex) ToPlaceIndexOutput() PlaceIndexOutput {
   216  	return i.ToPlaceIndexOutputWithContext(context.Background())
   217  }
   218  
   219  func (i *PlaceIndex) ToPlaceIndexOutputWithContext(ctx context.Context) PlaceIndexOutput {
   220  	return pulumi.ToOutputWithContext(ctx, i).(PlaceIndexOutput)
   221  }
   222  
   223  // PlaceIndexArrayInput is an input type that accepts PlaceIndexArray and PlaceIndexArrayOutput values.
   224  // You can construct a concrete instance of `PlaceIndexArrayInput` via:
   225  //
   226  //	PlaceIndexArray{ PlaceIndexArgs{...} }
   227  type PlaceIndexArrayInput interface {
   228  	pulumi.Input
   229  
   230  	ToPlaceIndexArrayOutput() PlaceIndexArrayOutput
   231  	ToPlaceIndexArrayOutputWithContext(context.Context) PlaceIndexArrayOutput
   232  }
   233  
   234  type PlaceIndexArray []PlaceIndexInput
   235  
   236  func (PlaceIndexArray) ElementType() reflect.Type {
   237  	return reflect.TypeOf((*[]*PlaceIndex)(nil)).Elem()
   238  }
   239  
   240  func (i PlaceIndexArray) ToPlaceIndexArrayOutput() PlaceIndexArrayOutput {
   241  	return i.ToPlaceIndexArrayOutputWithContext(context.Background())
   242  }
   243  
   244  func (i PlaceIndexArray) ToPlaceIndexArrayOutputWithContext(ctx context.Context) PlaceIndexArrayOutput {
   245  	return pulumi.ToOutputWithContext(ctx, i).(PlaceIndexArrayOutput)
   246  }
   247  
   248  // PlaceIndexMapInput is an input type that accepts PlaceIndexMap and PlaceIndexMapOutput values.
   249  // You can construct a concrete instance of `PlaceIndexMapInput` via:
   250  //
   251  //	PlaceIndexMap{ "key": PlaceIndexArgs{...} }
   252  type PlaceIndexMapInput interface {
   253  	pulumi.Input
   254  
   255  	ToPlaceIndexMapOutput() PlaceIndexMapOutput
   256  	ToPlaceIndexMapOutputWithContext(context.Context) PlaceIndexMapOutput
   257  }
   258  
   259  type PlaceIndexMap map[string]PlaceIndexInput
   260  
   261  func (PlaceIndexMap) ElementType() reflect.Type {
   262  	return reflect.TypeOf((*map[string]*PlaceIndex)(nil)).Elem()
   263  }
   264  
   265  func (i PlaceIndexMap) ToPlaceIndexMapOutput() PlaceIndexMapOutput {
   266  	return i.ToPlaceIndexMapOutputWithContext(context.Background())
   267  }
   268  
   269  func (i PlaceIndexMap) ToPlaceIndexMapOutputWithContext(ctx context.Context) PlaceIndexMapOutput {
   270  	return pulumi.ToOutputWithContext(ctx, i).(PlaceIndexMapOutput)
   271  }
   272  
   273  type PlaceIndexOutput struct{ *pulumi.OutputState }
   274  
   275  func (PlaceIndexOutput) ElementType() reflect.Type {
   276  	return reflect.TypeOf((**PlaceIndex)(nil)).Elem()
   277  }
   278  
   279  func (o PlaceIndexOutput) ToPlaceIndexOutput() PlaceIndexOutput {
   280  	return o
   281  }
   282  
   283  func (o PlaceIndexOutput) ToPlaceIndexOutputWithContext(ctx context.Context) PlaceIndexOutput {
   284  	return o
   285  }
   286  
   287  // The timestamp for when the place index resource was created in ISO 8601 format.
   288  func (o PlaceIndexOutput) CreateTime() pulumi.StringOutput {
   289  	return o.ApplyT(func(v *PlaceIndex) pulumi.StringOutput { return v.CreateTime }).(pulumi.StringOutput)
   290  }
   291  
   292  // Specifies the geospatial data provider for the new place index.
   293  func (o PlaceIndexOutput) DataSource() pulumi.StringOutput {
   294  	return o.ApplyT(func(v *PlaceIndex) pulumi.StringOutput { return v.DataSource }).(pulumi.StringOutput)
   295  }
   296  
   297  // Configuration block with the data storage option chosen for requesting Places. Detailed below.
   298  func (o PlaceIndexOutput) DataSourceConfiguration() PlaceIndexDataSourceConfigurationOutput {
   299  	return o.ApplyT(func(v *PlaceIndex) PlaceIndexDataSourceConfigurationOutput { return v.DataSourceConfiguration }).(PlaceIndexDataSourceConfigurationOutput)
   300  }
   301  
   302  // The optional description for the place index resource.
   303  func (o PlaceIndexOutput) Description() pulumi.StringPtrOutput {
   304  	return o.ApplyT(func(v *PlaceIndex) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)
   305  }
   306  
   307  // The Amazon Resource Name (ARN) for the place index resource. Used to specify a resource across AWS.
   308  func (o PlaceIndexOutput) IndexArn() pulumi.StringOutput {
   309  	return o.ApplyT(func(v *PlaceIndex) pulumi.StringOutput { return v.IndexArn }).(pulumi.StringOutput)
   310  }
   311  
   312  // The name of the place index resource.
   313  //
   314  // The following arguments are optional:
   315  func (o PlaceIndexOutput) IndexName() pulumi.StringOutput {
   316  	return o.ApplyT(func(v *PlaceIndex) pulumi.StringOutput { return v.IndexName }).(pulumi.StringOutput)
   317  }
   318  
   319  // Key-value tags for the place index. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   320  func (o PlaceIndexOutput) Tags() pulumi.StringMapOutput {
   321  	return o.ApplyT(func(v *PlaceIndex) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   322  }
   323  
   324  // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   325  //
   326  // Deprecated: Please use `tags` instead.
   327  func (o PlaceIndexOutput) TagsAll() pulumi.StringMapOutput {
   328  	return o.ApplyT(func(v *PlaceIndex) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   329  }
   330  
   331  // The timestamp for when the place index resource was last update in ISO 8601.
   332  func (o PlaceIndexOutput) UpdateTime() pulumi.StringOutput {
   333  	return o.ApplyT(func(v *PlaceIndex) pulumi.StringOutput { return v.UpdateTime }).(pulumi.StringOutput)
   334  }
   335  
   336  type PlaceIndexArrayOutput struct{ *pulumi.OutputState }
   337  
   338  func (PlaceIndexArrayOutput) ElementType() reflect.Type {
   339  	return reflect.TypeOf((*[]*PlaceIndex)(nil)).Elem()
   340  }
   341  
   342  func (o PlaceIndexArrayOutput) ToPlaceIndexArrayOutput() PlaceIndexArrayOutput {
   343  	return o
   344  }
   345  
   346  func (o PlaceIndexArrayOutput) ToPlaceIndexArrayOutputWithContext(ctx context.Context) PlaceIndexArrayOutput {
   347  	return o
   348  }
   349  
   350  func (o PlaceIndexArrayOutput) Index(i pulumi.IntInput) PlaceIndexOutput {
   351  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *PlaceIndex {
   352  		return vs[0].([]*PlaceIndex)[vs[1].(int)]
   353  	}).(PlaceIndexOutput)
   354  }
   355  
   356  type PlaceIndexMapOutput struct{ *pulumi.OutputState }
   357  
   358  func (PlaceIndexMapOutput) ElementType() reflect.Type {
   359  	return reflect.TypeOf((*map[string]*PlaceIndex)(nil)).Elem()
   360  }
   361  
   362  func (o PlaceIndexMapOutput) ToPlaceIndexMapOutput() PlaceIndexMapOutput {
   363  	return o
   364  }
   365  
   366  func (o PlaceIndexMapOutput) ToPlaceIndexMapOutputWithContext(ctx context.Context) PlaceIndexMapOutput {
   367  	return o
   368  }
   369  
   370  func (o PlaceIndexMapOutput) MapIndex(k pulumi.StringInput) PlaceIndexOutput {
   371  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *PlaceIndex {
   372  		return vs[0].(map[string]*PlaceIndex)[vs[1].(string)]
   373  	}).(PlaceIndexOutput)
   374  }
   375  
   376  func init() {
   377  	pulumi.RegisterInputType(reflect.TypeOf((*PlaceIndexInput)(nil)).Elem(), &PlaceIndex{})
   378  	pulumi.RegisterInputType(reflect.TypeOf((*PlaceIndexArrayInput)(nil)).Elem(), PlaceIndexArray{})
   379  	pulumi.RegisterInputType(reflect.TypeOf((*PlaceIndexMapInput)(nil)).Elem(), PlaceIndexMap{})
   380  	pulumi.RegisterOutputType(PlaceIndexOutput{})
   381  	pulumi.RegisterOutputType(PlaceIndexArrayOutput{})
   382  	pulumi.RegisterOutputType(PlaceIndexMapOutput{})
   383  }