bigquery

This provider is a derived work of the Terraform Provider distributed under MPL 2.0. If you encounter a bug or missing feature, first check the pulumi/pulumi-gcp repo; however, if that doesn’t turn up anything, please consult the source terraform-providers/terraform-provider-google repo.

class pulumi_gcp.bigquery.Dataset(resource_name, opts=None, accesses=None, dataset_id=None, default_partition_expiration_ms=None, default_table_expiration_ms=None, delete_contents_on_destroy=None, description=None, friendly_name=None, labels=None, location=None, project=None, __props__=None, __name__=None, __opts__=None)

Creates a dataset resource for Google BigQuery. For more information see the official documentation and API.

Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • accesses (pulumi.Input[list]) – An array of objects that define dataset access for one or more entities. Structure is documented below.

  • dataset_id (pulumi.Input[str]) – The ID of the dataset containing this table.

  • default_partition_expiration_ms (pulumi.Input[float]) – The default partition expiration for all partitioned tables in the dataset, in milliseconds.

  • default_table_expiration_ms (pulumi.Input[float]) – The default lifetime of all tables in the dataset, in milliseconds. The minimum value is 3600000 milliseconds (one hour).

  • delete_contents_on_destroy (pulumi.Input[bool]) – If set to true, delete all the tables in the dataset when destroying the resource; otherwise, destroying the resource will fail if tables are present.

  • description (pulumi.Input[str]) – A user-friendly description of the dataset.

  • friendly_name (pulumi.Input[str]) – A descriptive name for the dataset.

  • labels (pulumi.Input[dict]) – A mapping of labels to assign to the resource.

  • location (pulumi.Input[str]) – The geographic location where the dataset should reside. See official docs.

  • project (pulumi.Input[str]) – The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

The accesses object supports the following:

  • domain (pulumi.Input[str]) - A domain to grant access to.

  • groupByEmail (pulumi.Input[str]) - An email address of a Google Group to grant access to.

  • role (pulumi.Input[str]) - Describes the rights granted to the user specified by the other member of the access object. Primitive, Predefined and custom roles are supported. Predefined roles that have equivalent primitive roles are swapped by the API to their Primitive counterparts, and will show a diff post-create. See official docs.

  • specialGroup (pulumi.Input[str]) - A special group to grant access to. Possible values include:

    • projectOwners: Owners of the enclosing project.

    • projectReaders: Readers of the enclosing project.

    • projectWriters: Writers of the enclosing project.

    • allAuthenticatedUsers: All authenticated BigQuery users.

  • userByEmail (pulumi.Input[str]) - An email address of a user to grant access to.

  • view (pulumi.Input[dict]) - A view from a different dataset to grant access to. Queries executed against that view will have read access to tables in this dataset. The role field is not required when this field is set. If that view is updated by any user, access to the view needs to be granted again via an update operation. Structure is documented below.

    • dataset_id (pulumi.Input[str]) - The ID of the dataset containing this table.

    • projectId (pulumi.Input[str]) - The ID of the project containing this table.

    • table_id (pulumi.Input[str]) - The ID of the table.

accesses = None

An array of objects that define dataset access for one or more entities. Structure is documented below.

  • domain (str) - A domain to grant access to.

  • groupByEmail (str) - An email address of a Google Group to grant access to.

  • role (str) - Describes the rights granted to the user specified by the other member of the access object. Primitive, Predefined and custom roles are supported. Predefined roles that have equivalent primitive roles are swapped by the API to their Primitive counterparts, and will show a diff post-create. See official docs.

  • specialGroup (str) - A special group to grant access to. Possible values include:

    • projectOwners: Owners of the enclosing project.

    • projectReaders: Readers of the enclosing project.

    • projectWriters: Writers of the enclosing project.

    • allAuthenticatedUsers: All authenticated BigQuery users.

  • userByEmail (str) - An email address of a user to grant access to.

  • view (dict) - A view from a different dataset to grant access to. Queries executed against that view will have read access to tables in this dataset. The role field is not required when this field is set. If that view is updated by any user, access to the view needs to be granted again via an update operation. Structure is documented below.

    • dataset_id (str) - The ID of the dataset containing this table.

    • projectId (str) - The ID of the project containing this table.

    • table_id (str) - The ID of the table.

creation_time = None

The time when this dataset was created, in milliseconds since the epoch.

dataset_id = None

The ID of the dataset containing this table.

