GoogleFirestoreIndex class final

Factory wrapper for google_firestore_index (provider hashicorp/google ~> 7.0).

Required identity:

  • localName: Terraform local name (the address segment after google_firestore_index.).
  • collection: collection group ID being indexed (e.g. 'messages'). Indexes are scoped to a collection group, not a specific collection path -- the same index covers every collection with this ID across the database.
  • fields: at least one IndexField. The Firestore service ALSO imposes a separate "must include __name__" rule on composite indexes that is not surfaced by Terraform-side validation -- the composite index variants below take care of it.

Example (composite index on messages, ordered by user then time):

final byUser = GoogleFirestoreIndex(
  localName: 'messages_by_user_time',
  collection: TfArg.literal('messages'),
  fields: [
    IndexField(
      fieldPath: TfArg.literal('user_id'),
      spec: const IndexFieldOrder(FirestoreIndexOrder.ascending),
    ),
    IndexField(
      fieldPath: TfArg.literal('created_at'),
      spec: const IndexFieldOrder(FirestoreIndexOrder.descending),
    ),
  ],
);

Example (array-contains index on tags):

final byTag = GoogleFirestoreIndex(
  localName: 'messages_by_tag',
  collection: TfArg.literal('messages'),
  fields: [
    IndexField(
      fieldPath: TfArg.literal('tags'),
      spec: const IndexFieldArrayConfig(),
    ),
  ],
);

Manages a Cloud Firestore composite or array-contains index. Single- field indexes are managed by Firestore automatically and have a different resource (google_firestore_field); only composite / array-contains indexes need an explicit GoogleFirestoreIndex.

Constructors

GoogleFirestoreIndex({required String localName, required TfArg<String> collection, required List<IndexField> fields, TfArg<String>? database, TfArg<FirestoreIndexQueryScope>? queryScope, TfArg<FirestoreIndexApiScope>? apiScope, TfArg<FirestoreIndexDensity>? density, TfArg<bool>? multikey, TfArg<bool>? unique, TfArg<FirestoreIndexDeletionPolicy>? deletionPolicy, TfArg<bool>? skipWait, TfArg<String>? project, LifecycleOptions? lifecycle, List<DependencyTarget>? dependsOn})

Properties

$sensitiveFields Set<String>
Field names that are @Sensitive per the IR-derived per-resource constant. Curated factories override with a baked-in static const Set<String> (file-private in v0.5+).
no setter
argMap Map<String, TfArg?>
Argument-name → TfArg map. Keys are snake_case (Terraform JSON name). Synth emits these keys directly; the factory is responsible for the camelCase → snake_case translation at construction time.
finalinherited
dependsOn List<DependencyTarget>?
Optional depends_on = [...]. Each entry is a DependencyTarget — either a wholesale resource (rendered as bare address) or an explicit TfRef (rendered via bareAddress).
finalinherited
hashCode int
The hash code for this object.
no setterinherited
id → TfRef<String>
Reference to id attribute. Same as nameRef for this resource -- indexes have no separate id distinct from their full path.
no setter
kind → ResourceKind
Always ResourceKind.resource. Overridden by Data.
no setterinherited
lifecycle → LifecycleOptions?
Optional lifecycle { ... } block.
finalinherited
localName String
User-supplied local name within a Stack.
finalinherited
nameRef → TfRef<String>
Reference to name attribute (server-assigned full path: projects/{p}/databases/{db}/collectionGroups/{collection}/indexes/{id}).
no setter
provider → ProviderBinding?
Optional explicit provider binding. Only the type is referenced here; the concrete Provider class lives in terradart_google (provider classes are defined per-provider, outside the core runtime).
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
terraformType String
Terraform resource type, e.g. google_pubsub_topic.
finalinherited
tfAddress String
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

$tfType → const String