Skip to content

Commit 29a0783

Browse files
JohannesRudolphmeshkodiak[bot]
authored andcommitted
feat: add carbon_footprint_export_table_name output
1 parent f4a109d commit 29a0783

File tree

4 files changed

+12
-3
lines changed

4 files changed

+12
-3
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ To run this module, you need the following:
3232
# Only required when you need your landing zone to invoke a cloud function
3333
"cloudfunctions.functions.getIamPolicy",
3434
"cloudfunctions.functions.setIamPolicy",
35-
# Only required for the optional submodule for exporting carbon data
35+
# Only required for the optional submodule for exporting carbon data
3636
"resourcemanager.projects.update",
3737
"serviceusage.services.enable",
3838
"bigquery.transfers.update"
@@ -177,6 +177,7 @@ No resources.
177177

178178
| Name | Description |
179179
|------|-------------|
180+
| <a name="output_carbon_footprint_export_table_name"></a> [carbon\_footprint\_export\_table\_name](#output\_carbon\_footprint\_export\_table\_name) | The BigQuery table name containing the GCP Carbon Footprint BigQuery export. |
180181
| <a name="output_cloud_billing_export_table_name"></a> [cloud\_billing\_export\_table\_name](#output\_cloud\_billing\_export\_table\_name) | The BigQuery table name containing the GCP Cloud Billing BigQuery export. |
181182
| <a name="output_kraken_sa_email"></a> [kraken\_sa\_email](#output\_kraken\_sa\_email) | Kraken service account email. |
182183
| <a name="output_kraken_sa_key"></a> [kraken\_sa\_key](#output\_kraken\_sa\_key) | Kraken service account key. |

main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ module "carbon_export" {
2525
source = "./modules/meshcloud-carbon-export/"
2626
count = var.carbon_export_module_enabled ? 1 : 0
2727

28-
carbon_data_export_dataset_id = var.carbon_footprint_dataset_id
2928
carbon_data_export_project_id = var.cloud_billing_export_project_id # using the same project as for billing
29+
carbon_data_export_dataset_id = var.carbon_footprint_dataset_id
3030
carbon_dataset_region = var.carbon_footprint_dataset_location
3131

3232
billing_account_id = var.billing_account_id
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
output "carbon_footprint_export_table_name" {
22
description = "The BigQuery table name containing the GCP Carbon Footprint BigQuery export."
3-
value = "${var.carbon_data_export_project_id}.${var.carbon_data_export_dataset_id}.${var.carbon_data_export_dataset_id}"
3+
4+
# note carbon_footprint is the default table name that google's data transfer config creates
5+
# we can't control this via terraform right now
6+
value = "${var.carbon_data_export_project_id}.${var.carbon_data_export_dataset_id}.carbon_footprint"
47
}

outputs.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,8 @@ output "cloud_billing_export_table_name" {
2929
description = "The BigQuery table name containing the GCP Cloud Billing BigQuery export."
3030
value = "${var.cloud_billing_export_project_id}.${var.cloud_billing_export_dataset_id}.${var.cloud_billing_export_table_id}"
3131
}
32+
33+
output "carbon_footprint_export_table_name" {
34+
description = "The BigQuery table name containing the GCP Carbon Footprint BigQuery export."
35+
value = try(module.carbon_export[0].carbon_footprint_export_table_name, null)
36+
}

0 commit comments

Comments
 (0)