这更多的是关于可能性的问题,因为 GCP 上没有与此相关的文档。 我正在使用 BigQuery DTS 将 CSV 从 GCS 存储桶移动到 BQ 表。我已经手动尝试过并且它可以工作,但我需要它背后的一些自动化,并且希望使用 Terraform 来实现它。 我已经检查过此链接,但它并没有完全帮助: https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/bigquery_data_transfer_config
如有任何帮助,我们将不胜感激。谢谢!
最佳答案
我认为问题是文档没有列出参数。这是一个例子。与API进行比较。
https://cloud.google.com/bigquery-transfer/docs/cloud-storage-transfer#bq
resource "google_bigquery_data_transfer_config" "sample" {
display_name = "sample"
location = "asia-northeast1"
data_source_id = "google_cloud_storage"
schedule = "every day 10:00"
destination_dataset_id = "target_dataset"
params = {
data_path_template = "gs://target_bucket/*"
destination_table_name_template = "target_table"
file_format = "CSV"
write_disposition = "MIRROR"
max_bad_records = 0
ignore_unknown_values = "false"
field_delimiter = ","
skip_leading_rows = "1"
allow_quoted_newlines = "false"
allow_jagged_rows = "false"
delete_source_files = "false"
}
}
关于google-cloud-platform - 用于云存储传输的 BigQuery 数据传输服务是否可以使用 Terraform 实现?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70281902/