default_partition_expiration_ms = None

The default partition expiration for all partitioned tables in the dataset, in milliseconds.

default_table_expiration_ms = None

The default lifetime of all tables in the dataset, in milliseconds. The minimum value is 3600000 milliseconds (one hour).

delete_contents_on_destroy = None

If set to true, delete all the tables in the dataset when destroying the resource; otherwise, destroying the resource will fail if tables are present.

description = None

A user-friendly description of the dataset.

etag = None

A hash of the resource.

friendly_name = None

A descriptive name for the dataset.

labels = None

A mapping of labels to assign to the resource.

last_modified_time = None

The date when this dataset or any of its tables was last modified, in milliseconds since the epoch.

location = None

The geographic location where the dataset should reside. See official docs.

project = None

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

The URI of the created resource.

static get(resource_name, id, opts=None, accesses=None, creation_time=None, dataset_id=None, default_partition_expiration_ms=None, default_table_expiration_ms=None, delete_contents_on_destroy=None, description=None, etag=None, friendly_name=None, labels=None, last_modified_time=None, location=None, project=None, self_link=None)

Get an existing Dataset resource’s state with the given name, id, and optional extra properties used to qualify the lookup.

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • accesses (pulumi.Input[list]) – An array of objects that define dataset access for one or more entities. Structure is documented below.

  • creation_time (pulumi.Input[float]) – The time when this dataset was created, in milliseconds since the epoch.

  • dataset_id (pulumi.Input[str]) – The ID of the dataset containing this table.

  • default_partition_expiration_ms (pulumi.Input[float]) – The default partition expiration for all partitioned tables in the dataset, in milliseconds.

  • default_table_expiration_ms (pulumi.Input[float]) – The default lifetime of all tables in the dataset, in milliseconds. The minimum value is 3600000 milliseconds (one hour).

  • delete_contents_on_destroy (pulumi.Input[bool]) – If set to true, delete all the tables in the dataset when destroying the resource; otherwise, destroying the resource will fail if tables are present.

  • description (pulumi.Input[str]) – A user-friendly description of the dataset.

  • etag (pulumi.Input[str]) – A hash of the resource.

  • friendly_name (pulumi.Input[str]) – A descriptive name for the dataset.

  • labels (pulumi.Input[dict]) – A mapping of labels to assign to the resource.

  • last_modified_time (pulumi.Input[float]) – The date when this dataset or any of its tables was last modified, in milliseconds since the epoch.

  • location (pulumi.Input[str]) –

    The geographic location where the dataset should reside. See official docs.

  • project (pulumi.Input[str]) – The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

  • self_link (pulumi.Input[str]) – The URI of the created resource.

The accesses object supports the following:

  • domain (pulumi.Input[str]) - A domain to grant access to.

  • groupByEmail (pulumi.Input[str]) - An email address of a Google Group to grant access to.

  • role (pulumi.Input[str]) - Describes the rights granted to the user specified by the other member of the access object. Primitive, Predefined and custom roles are supported. Predefined roles that have equivalent primitive roles are swapped by the API to their Primitive counterparts, and will show a diff post-create. See official docs.

  • specialGroup (pulumi.Input[str]) - A special group to grant access to. Possible values include:

    • projectOwners: Owners of the enclosing project.

    • projectReaders: Readers of the enclosing project.

    • projectWriters: Writers of the enclosing project.

    • allAuthenticatedUsers: All authenticated BigQuery users.

  • userByEmail (pulumi.Input[str]) - An email address of a user to grant access to.

  • view (pulumi.Input[dict]) - A view from a different dataset to grant access to. Queries executed against that view will have read access to tables in this dataset. The role field is not required when this field is set. If that view is updated by any user, access to the view needs to be granted again via an update operation. Structure is documented below.

    • dataset_id (pulumi.Input[str]) - The ID of the dataset containing this table.

    • projectId (pulumi.Input[str]) - The ID of the project containing this table.

    • table_id (pulumi.Input[str]) - The ID of the table.

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

class pulumi_gcp.bigquery.Table(resource_name, opts=None, dataset_id=None, description=None, expiration_time=None, external_data_configuration=None, friendly_name=None, labels=None, project=None, schema=None, table_id=None, time_partitioning=None, view=None, __props__=None, __name__=None, __opts__=None)

