cloud-foundation-fabric/modules/firestore
Jay Bana 2a2c4a96ce
Add support for sqlAssertion AutoDQ rule type in dataplex-datascan (#2416)
* Add sql_assertion rule type to Dataplex AutoDQ data_quality_spec

* Fix broken link to API reference public doc for DQ spec

* Update README.md after linting

* Add example tests for dataplex-datascan

* Bump provider versions

* Bump provider versions everywhere
2024-07-09 21:29:45 +00:00
..
README.md
main.tf
outputs.tf
variables.tf Several wording and typos updates 2024-06-27 07:36:19 +02:00
versions.tf Add support for sqlAssertion AutoDQ rule type in dataplex-datascan (#2416) 2024-07-09 21:29:45 +00:00

README.md

Firestore

This module allows to crete a firestore datatabase, fields, indexes and documents.

Examples

New database

module "firestore" {
  source     = "./fabric/modules/firestore"
  project_id = "my-project"
  database = {
    name        = "my-database"
    location_id = "nam5"
    type        = "FIRESTORE_NATIVE"
  }
}
# tftest modules=1 resources=1 inventory=new-database.yaml

New database with weekly backup

module "firestore" {
  source     = "./fabric/modules/firestore"
  project_id = "my-project"
  database = {
    name        = "my-database"
    location_id = "nam5"
    type        = "FIRESTORE_NATIVE"
  }
  backup_schedule = {
    retention         = "86400s"
    weekly_recurrence = "MONDAY"
  }
}
# tftest modules=1 resources=2 inventory=new-database-with-weekly-backup.yaml

New database with document

module "firestore" {
  source     = "./fabric/modules/firestore"
  project_id = "my-project"
  database = {
    name        = "my-database"
    location_id = "nam5"
    type        = "FIRESTORE_NATIVE"
  }
  documents = {
    my-doc-1 = {
      collection  = "my-coll"
      document_id = "d3db1c14-e56d-4597-af1c-f95c2d2290c1"
      fields = {
        field1 = "value1"
        field2 = "value2"
      }
    }
  }
}
# tftest modules=1 resources=2 inventory=new-database-with-document.yaml

Existing database with document

module "firestore" {
  source     = "./fabric/modules/firestore"
  project_id = "my-project"
  database = {
    name = "my-database"
  }
  database_create = false
  documents = {
    my-doc-1 = {
      collection  = "my-coll"
      document_id = "d3db1c14-e56d-4597-af1c-f95c2d2290c1"
      fields = {
        field1 = "value1"
        field2 = "value2"
      }
    }
  }
}
# tftest modules=1 resources=1 inventory=existing-database-with-document.yaml

New database with field

module "firestore" {
  source     = "./fabric/modules/firestore"
  project_id = "my-project"
  database = {
    name        = "my-database"
    location_id = "name5"
    type        = "FIRESTORE_NATIVE"
  }
  fields = {
    my-field-in-my-coll = {
      collection = "my-coll"
      field      = "my-field"
      indexes = [
        {
          order       = "ASCENDING"
          query_scope = "COLLECTION_GROUP"
        },
        {
          array_config = "CONTAINS"
        }
      ]
    }
  }
}
# tftest modules=1 resources=2 inventory=new-database-with-field.yaml

New database with index

module "firestore" {
  source     = "./fabric/modules/firestore"
  project_id = "my-project"
  database = {
    name        = "my-database"
    location_id = "name5"
    type        = "FIRESTORE_NATIVE"
  }
  indexes = {
    my-index = {
      collection = "my-coll"
      fields = [
        {
          field_path = "name"
          order      = "ASCENDING"
        },
        {
          field_path = "description"
          order      = "DESCENDING"
        }
      ]
    }
  }
}
# tftest modules=1 resources=2 inventory=new-database-with-index.yaml

Variables

name description type required default
database Database attributes. object({…})
project_id Project id. string
backup_schedule Backup schedule. object({…}) null
database_create Flag indicating whether the database should be created of not. string "true"
documents Documents. map(object({…})) {}
fields Fields. map(object({…})) {}
indexes Indexes. map(object({…})) {}

Outputs

name description sensitive
firestore_database Firestore database.
firestore_document_ids Firestore document ids.
firestore_documents Firestore documents.
firestore_field_ids Firestore field ids.
firestore_fields Firestore fields.
firestore_index_ids Firestore index ids.
firestore_indexes Firestore indexes.