Google Cloud Native is in preview. Google Cloud Classic is fully supported.
google-native.firestore/v1beta2.Index
Explore with Pulumi AI
Google Cloud Native is in preview. Google Cloud Classic is fully supported.
Creates a composite index. This returns a google.longrunning.Operation which may be used to track the status of the creation. The metadata for the operation will be the type IndexOperationMetadata. Auto-naming is currently not supported for this resource.
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,
collection_group_id: Optional[str] = None,
database_id: Optional[str] = None,
fields: Optional[Sequence[GoogleFirestoreAdminV1beta2IndexFieldArgs]] = None,
project: Optional[str] = None,
query_scope: Optional[IndexQueryScope] = None)
func NewIndex(ctx *Context, name string, args IndexArgs, opts ...ResourceOption) (*Index, error)
public Index(string name, IndexArgs args, CustomResourceOptions? opts = null)
type: google-native:firestore/v1beta2:Index
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name
This property is required. string - The unique name of the resource.
- args
This property is required. IndexArgs - The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name
This property is required. str - The unique name of the resource.
- args
This property is required. 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
This property is required. string - The unique name of the resource.
- args
This property is required. IndexArgs - The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name
This property is required. string - The unique name of the resource.
- args
This property is required. IndexArgs - The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name
This property is required. String - The unique name of the resource.
- args
This property is required. 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 exampleindexResourceResourceFromFirestorev1beta2 = new GoogleNative.Firestore.V1Beta2.Index("exampleindexResourceResourceFromFirestorev1beta2", new()
{
CollectionGroupId = "string",
DatabaseId = "string",
Fields = new[]
{
new GoogleNative.Firestore.V1Beta2.Inputs.GoogleFirestoreAdminV1beta2IndexFieldArgs
{
ArrayConfig = GoogleNative.Firestore.V1Beta2.GoogleFirestoreAdminV1beta2IndexFieldArrayConfig.ArrayConfigUnspecified,
FieldPath = "string",
Order = GoogleNative.Firestore.V1Beta2.GoogleFirestoreAdminV1beta2IndexFieldOrder.OrderUnspecified,
},
},
Project = "string",
QueryScope = GoogleNative.Firestore.V1Beta2.IndexQueryScope.QueryScopeUnspecified,
});
example, err := firestorev1beta2.NewIndex(ctx, "exampleindexResourceResourceFromFirestorev1beta2", &firestorev1beta2.IndexArgs{
CollectionGroupId: pulumi.String("string"),
DatabaseId: pulumi.String("string"),
Fields: firestore.GoogleFirestoreAdminV1beta2IndexFieldArray{
&firestore.GoogleFirestoreAdminV1beta2IndexFieldArgs{
ArrayConfig: firestorev1beta2.GoogleFirestoreAdminV1beta2IndexFieldArrayConfigArrayConfigUnspecified,
FieldPath: pulumi.String("string"),
Order: firestorev1beta2.GoogleFirestoreAdminV1beta2IndexFieldOrderOrderUnspecified,
},
},
Project: pulumi.String("string"),
QueryScope: firestorev1beta2.IndexQueryScopeQueryScopeUnspecified,
})
var exampleindexResourceResourceFromFirestorev1beta2 = new Index("exampleindexResourceResourceFromFirestorev1beta2", IndexArgs.builder()
.collectionGroupId("string")
.databaseId("string")
.fields(GoogleFirestoreAdminV1beta2IndexFieldArgs.builder()
.arrayConfig("ARRAY_CONFIG_UNSPECIFIED")
.fieldPath("string")
.order("ORDER_UNSPECIFIED")
.build())
.project("string")
.queryScope("QUERY_SCOPE_UNSPECIFIED")
.build());
exampleindex_resource_resource_from_firestorev1beta2 = google_native.firestore.v1beta2.Index("exampleindexResourceResourceFromFirestorev1beta2",
collection_group_id="string",
database_id="string",
fields=[{
"array_config": google_native.firestore.v1beta2.GoogleFirestoreAdminV1beta2IndexFieldArrayConfig.ARRAY_CONFIG_UNSPECIFIED,
"field_path": "string",
"order": google_native.firestore.v1beta2.GoogleFirestoreAdminV1beta2IndexFieldOrder.ORDER_UNSPECIFIED,
}],
project="string",
query_scope=google_native.firestore.v1beta2.IndexQueryScope.QUERY_SCOPE_UNSPECIFIED)
const exampleindexResourceResourceFromFirestorev1beta2 = new google_native.firestore.v1beta2.Index("exampleindexResourceResourceFromFirestorev1beta2", {
collectionGroupId: "string",
databaseId: "string",
fields: [{
arrayConfig: google_native.firestore.v1beta2.GoogleFirestoreAdminV1beta2IndexFieldArrayConfig.ArrayConfigUnspecified,
fieldPath: "string",
order: google_native.firestore.v1beta2.GoogleFirestoreAdminV1beta2IndexFieldOrder.OrderUnspecified,
}],
project: "string",
queryScope: google_native.firestore.v1beta2.IndexQueryScope.QueryScopeUnspecified,
});
type: google-native:firestore/v1beta2:Index
properties:
collectionGroupId: string
databaseId: string
fields:
- arrayConfig: ARRAY_CONFIG_UNSPECIFIED
fieldPath: string
order: ORDER_UNSPECIFIED
project: string
queryScope: QUERY_SCOPE_UNSPECIFIED
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
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The Index resource accepts the following input properties:
- Collection
Group Id This property is required. Changes to this property will trigger replacement.
- Database
Id This property is required. Changes to this property will trigger replacement.
- Fields
List<Pulumi.
Google Native. Firestore. V1Beta2. Inputs. Google Firestore Admin V1beta2Index Field> - The fields supported by this index. For composite indexes, this is always 2 or more fields. The last field entry is always for the field path
__name__
. If, on creation,__name__
was not specified as the last field, it will be added automatically with the same direction as that of the last field defined. If the final field in a composite index is not directional, the__name__
will be ordered ASCENDING (unless explicitly specified). For single field indexes, this will always be exactly one entry with a field path equal to the field path of the associated field. - Project
Changes to this property will trigger replacement.
- Query
Scope Pulumi.Google Native. Firestore. V1Beta2. Index Query Scope - Indexes with a collection query scope specified allow queries against a collection that is the child of a specific document, specified at query time, and that has the same collection id. Indexes with a collection group query scope specified allow queries against all collections descended from a specific document, specified at query time, and that have the same collection id as this index.
- Collection
Group Id This property is required. Changes to this property will trigger replacement.
- Database
Id This property is required. Changes to this property will trigger replacement.
- Fields
[]Google
Firestore Admin V1beta2Index Field Args - The fields supported by this index. For composite indexes, this is always 2 or more fields. The last field entry is always for the field path
__name__
. If, on creation,__name__
was not specified as the last field, it will be added automatically with the same direction as that of the last field defined. If the final field in a composite index is not directional, the__name__
will be ordered ASCENDING (unless explicitly specified). For single field indexes, this will always be exactly one entry with a field path equal to the field path of the associated field. - Project
Changes to this property will trigger replacement.
- Query
Scope IndexQuery Scope - Indexes with a collection query scope specified allow queries against a collection that is the child of a specific document, specified at query time, and that has the same collection id. Indexes with a collection group query scope specified allow queries against all collections descended from a specific document, specified at query time, and that have the same collection id as this index.
- collection
Group Id This property is required. Changes to this property will trigger replacement.
- database
Id This property is required. Changes to this property will trigger replacement.
- fields
List<Google
Firestore Admin V1beta2Index Field> - The fields supported by this index. For composite indexes, this is always 2 or more fields. The last field entry is always for the field path
__name__
. If, on creation,__name__
was not specified as the last field, it will be added automatically with the same direction as that of the last field defined. If the final field in a composite index is not directional, the__name__
will be ordered ASCENDING (unless explicitly specified). For single field indexes, this will always be exactly one entry with a field path equal to the field path of the associated field. - project
Changes to this property will trigger replacement.
- query
Scope IndexQuery Scope - Indexes with a collection query scope specified allow queries against a collection that is the child of a specific document, specified at query time, and that has the same collection id. Indexes with a collection group query scope specified allow queries against all collections descended from a specific document, specified at query time, and that have the same collection id as this index.
- collection
Group Id This property is required. Changes to this property will trigger replacement.
- database
Id This property is required. Changes to this property will trigger replacement.
- fields
Google
Firestore Admin V1beta2Index Field[] - The fields supported by this index. For composite indexes, this is always 2 or more fields. The last field entry is always for the field path
__name__
. If, on creation,__name__
was not specified as the last field, it will be added automatically with the same direction as that of the last field defined. If the final field in a composite index is not directional, the__name__
will be ordered ASCENDING (unless explicitly specified). For single field indexes, this will always be exactly one entry with a field path equal to the field path of the associated field. - project
Changes to this property will trigger replacement.
- query
Scope IndexQuery Scope - Indexes with a collection query scope specified allow queries against a collection that is the child of a specific document, specified at query time, and that has the same collection id. Indexes with a collection group query scope specified allow queries against all collections descended from a specific document, specified at query time, and that have the same collection id as this index.
- collection_
group_ id This property is required. Changes to this property will trigger replacement.
- database_
id This property is required. Changes to this property will trigger replacement.
- fields
Sequence[Google
Firestore Admin V1beta2Index Field Args] - The fields supported by this index. For composite indexes, this is always 2 or more fields. The last field entry is always for the field path
__name__
. If, on creation,__name__
was not specified as the last field, it will be added automatically with the same direction as that of the last field defined. If the final field in a composite index is not directional, the__name__
will be ordered ASCENDING (unless explicitly specified). For single field indexes, this will always be exactly one entry with a field path equal to the field path of the associated field. - project
Changes to this property will trigger replacement.
- query_
scope IndexQuery Scope - Indexes with a collection query scope specified allow queries against a collection that is the child of a specific document, specified at query time, and that has the same collection id. Indexes with a collection group query scope specified allow queries against all collections descended from a specific document, specified at query time, and that have the same collection id as this index.
- collection
Group Id This property is required. Changes to this property will trigger replacement.
- database
Id This property is required. Changes to this property will trigger replacement.
- fields List<Property Map>
- The fields supported by this index. For composite indexes, this is always 2 or more fields. The last field entry is always for the field path
__name__
. If, on creation,__name__
was not specified as the last field, it will be added automatically with the same direction as that of the last field defined. If the final field in a composite index is not directional, the__name__
will be ordered ASCENDING (unless explicitly specified). For single field indexes, this will always be exactly one entry with a field path equal to the field path of the associated field. - project
Changes to this property will trigger replacement.
- query
Scope "QUERY_SCOPE_UNSPECIFIED" | "COLLECTION" | "COLLECTION_GROUP" - Indexes with a collection query scope specified allow queries against a collection that is the child of a specific document, specified at query time, and that has the same collection id. Indexes with a collection group query scope specified allow queries against all collections descended from a specific document, specified at query time, and that have the same collection id as this index.
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.
- Name string
- A server defined name for this index. The form of this name for composite indexes will be:
projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{composite_index_id}
For single field indexes, this field will be empty. - State string
- The serving state of the index.
- Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- A server defined name for this index. The form of this name for composite indexes will be:
projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{composite_index_id}
For single field indexes, this field will be empty. - State string
- The serving state of the index.
- id String
- The provider-assigned unique ID for this managed resource.
- name String
- A server defined name for this index. The form of this name for composite indexes will be:
projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{composite_index_id}
For single field indexes, this field will be empty. - state String
- The serving state of the index.
- id string
- The provider-assigned unique ID for this managed resource.
- name string
- A server defined name for this index. The form of this name for composite indexes will be:
projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{composite_index_id}
For single field indexes, this field will be empty. - state string
- The serving state of the index.
- id str
- The provider-assigned unique ID for this managed resource.
- name str
- A server defined name for this index. The form of this name for composite indexes will be:
projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{composite_index_id}
For single field indexes, this field will be empty. - state str
- The serving state of the index.
- id String
- The provider-assigned unique ID for this managed resource.
- name String
- A server defined name for this index. The form of this name for composite indexes will be:
projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{composite_index_id}
For single field indexes, this field will be empty. - state String
- The serving state of the index.
Supporting Types
GoogleFirestoreAdminV1beta2IndexField, GoogleFirestoreAdminV1beta2IndexFieldArgs
- Array
Config Pulumi.Google Native. Firestore. V1Beta2. Google Firestore Admin V1beta2Index Field Array Config - Indicates that this field supports operations on
array_value
s. - Field
Path string - Can be name. For single field indexes, this must match the name of the field or may be omitted.
- Order
Pulumi.
Google Native. Firestore. V1Beta2. Google Firestore Admin V1beta2Index Field Order - Indicates that this field supports ordering by the specified order or comparing using =, <, <=, >, >=.
- Array
Config GoogleFirestore Admin V1beta2Index Field Array Config - Indicates that this field supports operations on
array_value
s. - Field
Path string - Can be name. For single field indexes, this must match the name of the field or may be omitted.
- Order
Google
Firestore Admin V1beta2Index Field Order - Indicates that this field supports ordering by the specified order or comparing using =, <, <=, >, >=.
- array
Config GoogleFirestore Admin V1beta2Index Field Array Config - Indicates that this field supports operations on
array_value
s. - field
Path String - Can be name. For single field indexes, this must match the name of the field or may be omitted.
- order
Google
Firestore Admin V1beta2Index Field Order - Indicates that this field supports ordering by the specified order or comparing using =, <, <=, >, >=.
- array
Config GoogleFirestore Admin V1beta2Index Field Array Config - Indicates that this field supports operations on
array_value
s. - field
Path string - Can be name. For single field indexes, this must match the name of the field or may be omitted.
- order
Google
Firestore Admin V1beta2Index Field Order - Indicates that this field supports ordering by the specified order or comparing using =, <, <=, >, >=.
- array_
config GoogleFirestore Admin V1beta2Index Field Array Config - Indicates that this field supports operations on
array_value
s. - field_
path str - Can be name. For single field indexes, this must match the name of the field or may be omitted.
- order
Google
Firestore Admin V1beta2Index Field Order - Indicates that this field supports ordering by the specified order or comparing using =, <, <=, >, >=.
- array
Config "ARRAY_CONFIG_UNSPECIFIED" | "CONTAINS" - Indicates that this field supports operations on
array_value
s. - field
Path String - Can be name. For single field indexes, this must match the name of the field or may be omitted.
- order "ORDER_UNSPECIFIED" | "ASCENDING" | "DESCENDING"
- Indicates that this field supports ordering by the specified order or comparing using =, <, <=, >, >=.
GoogleFirestoreAdminV1beta2IndexFieldArrayConfig, GoogleFirestoreAdminV1beta2IndexFieldArrayConfigArgs
- Array
Config Unspecified - ARRAY_CONFIG_UNSPECIFIEDThe index does not support additional array queries.
- Contains
- CONTAINSThe index supports array containment queries.
- Google
Firestore Admin V1beta2Index Field Array Config Array Config Unspecified - ARRAY_CONFIG_UNSPECIFIEDThe index does not support additional array queries.
- Google
Firestore Admin V1beta2Index Field Array Config Contains - CONTAINSThe index supports array containment queries.
- Array
Config Unspecified - ARRAY_CONFIG_UNSPECIFIEDThe index does not support additional array queries.
- Contains
- CONTAINSThe index supports array containment queries.
- Array
Config Unspecified - ARRAY_CONFIG_UNSPECIFIEDThe index does not support additional array queries.
- Contains
- CONTAINSThe index supports array containment queries.
- ARRAY_CONFIG_UNSPECIFIED
- ARRAY_CONFIG_UNSPECIFIEDThe index does not support additional array queries.
- CONTAINS
- CONTAINSThe index supports array containment queries.
- "ARRAY_CONFIG_UNSPECIFIED"
- ARRAY_CONFIG_UNSPECIFIEDThe index does not support additional array queries.
- "CONTAINS"
- CONTAINSThe index supports array containment queries.
GoogleFirestoreAdminV1beta2IndexFieldOrder, GoogleFirestoreAdminV1beta2IndexFieldOrderArgs
- Order
Unspecified - ORDER_UNSPECIFIEDThe ordering is unspecified. Not a valid option.
- Ascending
- ASCENDINGThe field is ordered by ascending field value.
- Descending
- DESCENDINGThe field is ordered by descending field value.
- Google
Firestore Admin V1beta2Index Field Order Order Unspecified - ORDER_UNSPECIFIEDThe ordering is unspecified. Not a valid option.
- Google
Firestore Admin V1beta2Index Field Order Ascending - ASCENDINGThe field is ordered by ascending field value.
- Google
Firestore Admin V1beta2Index Field Order Descending - DESCENDINGThe field is ordered by descending field value.
- Order
Unspecified - ORDER_UNSPECIFIEDThe ordering is unspecified. Not a valid option.
- Ascending
- ASCENDINGThe field is ordered by ascending field value.
- Descending
- DESCENDINGThe field is ordered by descending field value.
- Order
Unspecified - ORDER_UNSPECIFIEDThe ordering is unspecified. Not a valid option.
- Ascending
- ASCENDINGThe field is ordered by ascending field value.
- Descending
- DESCENDINGThe field is ordered by descending field value.
- ORDER_UNSPECIFIED
- ORDER_UNSPECIFIEDThe ordering is unspecified. Not a valid option.
- ASCENDING
- ASCENDINGThe field is ordered by ascending field value.
- DESCENDING
- DESCENDINGThe field is ordered by descending field value.
- "ORDER_UNSPECIFIED"
- ORDER_UNSPECIFIEDThe ordering is unspecified. Not a valid option.
- "ASCENDING"
- ASCENDINGThe field is ordered by ascending field value.
- "DESCENDING"
- DESCENDINGThe field is ordered by descending field value.
GoogleFirestoreAdminV1beta2IndexFieldResponse, GoogleFirestoreAdminV1beta2IndexFieldResponseArgs
- Array
Config This property is required. string - Indicates that this field supports operations on
array_value
s. - Field
Path This property is required. string - Can be name. For single field indexes, this must match the name of the field or may be omitted.
- Order
This property is required. string - Indicates that this field supports ordering by the specified order or comparing using =, <, <=, >, >=.
- Array
Config This property is required. string - Indicates that this field supports operations on
array_value
s. - Field
Path This property is required. string - Can be name. For single field indexes, this must match the name of the field or may be omitted.
- Order
This property is required. string - Indicates that this field supports ordering by the specified order or comparing using =, <, <=, >, >=.
- array
Config This property is required. String - Indicates that this field supports operations on
array_value
s. - field
Path This property is required. String - Can be name. For single field indexes, this must match the name of the field or may be omitted.
- order
This property is required. String - Indicates that this field supports ordering by the specified order or comparing using =, <, <=, >, >=.
- array
Config This property is required. string - Indicates that this field supports operations on
array_value
s. - field
Path This property is required. string - Can be name. For single field indexes, this must match the name of the field or may be omitted.
- order
This property is required. string - Indicates that this field supports ordering by the specified order or comparing using =, <, <=, >, >=.
- array_
config This property is required. str - Indicates that this field supports operations on
array_value
s. - field_
path This property is required. str - Can be name. For single field indexes, this must match the name of the field or may be omitted.
- order
This property is required. str - Indicates that this field supports ordering by the specified order or comparing using =, <, <=, >, >=.
- array
Config This property is required. String - Indicates that this field supports operations on
array_value
s. - field
Path This property is required. String - Can be name. For single field indexes, this must match the name of the field or may be omitted.
- order
This property is required. String - Indicates that this field supports ordering by the specified order or comparing using =, <, <=, >, >=.
IndexQueryScope, IndexQueryScopeArgs
- Query
Scope Unspecified - QUERY_SCOPE_UNSPECIFIEDThe query scope is unspecified. Not a valid option.
- Collection
- COLLECTIONIndexes with a collection query scope specified allow queries against a collection that is the child of a specific document, specified at query time, and that has the collection id specified by the index.
- Collection
Group - COLLECTION_GROUPIndexes with a collection group query scope specified allow queries against all collections that has the collection id specified by the index.
- Index
Query Scope Query Scope Unspecified - QUERY_SCOPE_UNSPECIFIEDThe query scope is unspecified. Not a valid option.
- Index
Query Scope Collection - COLLECTIONIndexes with a collection query scope specified allow queries against a collection that is the child of a specific document, specified at query time, and that has the collection id specified by the index.
- Index
Query Scope Collection Group - COLLECTION_GROUPIndexes with a collection group query scope specified allow queries against all collections that has the collection id specified by the index.
- Query
Scope Unspecified - QUERY_SCOPE_UNSPECIFIEDThe query scope is unspecified. Not a valid option.
- Collection
- COLLECTIONIndexes with a collection query scope specified allow queries against a collection that is the child of a specific document, specified at query time, and that has the collection id specified by the index.
- Collection
Group - COLLECTION_GROUPIndexes with a collection group query scope specified allow queries against all collections that has the collection id specified by the index.
- Query
Scope Unspecified - QUERY_SCOPE_UNSPECIFIEDThe query scope is unspecified. Not a valid option.
- Collection
- COLLECTIONIndexes with a collection query scope specified allow queries against a collection that is the child of a specific document, specified at query time, and that has the collection id specified by the index.
- Collection
Group - COLLECTION_GROUPIndexes with a collection group query scope specified allow queries against all collections that has the collection id specified by the index.
- QUERY_SCOPE_UNSPECIFIED
- QUERY_SCOPE_UNSPECIFIEDThe query scope is unspecified. Not a valid option.
- COLLECTION
- COLLECTIONIndexes with a collection query scope specified allow queries against a collection that is the child of a specific document, specified at query time, and that has the collection id specified by the index.
- COLLECTION_GROUP
- COLLECTION_GROUPIndexes with a collection group query scope specified allow queries against all collections that has the collection id specified by the index.
- "QUERY_SCOPE_UNSPECIFIED"
- QUERY_SCOPE_UNSPECIFIEDThe query scope is unspecified. Not a valid option.
- "COLLECTION"
- COLLECTIONIndexes with a collection query scope specified allow queries against a collection that is the child of a specific document, specified at query time, and that has the collection id specified by the index.
- "COLLECTION_GROUP"
- COLLECTION_GROUPIndexes with a collection group query scope specified allow queries against all collections that has the collection id specified by the index.
Package Details
- Repository
- Google Cloud Native pulumi/pulumi-google-native
- License
- Apache-2.0
Google Cloud Native is in preview. Google Cloud Classic is fully supported.