Skip to content

Commit

Permalink
Fix resource for bigquery transfer
Browse files Browse the repository at this point in the history
Official documentation about the resource `google_bigquery_data_transfer_config`
is incorrect on some points. I added and fixed some fields and
parameters blocks.

Used source code of the resource and official GCP documentation:

https://github.com/hashicorp/terraform-provider-google/blob/master/google/resource_bigquery_data_transfer_config.go
https://cloud.google.com/bigquery/docs/copying-datasets#setting_up_a_dataset_copy

Signed-off-by: Arnaud Meukam <[email protected]>
  • Loading branch information
ameukam committed Jul 29, 2021
1 parent 9d984b6 commit 045b60d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions infra/gcp/clusters/projects/k8s-infra-public-pii/bigquery.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,21 @@ resource "google_project_iam_member" "bq_data_transfer_writer_binding" {
resource "google_bigquery_data_transfer_config" "bq_data_transfer" {
display_name = "BigQuey data transfer to ${google_bigquery_dataset.audit-logs-gcs.dataset_id}"
project = google_project.project.project_id
data_source_id = "k8s-infra-ii-sandbox.riaan_data_store"
data_source_id = "cross_region_copy"
schedule = "every 24 hours" #Times are in UTC
destination_dataset_id = google_bigquery_dataset.audit-logs-gcs.dataset_id
service_account_name = google_service_account.bq_data_transfer_writer.email
disabled = false

params = {
write_disposition = "WRITE_TRUNCATE" #Overwrite existing data
overwrite_destination_table = "true"
source_dataset_id = "riaan_data_store"
source_project_id = "k8s-infra-ii-sandbox"
}

schedule_options {
start_time = "15h00" #in UTC
disable_auto_scheduling = false
start_time = "2021-07-29T15:00:00Z"
}

email_preferences {
Expand Down

0 comments on commit 045b60d

Please sign in to comment.