🤖
BigQuery Data Transfer Serviceで cross region dataset copy する Terraform
今回の環境
- 転送元
- project_id : a_project
- dataset_id : a_dataset
- 転送先
- project_id : b_project
- dataset_id : b_dataset
実際のtfファイル
data_transfer.tf
resource "google_bigquery_data_transfer_config" "sample_tansfer_config" {
display_name = "sample_tansfer"
location = "US"
data_source_id = "cross_region_copy"
destination_dataset_id = "b_dataset"
project = "b_project"
schedule = "every day 00:00" #UTC Time
service_account_name = google_service_account.foobar.email
params = {
source_project_id = "a_project"
source_dataset_id = "a_dataset"
overwrite_destination_table = "true"
}
}
ポイント
- overwrite_destination_table
- 転送先を上書きする
- schedule
- "every day 00:00" は日次転送を示す
- data_source_id
- data_source_id が "cross_region_copy" ってなんでやという気はする
参考にしました
-
https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/bigquery_data_transfer_config
- もう少しここに説明がほしい(足りない)
- https://cloud.google.com/bigquery/docs/managing-datasets?hl=ja
-
https://zenn.dev/shase/articles/ba28afec28be35
- 昔の自分の記事...
-
https://qiita.com/shase428q/items/87bd3b0251910315bc11
- 昔の自分の記事...
Discussion