oci.Nosql.Index
Explore with Pulumi AI
This resource provides the Index resource in Oracle Cloud Infrastructure NoSQL Database service.
Create a new index on the table identified by tableNameOrId.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";
const testIndex = new oci.nosql.Index("test_index", {
keys: [{
columnName: indexKeysColumnName,
jsonFieldType: indexKeysJsonFieldType,
jsonPath: indexKeysJsonPath,
}],
name: indexName,
tableNameOrId: testTableNameOr.id,
compartmentId: compartmentId,
isIfNotExists: indexIsIfNotExists,
});
import pulumi
import pulumi_oci as oci
test_index = oci.nosql.Index("test_index",
keys=[{
"column_name": index_keys_column_name,
"json_field_type": index_keys_json_field_type,
"json_path": index_keys_json_path,
}],
name=index_name,
table_name_or_id=test_table_name_or["id"],
compartment_id=compartment_id,
is_if_not_exists=index_is_if_not_exists)
package main
import (
"github.com/pulumi/pulumi-oci/sdk/v2/go/oci/Nosql"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := Nosql.NewIndex(ctx, "test_index", &Nosql.IndexArgs{
Keys: nosql.IndexKeyArray{
&nosql.IndexKeyArgs{
ColumnName: pulumi.Any(indexKeysColumnName),
JsonFieldType: pulumi.Any(indexKeysJsonFieldType),
JsonPath: pulumi.Any(indexKeysJsonPath),
},
},
Name: pulumi.Any(indexName),
TableNameOrId: pulumi.Any(testTableNameOr.Id),
CompartmentId: pulumi.Any(compartmentId),
IsIfNotExists: pulumi.Any(indexIsIfNotExists),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Oci = Pulumi.Oci;
return await Deployment.RunAsync(() =>
{
var testIndex = new Oci.Nosql.Index("test_index", new()
{
Keys = new[]
{
new Oci.Nosql.Inputs.IndexKeyArgs
{
ColumnName = indexKeysColumnName,
JsonFieldType = indexKeysJsonFieldType,
JsonPath = indexKeysJsonPath,
},
},
Name = indexName,
TableNameOrId = testTableNameOr.Id,
CompartmentId = compartmentId,
IsIfNotExists = indexIsIfNotExists,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.oci.Nosql.Index;
import com.pulumi.oci.Nosql.IndexArgs;
import com.pulumi.oci.Nosql.inputs.IndexKeyArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var testIndex = new Index("testIndex", IndexArgs.builder()
.keys(IndexKeyArgs.builder()
.columnName(indexKeysColumnName)
.jsonFieldType(indexKeysJsonFieldType)
.jsonPath(indexKeysJsonPath)
.build())
.name(indexName)
.tableNameOrId(testTableNameOr.id())
.compartmentId(compartmentId)
.isIfNotExists(indexIsIfNotExists)
.build());
}
}
resources:
testIndex:
type: oci:Nosql:Index
name: test_index
properties:
keys:
- columnName: ${indexKeysColumnName}
jsonFieldType: ${indexKeysJsonFieldType}
jsonPath: ${indexKeysJsonPath}
name: ${indexName}
tableNameOrId: ${testTableNameOr.id}
compartmentId: ${compartmentId}
isIfNotExists: ${indexIsIfNotExists}
Create Index Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Index(name: string, args: IndexArgs, opts?: CustomResourceOptions);
@overload
def Index(resource_name: str,
args: IndexArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Index(resource_name: str,
opts: Optional[ResourceOptions] = None,
keys: Optional[Sequence[_nosql.IndexKeyArgs]] = None,
table_name_or_id: Optional[str] = None,
compartment_id: Optional[str] = None,
is_if_not_exists: Optional[bool] = None,
name: Optional[str] = None)
func NewIndex(ctx *Context, name string, args IndexArgs, opts ...ResourceOption) (*Index, error)
public Index(string name, IndexArgs args, CustomResourceOptions? opts = null)
type: oci:Nosql:Index
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args IndexArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args IndexArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args IndexArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args IndexArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args IndexArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var indexResource = new Oci.Nosql.Index("indexResource", new()
{
Keys = new[]
{
new Oci.Nosql.Inputs.IndexKeyArgs
{
ColumnName = "string",
JsonFieldType = "string",
JsonPath = "string",
},
},
TableNameOrId = "string",
CompartmentId = "string",
IsIfNotExists = false,
Name = "string",
});
example, err := Nosql.NewIndex(ctx, "indexResource", &Nosql.IndexArgs{
Keys: nosql.IndexKeyArray{
&nosql.IndexKeyArgs{
ColumnName: pulumi.String("string"),
JsonFieldType: pulumi.String("string"),
JsonPath: pulumi.String("string"),
},
},
TableNameOrId: pulumi.String("string"),
CompartmentId: pulumi.String("string"),
IsIfNotExists: pulumi.Bool(false),
Name: pulumi.String("string"),
})
var indexResource = new Index("indexResource", IndexArgs.builder()
.keys(IndexKeyArgs.builder()
.columnName("string")
.jsonFieldType("string")
.jsonPath("string")
.build())
.tableNameOrId("string")
.compartmentId("string")
.isIfNotExists(false)
.name("string")
.build());
index_resource = oci.nosql.Index("indexResource",
keys=[oci.nosql.IndexKeyArgs(
column_name="string",
json_field_type="string",
json_path="string",
)],
table_name_or_id="string",
compartment_id="string",
is_if_not_exists=False,
name="string")
const indexResource = new oci.nosql.Index("indexResource", {
keys: [{
columnName: "string",
jsonFieldType: "string",
jsonPath: "string",
}],
tableNameOrId: "string",
compartmentId: "string",
isIfNotExists: false,
name: "string",
});
type: oci:Nosql:Index
properties:
compartmentId: string
isIfNotExists: false
keys:
- columnName: string
jsonFieldType: string
jsonPath: string
name: string
tableNameOrId: string
Index Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The Index resource accepts the following input properties:
- Keys
List<Index
Key> - A set of keys for a secondary index.
- Table
Name stringOr Id A table name within the compartment, or a table OCID.
** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values
- Compartment
Id string - The OCID of the table's compartment. Required if the tableNameOrId path parameter is a table name. Optional if tableNameOrId is an OCID. If tableNameOrId is an OCID, and compartmentId is supplied, the latter must match the identified table's compartmentId.
- Is
If boolNot Exists - If true, the operation completes successfully even when the index exists. Otherwise, an attempt to create an index that already exists will return an error.
- Name string
- Index name.
- Keys
[]Index
Key Args - A set of keys for a secondary index.
- Table
Name stringOr Id A table name within the compartment, or a table OCID.
** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values
- Compartment
Id string - The OCID of the table's compartment. Required if the tableNameOrId path parameter is a table name. Optional if tableNameOrId is an OCID. If tableNameOrId is an OCID, and compartmentId is supplied, the latter must match the identified table's compartmentId.
- Is
If boolNot Exists - If true, the operation completes successfully even when the index exists. Otherwise, an attempt to create an index that already exists will return an error.
- Name string
- Index name.
- keys
List<Index
Key> - A set of keys for a secondary index.
- table
Name StringOr Id A table name within the compartment, or a table OCID.
** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values
- compartment
Id String - The OCID of the table's compartment. Required if the tableNameOrId path parameter is a table name. Optional if tableNameOrId is an OCID. If tableNameOrId is an OCID, and compartmentId is supplied, the latter must match the identified table's compartmentId.
- is
If BooleanNot Exists - If true, the operation completes successfully even when the index exists. Otherwise, an attempt to create an index that already exists will return an error.
- name String
- Index name.
- keys
Index
Key[] - A set of keys for a secondary index.
- table
Name stringOr Id A table name within the compartment, or a table OCID.
** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values
- compartment
Id string - The OCID of the table's compartment. Required if the tableNameOrId path parameter is a table name. Optional if tableNameOrId is an OCID. If tableNameOrId is an OCID, and compartmentId is supplied, the latter must match the identified table's compartmentId.
- is
If booleanNot Exists - If true, the operation completes successfully even when the index exists. Otherwise, an attempt to create an index that already exists will return an error.
- name string
- Index name.
- keys
Sequence[nosql.
Index Key Args] - A set of keys for a secondary index.
- table_
name_ stror_ id A table name within the compartment, or a table OCID.
** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values
- compartment_
id str - The OCID of the table's compartment. Required if the tableNameOrId path parameter is a table name. Optional if tableNameOrId is an OCID. If tableNameOrId is an OCID, and compartmentId is supplied, the latter must match the identified table's compartmentId.
- is_
if_ boolnot_ exists - If true, the operation completes successfully even when the index exists. Otherwise, an attempt to create an index that already exists will return an error.
- name str
- Index name.
- keys List<Property Map>
- A set of keys for a secondary index.
- table
Name StringOr Id A table name within the compartment, or a table OCID.
** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values
- compartment
Id String - The OCID of the table's compartment. Required if the tableNameOrId path parameter is a table name. Optional if tableNameOrId is an OCID. If tableNameOrId is an OCID, and compartmentId is supplied, the latter must match the identified table's compartmentId.
- is
If BooleanNot Exists - If true, the operation completes successfully even when the index exists. Otherwise, an attempt to create an index that already exists will return an error.
- name String
- Index name.
Outputs
All input properties are implicitly available as output properties. Additionally, the Index resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Lifecycle
Details string - A message describing the current state in more detail.
- State string
- The state of an index.
- Table
Id string - the OCID of the table to which this index belongs.
- Table
Name string - The name of the table to which this index belongs.
- Id string
- The provider-assigned unique ID for this managed resource.
- Lifecycle
Details string - A message describing the current state in more detail.
- State string
- The state of an index.
- Table
Id string - the OCID of the table to which this index belongs.
- Table
Name string - The name of the table to which this index belongs.
- id String
- The provider-assigned unique ID for this managed resource.
- lifecycle
Details String - A message describing the current state in more detail.
- state String
- The state of an index.
- table
Id String - the OCID of the table to which this index belongs.
- table
Name String - The name of the table to which this index belongs.
- id string
- The provider-assigned unique ID for this managed resource.
- lifecycle
Details string - A message describing the current state in more detail.
- state string
- The state of an index.
- table
Id string - the OCID of the table to which this index belongs.
- table
Name string - The name of the table to which this index belongs.
- id str
- The provider-assigned unique ID for this managed resource.
- lifecycle_
details str - A message describing the current state in more detail.
- state str
- The state of an index.
- table_
id str - the OCID of the table to which this index belongs.
- table_
name str - The name of the table to which this index belongs.
- id String
- The provider-assigned unique ID for this managed resource.
- lifecycle
Details String - A message describing the current state in more detail.
- state String
- The state of an index.
- table
Id String - the OCID of the table to which this index belongs.
- table
Name String - The name of the table to which this index belongs.
Look up Existing Index Resource
Get an existing Index resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: IndexState, opts?: CustomResourceOptions): Index
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
compartment_id: Optional[str] = None,
is_if_not_exists: Optional[bool] = None,
keys: Optional[Sequence[_nosql.IndexKeyArgs]] = None,
lifecycle_details: Optional[str] = None,
name: Optional[str] = None,
state: Optional[str] = None,
table_id: Optional[str] = None,
table_name: Optional[str] = None,
table_name_or_id: Optional[str] = None) -> Index
func GetIndex(ctx *Context, name string, id IDInput, state *IndexState, opts ...ResourceOption) (*Index, error)
public static Index Get(string name, Input<string> id, IndexState? state, CustomResourceOptions? opts = null)
public static Index get(String name, Output<String> id, IndexState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Compartment
Id string - The OCID of the table's compartment. Required if the tableNameOrId path parameter is a table name. Optional if tableNameOrId is an OCID. If tableNameOrId is an OCID, and compartmentId is supplied, the latter must match the identified table's compartmentId.
- Is
If boolNot Exists - If true, the operation completes successfully even when the index exists. Otherwise, an attempt to create an index that already exists will return an error.
- Keys
List<Index
Key> - A set of keys for a secondary index.
- Lifecycle
Details string - A message describing the current state in more detail.
- Name string
- Index name.
- State string
- The state of an index.
- Table
Id string - the OCID of the table to which this index belongs.
- Table
Name string - The name of the table to which this index belongs.
- Table
Name stringOr Id A table name within the compartment, or a table OCID.
** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values
- Compartment
Id string - The OCID of the table's compartment. Required if the tableNameOrId path parameter is a table name. Optional if tableNameOrId is an OCID. If tableNameOrId is an OCID, and compartmentId is supplied, the latter must match the identified table's compartmentId.
- Is
If boolNot Exists - If true, the operation completes successfully even when the index exists. Otherwise, an attempt to create an index that already exists will return an error.
- Keys
[]Index
Key Args - A set of keys for a secondary index.
- Lifecycle
Details string - A message describing the current state in more detail.
- Name string
- Index name.
- State string
- The state of an index.
- Table
Id string - the OCID of the table to which this index belongs.
- Table
Name string - The name of the table to which this index belongs.
- Table
Name stringOr Id A table name within the compartment, or a table OCID.
** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values
- compartment
Id String - The OCID of the table's compartment. Required if the tableNameOrId path parameter is a table name. Optional if tableNameOrId is an OCID. If tableNameOrId is an OCID, and compartmentId is supplied, the latter must match the identified table's compartmentId.
- is
If BooleanNot Exists - If true, the operation completes successfully even when the index exists. Otherwise, an attempt to create an index that already exists will return an error.
- keys
List<Index
Key> - A set of keys for a secondary index.
- lifecycle
Details String - A message describing the current state in more detail.
- name String
- Index name.
- state String
- The state of an index.
- table
Id String - the OCID of the table to which this index belongs.
- table
Name String - The name of the table to which this index belongs.
- table
Name StringOr Id A table name within the compartment, or a table OCID.
** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values
- compartment
Id string - The OCID of the table's compartment. Required if the tableNameOrId path parameter is a table name. Optional if tableNameOrId is an OCID. If tableNameOrId is an OCID, and compartmentId is supplied, the latter must match the identified table's compartmentId.
- is
If booleanNot Exists - If true, the operation completes successfully even when the index exists. Otherwise, an attempt to create an index that already exists will return an error.
- keys
Index
Key[] - A set of keys for a secondary index.
- lifecycle
Details string - A message describing the current state in more detail.
- name string
- Index name.
- state string
- The state of an index.
- table
Id string - the OCID of the table to which this index belongs.
- table
Name string - The name of the table to which this index belongs.
- table
Name stringOr Id A table name within the compartment, or a table OCID.
** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values
- compartment_
id str - The OCID of the table's compartment. Required if the tableNameOrId path parameter is a table name. Optional if tableNameOrId is an OCID. If tableNameOrId is an OCID, and compartmentId is supplied, the latter must match the identified table's compartmentId.
- is_
if_ boolnot_ exists - If true, the operation completes successfully even when the index exists. Otherwise, an attempt to create an index that already exists will return an error.
- keys
Sequence[nosql.
Index Key Args] - A set of keys for a secondary index.
- lifecycle_
details str - A message describing the current state in more detail.
- name str
- Index name.
- state str
- The state of an index.
- table_
id str - the OCID of the table to which this index belongs.
- table_
name str - The name of the table to which this index belongs.
- table_
name_ stror_ id A table name within the compartment, or a table OCID.
** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values
- compartment
Id String - The OCID of the table's compartment. Required if the tableNameOrId path parameter is a table name. Optional if tableNameOrId is an OCID. If tableNameOrId is an OCID, and compartmentId is supplied, the latter must match the identified table's compartmentId.
- is
If BooleanNot Exists - If true, the operation completes successfully even when the index exists. Otherwise, an attempt to create an index that already exists will return an error.
- keys List<Property Map>
- A set of keys for a secondary index.
- lifecycle
Details String - A message describing the current state in more detail.
- name String
- Index name.
- state String
- The state of an index.
- table
Id String - the OCID of the table to which this index belongs.
- table
Name String - The name of the table to which this index belongs.
- table
Name StringOr Id A table name within the compartment, or a table OCID.
** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values
Supporting Types
IndexKey, IndexKeyArgs
- Column
Name string - The name of a column to be included as an index key.
- Json
Field stringType - If the specified column is of type JSON, jsonFieldType contains the type of the field indicated by jsonPath.
- Json
Path string - If the specified column is of type JSON, jsonPath contains a dotted path indicating the field within the JSON object that will be the index key.
- Column
Name string - The name of a column to be included as an index key.
- Json
Field stringType - If the specified column is of type JSON, jsonFieldType contains the type of the field indicated by jsonPath.
- Json
Path string - If the specified column is of type JSON, jsonPath contains a dotted path indicating the field within the JSON object that will be the index key.
- column
Name String - The name of a column to be included as an index key.
- json
Field StringType - If the specified column is of type JSON, jsonFieldType contains the type of the field indicated by jsonPath.
- json
Path String - If the specified column is of type JSON, jsonPath contains a dotted path indicating the field within the JSON object that will be the index key.
- column
Name string - The name of a column to be included as an index key.
- json
Field stringType - If the specified column is of type JSON, jsonFieldType contains the type of the field indicated by jsonPath.
- json
Path string - If the specified column is of type JSON, jsonPath contains a dotted path indicating the field within the JSON object that will be the index key.
- column_
name str - The name of a column to be included as an index key.
- json_
field_ strtype - If the specified column is of type JSON, jsonFieldType contains the type of the field indicated by jsonPath.
- json_
path str - If the specified column is of type JSON, jsonPath contains a dotted path indicating the field within the JSON object that will be the index key.
- column
Name String - The name of a column to be included as an index key.
- json
Field StringType - If the specified column is of type JSON, jsonFieldType contains the type of the field indicated by jsonPath.
- json
Path String - If the specified column is of type JSON, jsonPath contains a dotted path indicating the field within the JSON object that will be the index key.
Import
Indexes can be imported using the id
, e.g.
$ pulumi import oci:Nosql/index:Index test_index "tables/{tableNameOrId}/indexes/{indexName}"
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- oci pulumi/pulumi-oci
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
oci
Terraform Provider.