Creates a table resource in a dataset for Google BigQuery. For more information see the official documentation and API.

Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • dataset_id (pulumi.Input[str]) – The dataset ID to create the table in. Changing this forces a new resource to be created.

  • description (pulumi.Input[str]) – The field description.

  • expiration_time (pulumi.Input[float]) – The time when this table expires, in milliseconds since the epoch. If not present, the table will persist indefinitely. Expired tables will be deleted and their storage reclaimed.

  • external_data_configuration (pulumi.Input[dict]) – Describes the data format, location, and other properties of a table stored outside of BigQuery. By defining these properties, the data source can then be queried as if it were a standard BigQuery table. Structure is documented below.

  • friendly_name (pulumi.Input[str]) – A descriptive name for the table.

  • labels (pulumi.Input[dict]) – A mapping of labels to assign to the resource.

  • project (pulumi.Input[str]) – The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

  • schema (pulumi.Input[str]) – A JSON schema for the table. Schema is required for CSV and JSON formats and is disallowed for Google Cloud Bigtable, Cloud Datastore backups, and Avro formats when using external tables. For more information see the BigQuery API documentation.

  • table_id (pulumi.Input[str]) – A unique ID for the resource. Changing this forces a new resource to be created.

  • time_partitioning (pulumi.Input[dict]) – If specified, configures time-based partitioning for this table. Structure is documented below.

  • view (pulumi.Input[dict]) – If specified, configures this table as a view. Structure is documented below.

The external_data_configuration object supports the following:

  • autodetect (pulumi.Input[bool])

  • compression (pulumi.Input[str])

  • csvOptions (pulumi.Input[dict])

    • allowJaggedRows (pulumi.Input[bool])

    • allowQuotedNewlines (pulumi.Input[bool])

    • encoding (pulumi.Input[str])

    • fieldDelimiter (pulumi.Input[str])

    • quote (pulumi.Input[str])

    • skipLeadingRows (pulumi.Input[float])

  • googleSheetsOptions (pulumi.Input[dict])

    • range (pulumi.Input[str])

    • skipLeadingRows (pulumi.Input[float])

  • ignoreUnknownValues (pulumi.Input[bool])

  • maxBadRecords (pulumi.Input[float])

  • sourceFormat (pulumi.Input[str])

  • sourceUris (pulumi.Input[list])

The time_partitioning object supports the following:

  • expirationMs (pulumi.Input[float])

  • field (pulumi.Input[str])

  • requirePartitionFilter (pulumi.Input[bool])

  • type (pulumi.Input[str]) - Describes the table type.

The view object supports the following:

  • query (pulumi.Input[str])

  • useLegacySql (pulumi.Input[bool])

creation_time = None

The time when this table was created, in milliseconds since the epoch.

dataset_id = None

The dataset ID to create the table in. Changing this forces a new resource to be created.

description = None

The field description.

etag = None

A hash of the resource.

expiration_time = None

The time when this table expires, in milliseconds since the epoch. If not present, the table will persist indefinitely. Expired tables will be deleted and their storage reclaimed.

external_data_configuration = None

Describes the data format, location, and other properties of a table stored outside of BigQuery. By defining these properties, the data source can then be queried as if it were a standard BigQuery table. Structure is documented below.

  • autodetect (bool)

  • compression (str)

  • csvOptions (dict)

    • allowJaggedRows (bool)

    • allowQuotedNewlines (bool)

    • encoding (str)

    • fieldDelimiter (str)

    • quote (str)

    • skipLeadingRows (float)

  • googleSheetsOptions (dict)

    • range (str)

    • skipLeadingRows (float)

  • ignoreUnknownValues (bool)

  • maxBadRecords (float)

  • sourceFormat (str)

  • sourceUris (list)

friendly_name = None

A descriptive name for the table.

labels = None

A mapping of labels to assign to the resource.

last_modified_time = None

The time when this table was last modified, in milliseconds since the epoch.

location = None

The geographic location where the table resides. This value is inherited from the dataset.

num_bytes = None

The size of this table in bytes, excluding any data in the streaming buffer.

num_long_term_bytes = None

The number of bytes in the table that are considered “long-term storage”.

num_rows = None

The number of rows of data in this table, excluding any data in the streaming buffer.

project = None

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

schema = None

A JSON schema for the table. Schema is required for CSV and JSON formats and is disallowed for Google Cloud Bigtable, Cloud Datastore backups, and Avro formats when using external tables. For more information see the BigQuery API documentation.

