Skip to content

Commit 35ab65b

Browse files
Felix Ziegermeshkodiak[bot]
authored andcommitted
feat: variables and outputs for cloud billing export
1 parent 95f224b commit 35ab65b

File tree

7 files changed

+28
-13
lines changed

7 files changed

+28
-13
lines changed

examples/basic-gcp-integration/main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@ module "meshplatform" {
2727
billing_account_id = "..."
2828

2929
# required for kraken
30-
billing_dataset_project_id = "..."
31-
}
30+
cloud_billing_export_project_id = "..."
31+
}

examples/gcp-integration-lz-access-gdm-templates/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ module "meshplatform" {
2727
billing_account_id = "..."
2828

2929
# required for kraken
30-
billing_dataset_project_id = "..."
30+
cloud_billing_export_project_id = "..."
3131
}
3232

3333
# Details of the parameters are in the module structure input description (module README.md)

main.tf

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
module "kraken_sa" {
22
source = "./modules/meshcloud-kraken-service-account/"
33

4-
sa_name = var.kraken_sa_name
5-
org_id = var.org_id
6-
meshstack_root_project_id = var.project_id
7-
billing_dataset_project_id = var.billing_dataset_project_id
8-
landing_zone_folder_ids = var.landing_zone_folder_ids
4+
sa_name = var.kraken_sa_name
5+
org_id = var.org_id
6+
meshstack_root_project_id = var.project_id
7+
cloud_billing_export_project_id = var.cloud_billing_export_project_id
8+
landing_zone_folder_ids = var.landing_zone_folder_ids
99
}
1010

1111
module "replicator_sa" {

modules/meshcloud-kraken-service-account/module.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ resource "google_project_iam_member" "bigquery_jobuser" {
1919
}
2020

2121
resource "google_project_iam_member" "biquery_dataViewer" {
22-
project = var.billing_dataset_project_id
22+
project = var.cloud_billing_export_project_id
2323
role = "roles/bigquery.dataViewer"
2424

2525
member = "serviceAccount:${google_service_account.meshcloud_kraken_sa.email}"

modules/meshcloud-kraken-service-account/variables.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ variable "meshstack_root_project_id" {
1313
description = "GCP Project ID where to create the service account. This is typically a 'meshstack-root' project."
1414
}
1515

16-
variable "billing_dataset_project_id" {
16+
variable "cloud_billing_export_project_id" {
1717
type = string
18-
description = "GCP Project ID where the biquery table resides that holds billing data export."
18+
description = "GCP Project where the BiqQery table resides that holds the Cloud Billing export to BigQuery."
1919
}
2020

2121
variable "landing_zone_folder_ids" {

outputs.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,8 @@ output "kraken_sa_key" {
2424
value = module.kraken_sa.sa_key
2525
sensitive = true
2626
}
27+
28+
output "cloud_billing_export_table_name" {
29+
description = "The BigQuery table name containing the GCP Cloud Billing BigQuery export."
30+
value = "${var.cloud_billing_export_table_id}.${var.cloud_billing_export_table_id}.${var.cloud_billing_export_table_id}"
31+
}

variables.tf

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,19 @@ variable "landing_zone_folder_ids" {
2323
description = "GCP Folders that make up the Landing Zone. The service account will only receive permissions on these folders."
2424
}
2525

26-
variable "billing_dataset_project_id" {
26+
variable "cloud_billing_export_project_id" {
2727
type = string
28-
description = "GCP Project ID where the biquery table resides that holds billing data export."
28+
description = "GCP Project where the BiqQery table resides that holds the Cloud Billing export to BigQuery. See https://cloud.google.com/billing/docs/how-to/export-data-bigquery"
29+
}
30+
31+
variable "cloud_billing_export_dataset_id" {
32+
type = string
33+
description = "GCP BigQuery dataset containing the Cloud Billing BigQuery export."
34+
}
35+
36+
variable "cloud_billing_export_table_id" {
37+
type = string
38+
description = "GCP BigQuery table containing the Cloud Billing BigQuery export."
2939
}
3040

3141
# ---------------------------------------------------------------------------------------------------------------------

0 commit comments

Comments
 (0)