2022-01-01 06:52:31 -08:00
|
|
|
# Copyright 2022 Google LLC
|
2020-06-26 12:45:41 -07:00
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# https://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
|
|
|
|
output "bq_tables" {
|
|
|
|
description = "Bigquery Tables."
|
2020-10-29 15:22:58 -07:00
|
|
|
value = module.bigquery-dataset.table_ids
|
2020-06-26 12:45:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
output "buckets" {
|
|
|
|
description = "GCS Bucket Cloud KMS crypto keys."
|
|
|
|
value = {
|
2022-01-14 00:32:29 -08:00
|
|
|
data = module.gcs-data.name
|
|
|
|
df-tmp = module.gcs-df-tmp.name
|
2020-06-26 12:45:41 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-01-13 09:28:38 -08:00
|
|
|
output "data_ingestion_command" {
|
|
|
|
value = <<-EOF
|
|
|
|
python data_ingestion.py \
|
|
|
|
--runner=DataflowRunner \
|
|
|
|
--max_num_workers=10 \
|
|
|
|
--autoscaling_algorithm=THROUGHPUT_BASED \
|
|
|
|
--region=${var.region} \
|
2022-01-14 00:32:29 -08:00
|
|
|
--staging_location=${module.gcs-df-tmp.url} \
|
|
|
|
--temp_location=${module.gcs-df-tmp.url}/ \
|
|
|
|
--project=${var.project_id} \
|
|
|
|
--input=${module.gcs-data.url}/### FILE NAME ###.csv \
|
2022-01-13 09:28:38 -08:00
|
|
|
--output=${module.bigquery-dataset.dataset_id}.${module.bigquery-dataset.table_ids.df_import} \
|
|
|
|
--service_account_email=${module.service-account-df.email} \
|
2022-01-14 00:32:29 -08:00
|
|
|
--network=${module.vpc.name} \
|
|
|
|
--subnetwork=${local.subnet_name} \
|
2022-01-13 09:28:38 -08:00
|
|
|
--dataflow_kms_key=${module.kms.key_ids.key-df} \
|
|
|
|
--no_use_public_ips
|
|
|
|
EOF
|
|
|
|
}
|
|
|
|
|
2022-01-14 00:32:29 -08:00
|
|
|
output "project_id" {
|
|
|
|
description = "Project id."
|
|
|
|
value = module.project.project_id
|
2020-06-26 12:45:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
output "vm" {
|
2021-10-04 01:46:44 -07:00
|
|
|
description = "GCE VM."
|
2020-06-26 12:45:41 -07:00
|
|
|
value = {
|
2022-01-13 09:28:38 -08:00
|
|
|
name = module.vm.instance.name
|
|
|
|
address = module.vm.internal_ip
|
2020-06-26 12:45:41 -07:00
|
|
|
}
|
|
|
|
}
|