google_bigquery_data_transfer_config

Represents a data transfer configuration. A transfer configuration contains all metadata needed to perform a data transfer.

To get more information about Config, see:

Example Usage - Bigquerydatatransfer Config Scheduled Query

data "google_project" "project" {
}

resource "google_project_iam_member" "permissions" {
  project = data.google_project.project.project_id
  role   = "roles/iam.serviceAccountTokenCreator"
  member = "serviceAccount:service-${data.google_project.project.number}@gcp-sa-bigquerydatatransfer.iam.gserviceaccount.com"
}

resource "google_bigquery_data_transfer_config" "query_config" {
  depends_on = [google_project_iam_member.permissions]

  display_name           = "my-query"
  location               = "asia-northeast1"
  data_source_id         = "scheduled_query"
  schedule               = "first sunday of quarter 00:00"
  destination_dataset_id = google_bigquery_dataset.my_dataset.dataset_id
  params = {
    destination_table_name_template = "my_table"
    write_disposition               = "WRITE_APPEND"
    query                           = "SELECT name FROM tabl WHERE x = 'y'"
  }
}

resource "google_bigquery_dataset" "my_dataset" {
  depends_on = [google_project_iam_member.permissions]

  dataset_id    = "my_dataset"
  friendly_name = "foo"
  description   = "bar"
  location      = "asia-northeast1"
}

Argument Reference

The following arguments are supported:


The schedule_options block supports:

The email_preferences block supports:

The sensitive_params block supports:

Attributes Reference

In addition to the arguments listed above, the following computed attributes are exported:

Timeouts

This resource provides the following Timeouts configuration options:

Import

Config can be imported using any of these accepted formats:

In Terraform v1.5.0 and later, use an import block to import Config using one of the formats above. For example:

import {
  id = "{{name}}"
  to = google_bigquery_data_transfer_config.default
}

When using the terraform import command, Config can be imported using one of the formats above. For example:

$ terraform import google_bigquery_data_transfer_config.default {{name}}

User Project Overrides

This resource supports User Project Overrides.