bigquery library

BigQuery datasets, tables, jobs, routines, transfers, reservations, capacity commitments, external connections, and per-resource IAM bindings.

Classes

Access
Discriminated-union base for one access block entry.
AccessCondition
access.condition — CEL binding restricting when an access entry applies. expression is the CEL source; the other three fields are metadata for debugging / UI surfaces.
AccessDataset
access entry referring to a dataset (transitive read for resource types listed in targetTypes).
AccessDomain
access entry granting role to all members of domain.
AccessGroupByEmail
access entry granting role to groupByEmail.
AccessIamMember
access entry granting role to an arbitrary IAM principal (e.g. allUsers, service identities) via iamMember.
AccessRoutine
access entry referring to a BigQuery routine. Role is not required.
AccessSpecialGroup
access entry granting role to specialGroup. Documented values include projectOwners, projectReaders, projectWriters, allAuthenticatedUsers (BigQuery treats these as case-sensitive).
AccessUserByEmail
access entry granting role to userByEmail.
AccessView
access entry referring to a BigQuery view. Granting view access lets queries against the view read tables in this dataset. Role is not required for view bindings.
AvroOptions
external_data_configuration.avro_options sub-block. useAvroLogicalTypes is required by the provider schema.
BiglakeConfiguration
biglake_configuration block (max=1). Promotes the table to a BigLake managed table — BigQuery stores metadata-only snapshots while the actual data lives at storageUri in fileFormat + tableFormat (typically Parquet + Iceberg).
BigqueryConnectionAws
aws block — BigQuery Omni federation into AWS (S3 / Glue, BigLake- on-AWS). The BigQuery location must be aws-us-east-1.
BigqueryConnectionAwsAccessRole
aws.access_role block — IAM role the Google-owned AWS identity assumes when reading from S3 / Glue on behalf of BigQuery.
BigqueryConnectionAzure
azure block — BigQuery Omni federation into Azure Data Lake Storage. The BigQuery location must be azure-eastus2. Most fields are computed and consumed by the Azure side of the federation bridge; only customerTenantId is required input.
BigqueryConnectionCloudResource
cloud_resource block — generic delegation for cross-project reads (BigLake tables over Cloud Storage in a different project, etc.). The block is empty on input; after apply, cloud_resource.service_account_id surfaces the connection's Google-managed service account, which the consuming project must grant access to.
BigqueryConnectionCloudSpanner
cloud_spanner block — federated reads against a Cloud Spanner database. The connection's BigQuery region must match the Spanner region.
BigqueryConnectionCloudSql
cloud_sql block — federated queries against a Cloud SQL Postgres or MySQL instance.
BigqueryConnectionCloudSqlCredential
cloud_sql.credential block — username / password the BigQuery federation layer presents to the Cloud SQL instance. The password is schema-flagged sensitive: true and is masked on synth.
BigqueryConnectionConfiguration
configuration block — BigQuery Connector framework. Picks an upstream engine via connectorId (google-alloydb, google-cloudsql-mysql, google-cloudsql-postgres, and other ids supported by the framework) and wires it through asset / authentication / endpoint / network blocks.
BigqueryConnectionConfigurationAsset
configuration.asset block — points the connector at a Google Cloud resource (AlloyDB cluster / instance, etc.).
BigqueryConnectionConfigurationAuthentication
configuration.authentication block — authentication configuration for the connector. Output-only service_account is consumed via the generated factory state, not a constructor input.
BigqueryConnectionConfigurationAuthenticationPassword
configuration.authentication.username_password.password block — holds the plaintext password the connector forwards to the upstream engine. plaintext is schema-flagged sensitive and masked on synth.
BigqueryConnectionConfigurationAuthenticationUsernamePassword
configuration.authentication.username_password block — username / password authentication for the connector framework.
BigqueryConnectionConfigurationEndpoint
configuration.endpoint block — host:port override for the connector's upstream endpoint (when the default endpoint derived from BigqueryConnectionConfigurationAsset is not appropriate).
BigqueryConnectionConfigurationNetwork
configuration.network block — network configuration for the connector. The schema only exposes private_service_connect today.
BigqueryConnectionConfigurationNetworkPrivateServiceConnect
configuration.network.private_service_connect block — Private Service Connect network attachment for connector traffic.
BigqueryConnectionSpark
spark block — stored procedures for Apache Spark on BigQuery. The block is empty-by-default on input; provide nested metastoreServiceConfig / sparkHistoryServerConfig only when the procedures need to read Hive tables or surface history-server logs.
BigqueryConnectionSparkMetastoreServiceConfig
spark.metastore_service_config block — optional binding to a Dataproc Metastore service so Spark stored procedures see Hive tables.
BigqueryConnectionSparkSparkHistoryServerConfig
spark.spark_history_server_config block — optional binding to a Dataproc Cluster acting as Spark History Server for the connection.
BigqueryDataTransferConfigEmailPreferences
email_preferences block (max=1) — controls failure-email delivery to the user who owns the transfer config. The owner is the identity that created the resource (or the service account in GoogleBigqueryDataTransferConfig.serviceAccountName when set).
BigqueryDataTransferConfigEncryptionConfiguration
encryption_configuration block (max=1) — CMEK key used to encrypt data written by this transfer config to the destination dataset. When unset, the dataset's default_encryption_configuration.kms_key_name (if any) applies; if neither is set, Google-managed encryption is used.
BigqueryDataTransferConfigScheduleOptions
schedule_options block (max=1) — fine-grained overrides for the cron schedule defined on the parent GoogleBigqueryDataTransferConfig.schedule slot.
BigqueryDataTransferConfigSensitiveParams
sensitive_params block (max=1) — credential slot for the amazon_s3 data source (and any future DTS connector that needs out-of-band secrets). The block is named "sensitive_params" because the keys it carries logically belong to the parent GoogleBigqueryDataTransferConfig.params map; placing them here instead lets the provider flag them sensitive (so they are masked in plan output) and prevents accidental disclosure via state inspection.
BigqueryJobCopy
copy job-type block. Copies one or more sourceTables into a single destinationTable. Schema requires min_items=1 on source_tables. Shares createDisposition / writeDisposition semantics with the other job types.
BigqueryJobDefaultDataset
query.default_dataset{project_id, dataset_id} pair used as the default dataset for unqualified table references in the SQL text. datasetId is required.
BigqueryJobDestinationTable
Generic {project_id, dataset_id, table_id} reference. Used by query.destination_table, load.destination_table, extract.source_table, copy.destination_table, and each entry in copy.source_tables. tableId is required; projectId and datasetId are optional (the provider defaults them from the surrounding project context).
BigqueryJobEncryptionConfiguration
query.destination_encryption_configuration / load.destination_encryption_configuration / copy.destination_encryption_configuration — CMEK key applied to the destination table. kmsKeyVersion is computed (returned by the API after the job runs); only kmsKeyName is settable here.
BigqueryJobExtract
extract job-type block. Exports either a table (sourceTable) or an ML model (sourceModel) to one or more Cloud Storage destinations (destinationUris, required). Provide exactly one of sourceTable / sourceModel.
BigqueryJobLoad
load job-type block. Required fields: sourceUris (GCS source pattern) and destinationTable (the schema marks the inner table_id required, and the block itself is min_items=1).
BigqueryJobParquetOptions
load.parquet_options (max_items=1) — Parquet-specific load behavior.
BigqueryJobQuery
query job-type block. Required field: query (the SQL text). All other fields are optional. When destinationTable is set, the query result is materialized to that table according to createDisposition / writeDisposition.
BigqueryJobQueryConnectionProperty
One entry under query.connection_properties(key, value) pair (e.g. ("time_zone", "America/Los_Angeles")).
BigqueryJobScriptOptions
query.script_options (max_items=1) — multi-statement script execution behavior.
BigqueryJobSourceModel
extract.source_model — fully qualified BigQuery ML model reference. All three fields are required by the schema.
BigqueryJobTimePartitioning
load.time_partitioning (max_items=1) — applies partitioning to the destination table on first create. Required: type (only DAY is documented as supported by BigQuery today). field names the column to partition on; omit for ingestion-time partitioning.
BigqueryJobUserDefinedFunctionResource
One entry under query.user_defined_function_resources. Provide either resourceUri (GCS URI to a .js file) or inlineCode — not both.
BigqueryReservationAutoscale
autoscale block — enables pay-as-you-go slot scaling on top of the slotCapacity floor. maxSlots caps the dynamic upper bound; the API reports the live current_slots value back through the autoscale.current_slots computed attribute (not surfaced here — read via the underlying state if needed).
BigqueryRoutineArgument
One entry of the arguments block (repeatable list). dataType is a JSON-encoded BigQuery type string; omit it only when argumentKind = BigqueryRoutineArgumentKind.anyType. mode is procedure-only; leave it null for scalar / TVF functions.
BigqueryRoutineRemoteFunctionOptions
remote_function_options block (max=1). Required when BigqueryRoutineType.scalarFunction is backed by a remote service (Cloud Functions / Cloud Run). endpoint points at the HTTPS URL of the function; connection is the fully-qualified BigQuery connection (projects/{p}/locations/{l}/connections/{c}) holding the credential.
BigqueryRoutineSparkOptions
spark_options block (max=1). Required when language is PYTHON, JAVA, or SCALA. connection points at a BigQuery Spark connection. The remaining fields configure the Spark application — exactly one of mainClass / mainFileUri must be set for Java / Scala; PySpark uses mainFileUri or definitionBody.
ColumnReferences
Inner column_references block of a foreign key constraint — pairs one referencing column with the referenced primary-key column.
CsvOptions
external_data_configuration.csv_options sub-block. quote is required by the provider (Terraform escapes the API default " as \"; pass an empty string when the data has no quoted sections).
DatasetAccessChild
access.dataset sub-block — pairs a dataset reference with the targetTypes this binding applies to (currently only VIEWS).
DatasetReference
access.dataset.dataset and access.routine projectId+datasetId pair.
DatasetRoutineRef
access.routine sub-block — fully qualified BigQuery routine reference.
DatasetView
access.view sub-block — fully qualified BigQuery view reference.
DefaultEncryptionConfiguration
default_encryption_configuration block — CMEK key for tables that do not specify their own encryption.
EncryptionConfiguration
encryption_configuration block (max=1). Attaches a CMEK key to the table; the default BigQuery service account needs encrypt/decrypt rights on kmsKeyName. kmsKeyVersion is computed by GCP and surfaced via the wrapper's kmsKeyVersionRef getter (not here).
ExternalCatalogDatasetOptions
external_catalog_dataset_options block — open-source catalog metadata for datasets bridged from Iceberg / Hive Metastore-compatible sources.
ExternalDataConfiguration
external_data_configuration block (max=1). Configures a federated external table — BigQuery reads data in-place from the source store (GCS / Bigtable / Drive / S3 via connection) at query time rather than ingesting it.
ExternalDatasetReference
external_dataset_reference block — points the dataset at an externally-managed source (e.g. AWS Glue) via connection.
ForeignKey
One entry of table_constraints.foreign_keys. Each entry binds one referencing column to one referenced column in referencedTable; composite foreign keys are represented by multiple entries with the same referencedTable.
GoogleBigqueryCapacityCommitment
Factory wrapper for google_bigquery_capacity_commitment (provider hashicorp/google ~> 7.0).
GoogleBigqueryConnection
Factory wrapper for google_bigquery_connection (provider hashicorp/google ~> 7.0).
GoogleBigqueryDataset
Factory wrapper for google_bigquery_dataset (provider hashicorp/google ~> 7.0).
GoogleBigqueryDatasetIamMember
Factory wrapper for google_bigquery_dataset_iam_member.
GoogleBigqueryDataTransferConfig
Factory wrapper for google_bigquery_data_transfer_config (provider hashicorp/google ~> 7.0).
GoogleBigqueryJob
Factory wrapper for google_bigquery_job (provider hashicorp/google ~> 7.0).
GoogleBigqueryReservation
Factory wrapper for google_bigquery_reservation (provider hashicorp/google ~> 7.0).
GoogleBigqueryRoutine
Factory wrapper for google_bigquery_routine (provider hashicorp/google ~> 7.0).
GoogleBigqueryTable
Factory wrapper for google_bigquery_table (provider hashicorp/google ~> 7.0).
GoogleBigqueryTableIamMember
Factory wrapper for google_bigquery_table_iam_member.
GoogleSheetsOptions
external_data_configuration.google_sheets_options sub-block. At least one of range / skipLeadingRows must be set per the provider schema; the wrapper does not enforce that.
HivePartitioningOptions
external_data_configuration.hive_partitioning_options sub-block. Enables Hive-style partition keys (e.g. dt=2024-01-01/) to be surfaced as table columns.
JsonOptions
external_data_configuration.json_options sub-block.
MaterializedView
materialized_view block (max=1). query is required and frozen at create time (changing it forces replacement). The other knobs control refresh behaviour.
ParquetOptions
external_data_configuration.parquet_options sub-block.
PrimaryKey
table_constraints.primary_key sub-block (max=1).
RangePartitioning
range_partitioning block (max=1). field is the int64 column being partitioned on; the inner RangePartitioningRange defines the [start, end) window and bucket width.
RangePartitioningRange
Inner range block of range_partitioning. Half-open: start is inclusive, end is exclusive. interval is the bucket width.
ReferencedTable
Inner referenced_table block of a foreign key constraint — fully-qualified BigQuery table reference.
TableConstraints
table_constraints block (max=1). BigQuery accepts these for metadata / query-planning hints; constraints are NOT enforced at write time.
TableReplicationInfo
table_replication_info block (max=1). Marks the table as a replica of a source materialized view in another dataset (CREATE MATERIALIZED VIEW ... AS REPLICA OF ...).
TableView
view block (max=1). When set, the table is a logical view backed by query instead of physical storage. useLegacySql defaults to false (standard SQL) at the provider; pass true only for legacy SQL views.
TimePartitioning
time_partitioning block (max=1). type is required; the other fields refine the partition spec. requirePartitionFilter is deprecated by BigQuery in favour of the top-level requirePartitionFilter, but retained here for parity with the provider schema.

Enums

BigqueryCapacityCommitmentEdition
BigQuery edition for google_bigquery_capacity_commitment.edition. Determines feature set and per-slot pricing. Documented values: STANDARD, ENTERPRISE, ENTERPRISE_PLUS. Distinct Dart type from BigqueryReservationEdition even though both wrap the same GCP enum — keeping resource-scoped naming avoids cross-resource coupling.
BigqueryCapacityCommitmentPlan
Commitment plan for google_bigquery_capacity_commitment.plan. Pinned to the values documented by the BigQuery Reservations API (CommitmentPlan): FLEX, TRIAL, MONTHLY, ANNUAL, THREE_YEAR. Schema does not enumerate explicitly — see the field description for the authoritative link.
BigqueryCapacityCommitmentRenewalPlan
Renewal plan applied when the current commitment term ends. Documented values: NONE (no renewal — commitment lapses), FLEX, MONTHLY, ANNUAL, THREE_YEAR. (TRIAL is a commitment-creation-only plan and is not a valid renewal target.)
BigqueryConnectionCloudSqlType
cloud_sql.type — Cloud SQL database engine. The schema includes DATABASE_TYPE_UNSPECIFIED as a sentinel; do not pick it for new connections. SQL_SERVER is not exposed by the GA provider schema as of this curation.
BigqueryJobCreateDisposition
create_disposition — shared across query, load, and copy job types. Default value: CREATE_IF_NEEDED. Possible values: ["CREATE_IF_NEEDED", "CREATE_NEVER"].
BigqueryJobExtractCompression
extract.compression. Schema description: "Possible values include GZIP, DEFLATE, SNAPPY, and NONE. The default value is NONE. DEFLATE and SNAPPY are only supported for Avro." The schema doesn't expose a formal enum_values array — values transcribed from the description prose.
BigqueryJobExtractDestinationFormat
extract.destination_format. Schema description: "Possible values include CSV, NEWLINE_DELIMITED_JSON and AVRO for tables and SAVED_MODEL for models. The default value for tables is CSV. Tables with nested or repeated fields cannot be exported as CSV. The default value for models is SAVED_MODEL." Values transcribed from the description prose (no formal enum_values array on this attribute).
BigqueryJobLoadSourceFormat
load.source_format. From the schema description: for CSV specify CSV; for datastore backups DATASTORE_BACKUP; for newline-delimited JSON NEWLINE_DELIMITED_JSON; for Avro AVRO; for Parquet PARQUET; for ORC ORC; Beta for Bigtable BIGTABLE. Default is CSV. The schema doesn't expose a formal enum_values array, so this list is sourced from the attribute's description prose.
BigqueryJobParameterMode
query.parameter_mode. Standard SQL only. POSITIONAL uses ? placeholders; NAMED uses @param syntax. The provider description does not expose a formal Possible values array; the BigQuery API documents these two as the supported modes.
BigqueryJobQueryPriority
query.priority. Default value: INTERACTIVE. Possible values: ["INTERACTIVE", "BATCH"].
BigqueryJobScriptKeyResultStatement
query.script_options.key_result_statement. Possible values: ["LAST", "FIRST_SELECT"]. Determines which statement in the script populates the schema and query results of the script job.
BigqueryJobWriteDisposition
write_disposition — shared across query, load, and copy job types. Default value: WRITE_EMPTY. Possible values: ["WRITE_TRUNCATE", "WRITE_APPEND", "WRITE_EMPTY"].
BigqueryReservationEdition
BigQuery reservation edition for google_bigquery_reservation.edition. Determines feature set and billing tier. Documented values (per the field description): STANDARD, ENTERPRISE, ENTERPRISE_PLUS. The provider schema does not enumerate values explicitly; new editions ship as the BigQuery product evolves. Distinct from BigqueryCapacityCommitmentEdition by design (the two resources reference the same GCP enum but are kept separate at the Dart type level to preserve resource-scoped naming).
BigqueryRoutineArgumentKind
Argument kind for arguments.argument_kind. FIXED_TYPE (the default) requires dataType to be set; ANY_TYPE lets BigQuery infer the type at call site.
BigqueryRoutineArgumentMode
Argument direction for arguments.mode. Procedures use this to mark each argument as input (IN), output (OUT), or bidirectional (INOUT); functions leave it null.
BigqueryRoutineDataGovernanceType
Data governance type for data_governance_type. The provider only accepts DATA_MASKING today — set this to register the routine as a custom masking function consumable by BigQuery column-level policies.
BigqueryRoutineDeterminismLevel
Determinism level for determinism_level. Applies to JavaScript UDFs — declaring DETERMINISTIC lets BigQuery cache results across query invocations with identical inputs.
BigqueryRoutineLanguage
Routine source language for language. SQL is the default for pure-SQL UDFs and TVFs; JAVASCRIPT runs inline JS bodies; PYTHON / JAVA / SCALA require an accompanying BigqueryRoutineSparkOptions block.
BigqueryRoutineSecurityMode
Security mode for security_mode. DEFINER runs the routine with the privileges of its owner; INVOKER runs with the caller's privileges. Defaults to BigQuery's auto-detect when omitted.
BigqueryRoutineType
Type of routine for routine_type. BigQuery currently supports three shapes at this provider version: scalar UDFs, stored procedures, and table-valued functions.
DatasetStorageBillingModel
Storage billing model for google_bigquery_dataset.storage_billing_model. LOGICAL (default per BigQuery API) bills by logical bytes; PHYSICAL bills by compressed on-disk bytes (typically cheaper for high-compression data with infrequent reads).
ExternalDataCompression
Compression for external_data_configuration.compression. BigQuery only accepts these two values; format-specific compression (Snappy for Parquet, Deflate for Avro, etc.) is inferred from the file.
ExternalDataSourceFormat
Source format for external_data_configuration.source_format. The googleSheets variant additionally requires https://www.googleapis.com/auth/drive.readonly on the service account performing the read.
FileSetSpecType
File-set spec for external_data_configuration.file_set_spec_type. fileSystemMatch (default) glob-expands source_uris against the underlying object store; newLineDelimitedManifest treats each source URI as a manifest file containing one object URI per line.
MetadataCacheMode
Metadata cache mode for external_data_configuration.metadata_cache_mode. automatic lets BigQuery refresh the cache on a service-controlled cadence; manual requires explicit BQ.REFRESH_EXTERNAL_METADATA_CACHE calls.
ObjectMetadata
Object metadata for external_data_configuration.object_metadata. Set this to create an Object Table (a listing of objects + their metadata) rather than a regular external table; when set, sourceFormat must be omitted.
TableMetadataView
View for table_metadata_view. Controls how much detail BigQuery returns when reading the table — basic (default) skips storage stats, storageStats adds size counters, full includes all optional fields. unspecified is the no-op default.
TimePartitioningType
Partition unit for time_partitioning.type. Maps to BigQuery's supported partition granularities.