The URI of the created resource.

table_id = None

A unique ID for the resource. Changing this forces a new resource to be created.

time_partitioning = None

If specified, configures time-based partitioning for this table. Structure is documented below.

  • expirationMs (float)

  • field (str)

  • requirePartitionFilter (bool)

  • type (str) - Describes the table type.

type = None

Describes the table type.

view = None

If specified, configures this table as a view. Structure is documented below.

  • query (str)

  • useLegacySql (bool)

static get(resource_name, id, opts=None, creation_time=None, dataset_id=None, description=None, etag=None, expiration_time=None, external_data_configuration=None, friendly_name=None, labels=None, last_modified_time=None, location=None, num_bytes=None, num_long_term_bytes=None, num_rows=None, project=None, schema=None, self_link=None, table_id=None, time_partitioning=None, type=None, view=None)

Get an existing Table resource’s state with the given name, id, and optional extra properties used to qualify the lookup.

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • creation_time (pulumi.Input[float]) – The time when this table was created, in milliseconds since the epoch.

  • dataset_id (pulumi.Input[str]) – The dataset ID to create the table in. Changing this forces a new resource to be created.

  • description (pulumi.Input[str]) – The field description.

  • etag (pulumi.Input[str]) – A hash of the resource.

  • expiration_time (pulumi.Input[float]) – The time when this table expires, in milliseconds since the epoch. If not present, the table will persist indefinitely. Expired tables will be deleted and their storage reclaimed.

  • external_data_configuration (pulumi.Input[dict]) – Describes the data format, location, and other properties of a table stored outside of BigQuery. By defining these properties, the data source can then be queried as if it were a standard BigQuery table. Structure is documented below.

  • friendly_name (pulumi.Input[str]) – A descriptive name for the table.

  • labels (pulumi.Input[dict]) – A mapping of labels to assign to the resource.

  • last_modified_time (pulumi.Input[float]) – The time when this table was last modified, in milliseconds since the epoch.

  • location (pulumi.Input[str]) – The geographic location where the table resides. This value is inherited from the dataset.

  • num_bytes (pulumi.Input[float]) – The size of this table in bytes, excluding any data in the streaming buffer.

  • num_long_term_bytes (pulumi.Input[float]) – The number of bytes in the table that are considered “long-term storage”.

  • num_rows (pulumi.Input[float]) – The number of rows of data in this table, excluding any data in the streaming buffer.

  • project (pulumi.Input[str]) – The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

  • schema (pulumi.Input[str]) –

    A JSON schema for the table. Schema is required for CSV and JSON formats and is disallowed for Google Cloud Bigtable, Cloud Datastore backups, and Avro formats when using external tables. For more information see the BigQuery API documentation.

  • self_link (pulumi.Input[str]) – The URI of the created resource.

  • table_id (pulumi.Input[str]) – A unique ID for the resource. Changing this forces a new resource to be created.

  • time_partitioning (pulumi.Input[dict]) – If specified, configures time-based partitioning for this table. Structure is documented below.

  • type (pulumi.Input[str]) – Describes the table type.

  • view (pulumi.Input[dict]) – If specified, configures this table as a view. Structure is documented below.

The external_data_configuration object supports the following:

  • autodetect (pulumi.Input[bool])

  • compression (pulumi.Input[str])

  • csvOptions (pulumi.Input[dict])

    • allowJaggedRows (pulumi.Input[bool])

    • allowQuotedNewlines (pulumi.Input[bool])

    • encoding (pulumi.Input[str])

    • fieldDelimiter (pulumi.Input[str])

    • quote (pulumi.Input[str])

    • skipLeadingRows (pulumi.Input[float])

  • googleSheetsOptions (pulumi.Input[dict])

    • range (pulumi.Input[str])

    • skipLeadingRows (pulumi.Input[float])

  • ignoreUnknownValues (pulumi.Input[bool])

  • maxBadRecords (pulumi.Input[float])

  • sourceFormat (pulumi.Input[str])

  • sourceUris (pulumi.Input[list])

The time_partitioning object supports the following:

  • expirationMs (pulumi.Input[float])

  • field (pulumi.Input[str])

  • requirePartitionFilter (pulumi.Input[bool])

  • type (pulumi.Input[str]) - Describes the table type.

The view object supports the following:

  • query (pulumi.Input[str])

  • useLegacySql (pulumi.Input[bool])

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str